How to change the password through the Cosync REST API
The changePassword function will reset a user’s password for an app when the user is logged in. The parameters include the old password. and a new password. The passwords must be in MD5 format.
URL
/api/appuser/changePassword
Method
POST
Headers
access-token: "<Access Token>"
Data Parameter
{
password: "<user password>",
newPassword: "<new user password>"
}
Response:
Success:
StatusCode:
200 (OK)
Contents:
true
Error:
StatusCode:
400 (BAD REQUEST)
500 (INTERNAL SERVER ERROR)
Content:
{
code: "<internal error code>",
message: "<readable error description>"
}
The internal codes are integers:
- 401 - app no longer exists
- 402 - app is suspended
- 403 - missing parameter
- 404 - user account is suspended
- 405 - invalid access token
- 500 - internal server error
- 602 - invalid data