Description
You have to call this method when you want to change password of a user that does not remember password. Previously, you have called Send remember my password notification to send user a change password code via email/sms. User must insert this code and password to reset.
Please, read first: https://dru-id.com/developers/apis/oauth-2/ to learn about Oauth2 protocol and the meaning of each token.
Endpoint URL:
POST https://{your-endpoint-domain.com}/activityid/v1/password/replace
Request parameters
Parameter | Description | Type | Required |
---|---|---|---|
Authorization | “Bearer app_token” Literal text Bearer followed by app_token that is the token obtained from /oauth2/token endpoint | string | yes |
Content-Type | The type of content that will be used for requests to be JSON | string | yes |
Accept | The type of content that will be used for responses to be JSON | string | yes |
From | Name of the entry point | string | yes |
Accept-Language | Language for this request | Locale | no |
Request example
Parameter | Description | Type | Required | Value |
---|---|---|---|---|
actor.id | app_id of the application you are using to log user | string | yes | app id |
actor.objectType | Type of the object which represents the actor. | string | yes | ‘application’ |
verb | Verb used for the login | string | yes | ‘request’ |
object.objectType | ObjectType represents the user | string | yes | ‘user’ |
object.password | Password of the user. it must be send plain | string | yes | new password for user |
context.code | Code received in email/SMS | string | yes | code |
source.id | Type of device doing the activity | string | yes | ‘unknown’ | ‘pc’ | ‘mobile’ | ‘tablet’ | ‘game_console’ | ‘itv’ |
source.objectType | Type of source | string | yes | ‘device’ |
Response examples
Response: user password reseted successfully
Parameter | Description | Type |
---|---|---|
result.status | HTTP status code | integer |
Response KO: code not found
Parameter | Description | Type |
---|---|---|
result.status | HTTP status code | integer |
result.results | array | array of errors struct |
result.errors | array | array of errors |
result.errors[].message | string | message error |
Response KO: code has already been used
Parameter | Description | Type |
---|---|---|
result.status | HTTP status code | integer |
result.results | array | array of errors struct |
result.errors | array | array of errors |
result.errors[].message | string | message error |
Response KO: code generated for other method/action
Parameter | Description | Type |
---|---|---|
result.status | HTTP status code | integer |
result.results | array | array of errors struct |
result.errors | array | array of errors |
result.errors[].message | string | message error |
Response KO: password is weak
Parameter | Description | Type |
---|---|---|
result.status | HTTP status code | integer |
result.results | array | array of errors struct |
result.errors | array | array of errors |
result.errors[].message | string | message error |
result.errors[].details | string | message error detail |
Response codes
Code | Type | Description |
---|---|---|
400 | Error | Bad Request: The request could not be understood by the server due to malformed syntax |
401 | Error | Unauthorized: authentication is required and has failed or has not yet been provided (token is invalid, etc) |
412 | Error | Precondition failed: can not reset password because password is weak |
417 | Error | Expectation Failed: operation could not be performed due to code errors |
417 -> 404 | Error | Code not found in database |
417 -> 410 | Error | Code already used |
417 -> 409 | Error | Code was not generated for that method (eg: when code for register confirmtion is used here) |
417 -> 498 | Error | Code is expired |
500 | Error | Internal Server Error: The server encountered an unexpected condition which prevented it from fulfilling the request |
502 | Error | Bad Gateway: notification service is nor working fine so notification can not be sent |
200 | Success | Notification sent to user successfully |