How to reset the password through the Cosync REST API
Reset password will reset a user’s password for an app, after the forgotPassword function was called. The parameters include the user handle, a new password, and a verification code that was sent to the user handle through a forgotPassword function call. The password must be in MD5 format. If successful, the resetPassword function will turn off all two-factor verification for the account. The user has to re-enable it to turn it back on.
URL
/api/appuser/resetPassword
Method
POST
Headers
app-token: "<App Token>"
Data Parameter
{
handle: "<user handle>",
password: "<user password>",
code: "<verification code>"
}
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:
- 400 - invalid app token
- 401 - app no longer exists
- 402 - app is suspended
- 403 - missing parameter
- 404 - user account is suspended
- 500 - internal server error
- 602 - invalid data