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

ParameterDescriptionTypeRequired
Authorization“Bearer app_token” Literal text Bearer followed by app_token that is the token obtained from /oauth2/token endpointstringyes
Content-TypeThe type of content that will be used for requests to be JSONstringyes
AcceptThe type of content that will be used for responses to be JSONstringyes
FromName of the entry point stringyes
Accept-LanguageLanguage for this requestLocaleno

Request example

ParameterDescriptionTypeRequiredValue
actor.idapp_id of the application you are using to log userstringyesapp id
actor.objectTypeType of the object which represents the actor.stringyes‘application’
verbVerb used for the loginstringyes‘request’
object.objectTypeObjectType represents the userstringyes‘user’
object.passwordPassword of the user. it must be send plainstringyesnew password for user
context.codeCode received in email/SMSstringyescode
source.idType of device doing the activitystringyes‘unknown’ | ‘pc’ | ‘mobile’ | ‘tablet’ | ‘game_console’ | ‘itv’
source.objectTypeType of sourcestringyes‘device’

Response examples

Response: user password reseted successfully

ParameterDescriptionType
result.statusHTTP status codeinteger

Response KO: code not found

ParameterDescriptionType
result.statusHTTP status codeinteger
result.resultsarrayarray of errors struct
result.errorsarrayarray of errors
result.errors[].messagestringmessage error

Response KO: code has already been used

ParameterDescriptionType
result.statusHTTP status codeinteger
result.resultsarrayarray of errors struct
result.errorsarrayarray of errors
result.errors[].messagestringmessage error

Response KO: code generated for other method/action

ParameterDescriptionType
result.statusHTTP status codeinteger
result.resultsarrayarray of errors struct
result.errorsarrayarray of errors
result.errors[].messagestringmessage error

Response KO: password is weak

ParameterDescriptionType
result.statusHTTP status codeinteger
result.resultsarrayarray of errors struct
result.errorsarrayarray of errors
result.errors[].messagestringmessage error
result.errors[].detailsstringmessage error detail

Response codes

CodeTypeDescription
400ErrorBad Request: The request could not be understood by the server due to malformed syntax
401ErrorUnauthorized: authentication is required and has failed or has not yet been provided (token is invalid, etc)
412ErrorPrecondition failed: can not reset password because password is weak
417ErrorExpectation Failed: operation could not be performed due to code errors
417 -> 404ErrorCode not found in database
417 -> 410ErrorCode already used
417 -> 409ErrorCode was not generated for that method (eg: when code for register confirmtion is used here)
417 -> 498ErrorCode is expired
500ErrorInternal Server Error: The server encountered an unexpected condition which prevented it from fulfilling the request
502ErrorBad Gateway: notification service is nor working fine so notification can not be sent
200SuccessNotification sent to user successfully