Andrew Fletcher published: 19 May 2022 (updated) 30 May 2022 1 minute read
How to use the Drupal REST API to trigger I've forgot (need to change) my password.
POST: {domain}/user/password?_format=hal_json
Content-type: application/hal_json
Accept: application/hal+jsonOr if you are using hal_json then use
POST: {domain}/user/password?_format=json
Content-type: application/json
Accept: application/jsonBody
{
"mail": "your@yoursite.email"
}All going well there will be no response.
Other responses
However, if you have sent an email that doesn't exist on the site, then the response will be text-based. Such as:
{
"message": "Unrecognized username or email address."
}The user is blocked or not activated:
{
"message": "The user has not been activated or is blocked."
}