Email Address

Location /api/apps/{appID}/users/{userID}/email-address
This resource represents the email address of the user.

Request Headers (Applies to all methods)

Authorization
header
Required: Yes

GET

/api/apps/{appID}/users/{userID}/email-address

Description

Get the email address of the user.

Security

An Anonymous access is not allowed. This method can be accessed by the application administrator and the user himself. Other users can access the method if the application property "exposeFullUserDataToOthers" is set to true.

Headers
Name Required? type Description
Authorization Yes string Authorization header. OAuth2 Bearer token
Responses
200

Content-Type application/vnd.kii.EmailAddressRetrievalResponse+json

The email address has been retrieved successfully.
Contents
Name Type Description
emailAddress string The email address.
verified boolean The flag indicating if the email address is verified or not.
404

Content-Type application/vnd.kii.UserNotFoundException+json

The user was not found.
Contents
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.
401

Content-Type application/vnd.kii.UnauthorizedAccessException+json

Not authorized to read the email address of the user.
Contents
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).
404

Content-Type application/vnd.kii.UserWithoutAddressException+json

The user did not have any email address.
Contents
Name Type Description
errorCode string Error code "USER_ADDRESS_NOT_FOUND".
message string The error message.
userID string The ID of the user without address
appID string The ID of the application.

PUT

/api/apps/{appID}/users/{userID}/email-address

Description

Update the email address of the user

Security

This method can be performed by the administrator and by the user himself. Setting the parameter "verified" to true can be done only with the application administrator credentials.

Content-Type application/vnd.kii.EmailAddressModificationRequest+json

The data for updating the email address.

Headers
Name Required? type Description
Authorization Yes string Authorization header. OAuth2 Bearer token
Params
Name Required? Type Description
emailAddress string The new email address.
verified boolean The flag indicating if the new email address is already verified.
Sample Request
{
  "emailAddress": "[string]",
  "verified": "[boolean]"
}
Responses
204

Content-Type (None)

The email address has been updated successfully.
Note This response has no contents.
404

Content-Type application/vnd.kii.UserNotFoundException+json

The user was not found.
Contents
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.
401

Content-Type application/vnd.kii.UnauthorizedAccessException+json

Not authorized to update the email address.
Contents
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).
409

Content-Type application/vnd.kii.AddressAlreadyInUseException+json

The email address is already verified by another user.
Contents
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.
409

Content-Type application/vnd.kii.OperationNotAllowedException+json

The user did not have a password.
Contents
Name Type Description
errorCode string Error code "OPERATION_NOT_ALLOWED".
message string The error message.

DELETE

/api/apps/{appID}/users/{userID}/email-address

Description

Remove the email address from the user.

Security

Can be performed by the administrator and the user himself.

Headers
Name Required? type Description
Authorization Yes string Authorization header. OAuth2 Bearer token
Responses
204

Content-Type (None)

The email address has been removed successfully from the user.
Note This response has no contents.
404

Content-Type application/vnd.kii.UserNotFoundException+json

The user was not found.
Contents
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.
401

Content-Type application/vnd.kii.UnauthorizedAccessException+json

Not authorized to remove the email address.
Contents
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).