Request Headers (Applies to all methods)
GET
/api/apps/{appID}/users/me
Retrieve the user information.
An anonymous access to this method is not allowed.
You can retrieve the full user's data if you access this method with the application administrator credentials or with the token of the target user.
If you access this method with the different user's token, the amount of the user information you can retrieve depends on the setting made on the application property "exposeFullUserDataToOthers".
- You will be able to get the full data if the property is set to "true."
- You will be able to get only the "userID", "loginName", and "displayName" fields if the property is set to "false" or "null".
Content-Type application/vnd.kii.UserDataRetrievalResponse+json
Name | Type | Description |
---|---|---|
userID | string | The ID of the user. |
internalUserID | long | The internal ID of the user. |
loginName | string | The login name of the user. |
displayName | string | The display name of the user. |
country | string | The country of the user. |
locale | string | The locale of the user. |
emailAddress | string | The email address of the user. |
emailAddressVerified | boolean | The flag indicating if the user's email address is verified. |
phoneNumber | string | The phone number of the user. |
phoneNumberVerified | boolean | The flag indicating if the user's phone number is verified. |
_hasPassword | boolean | The flag indicating if the user has the password. |
Content-Type application/vnd.kii.UserNotFoundException+json
Name | Type | Description |
---|---|---|
errorCode | string | Error code "USER_NOT_FOUND". |
message | string | The error message. |
field | string | The field used for searching the user. This can be the userID or address field. |
value | string | The field value used for searching the user. |
appID | string | The ID of the application. |
Content-Type application/vnd.kii.UnauthorizedAccessException+json
Name | Type | Description |
---|---|---|
errorCode | string | Error code "UNAUTHORIZED". |
message | string | The error message. |
authenticatedAppID | string | The authenticated appID. |
authenticatedPrincipalID | string | The authenticated principal ID (userID or thingID). |
POST
/api/apps/{appID}/users/me
Modify user's data. You can modify the following fields:
- country
- locale
- displayName
- password
- loginName
- emailAddress
- phoneNumber
- custom fields
The predefined fields are modified if they have values in the request. The predefined fields that do not have any value in the request will remain untouched.
The custom fields will always be overwritten by the content in the request. You need to put all custom fields you want to preserve, regardless of if you want to change their field values or not. The fields will be removed otherwise.
This operation has the following limitations:
- This operation cannot be used for changing the user's current password.
- You can use this method to set a password to a user who currently does not have any password (i.e. the user is currently a pseudo user, and you want to convert him to a normal user). In this case, you need to provide at least one of loginName, phoneNumber or emailAddress.
- To set an emailAddress, loginName, and phoneNumber, the user must already have a password. If the user currently does not have any password, a new password must be provided in the same request.
Only the administrator and the user himself can access this method.
Content-Type application/vnd.kii.UserUpdateRequest+json
The data for updating the user.
{
"country": "[string]",
"locale": "[string]",
"displayName": "[string]",
"password": "[string]",
"loginName": "[string]",
"emailAddress": "[string]",
"phoneNumber": "[string]"
}
Content-Type application/vnd.kii.UserUpdateResponse+json
Name | Type | Description |
---|---|---|
modifiedAt | long | The modification date of the user in Unix epoch (milliseconds in UTC). |
Content-Type application/vnd.kii.UserNotFoundException+json
Name | Type | Description |
---|---|---|
errorCode | string | Error code "USER_NOT_FOUND". |
message | string | The error message. |
field | string | The field used for searching the user. This can be the userID or address field. |
value | string | The field value used for searching the user. |
appID | string | The ID of the application. |
Content-Type application/vnd.kii.AddressAlreadyInUseException+json
Name | Type | Description |
---|---|---|
errorCode | string | Error code "USER_ALREADY_EXISTS". |
message | string | The error message. |
field | string | The field used to check the user already exists, can be "loginName", "emailAddress" or "phoneNumber". |
value | string | The value of the field. |
Content-Type application/vnd.kii.UnauthorizedAccessException+json
Name | Type | Description |
---|---|---|
errorCode | string | Error code "UNAUTHORIZED". |
message | string | The error message. |
authenticatedAppID | string | The authenticated appID. |
authenticatedPrincipalID | string | The authenticated principal ID (userID or thingID). |
DELETE
/api/apps/{appID}/users/me
Delete the user from Kii Cloud.
This operation will invalidate all authorization tokens of the user.
The operation will also delete all installations of the user.
Only the administrator and the user himself can access this method.
Content-Type (None)
Content-Type application/vnd.kii.UserNotFoundException+json
Name | Type | Description |
---|---|---|
errorCode | string | Error code "USER_NOT_FOUND". |
message | string | The error message. |
field | string | The field used for searching the user. This can be the userID or address field. |
value | string | The field value used for searching the user. |
appID | string | The ID of the application. |
Content-Type application/vnd.kii.UnauthorizedAccessException+json
Name | Type | Description |
---|---|---|
errorCode | string | Error code "UNAUTHORIZED". |
message | string | The error message. |
authenticatedAppID | string | The authenticated appID. |
authenticatedPrincipalID | string | The authenticated principal ID (userID or thingID). |