Password

Location /api/apps/{appID}/users/me/password
This resource represents the password of the current user.

Request Headers (Applies to all methods)

Authorization
header
Required: Yes

PUT

/api/apps/{appID}/users/me/password

Description

Change the password of the user.

Security

Can be performed only by the administrator and by the user himself.

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

The data for changing the password. The old password is not needed if the administrator is changing the password.

Headers
Name Required? type Description
Authorization Yes string Authorization header. OAuth2 Bearer token
Params
Name Required? Type Description
oldPassword string The current password of the user.
newPassword string The new password of the user. The length must be between 4 and 50 characters and must follow the pattern: \p{Print} (only printable characters).
Sample Request
{
  "oldPassword": "[string]",
  "newPassword": "[string]"
}
Responses
204

Content-Type (None)

The password has been changed 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

An anonymous access or an access by other users was not allowed.
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).
400

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

The new password was too short.
Contents
Name Type Description
message string The error message.
errorCode string Error code "PASSWORD_TOO_SHORT".
minimumLength int The minimum length accepted.
401

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

The old password in the request did not match with the current password of the user.
Contents
Name Type Description
message string The error message.
errorCode string Error code "WRONG_PASSWORD".
appID string The ID of the application.
principalID string The ID of the of the principal (user or thing)
address string The address used for identifying the principal
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.