Skip to content

Commit

Permalink
add description how to reset user password
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuliya Pazniak committed Nov 12, 2024
1 parent 5c522c0 commit 1278bef
Showing 1 changed file with 51 additions and 1 deletion.
52 changes: 51 additions & 1 deletion datapress/administration/disable-user.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,54 @@ Add **icds_order_header=1** in your request URL:
https://{your-wordpress-site}/wp-json/wp/v2/users?context=edit&icds_order_header=1
```

Also use the **X-Icds-Order** header. Here you can specify the field name to sort users, for, example **url** or **username**.
Also use the **X-Icds-Order** header. Here you can specify the field name to sort users, for, example **url** or **username**.

## How to reset user password

To reset a user password, you need to send a **POST** request to the following URL:

```
https://{your-wordpress-site}/wp-json/integration-cds/v1/reset_password?email={userEmail}&id={userId}&login={userLogin}
```

This request should contain one of the following parameters:

- **email**: User email
- **id**: WordPress user ID
- **login**: User login for the WordPress site

The order of reading parameters is: id, email, login.

This request will immediately send a password reset link to the specified user email and return an empty body (204 response). In case of an error, it will return a 500 response with an error description:

```text
{
"code": 3,
"message": "User not found.",
"data": null
}
```

Alternatively, you can send a **GET** request to:

```
https://{your-wordpress-site}/wp-json/integration-cds/v1/[email protected]
```

This request should contain **one** of the following parameters:

- **email**: User email
- **id**: WordPress user ID
- **login**: User login for the WordPress site

It will return a JSON response with the link for password resetting created by WordPress (or an error description in case of an error):

```text
{
"link": "https://your-wordpress-site.com/wp-login.php?action=rp&key=HEA7wLLCEvtnV3Ick1bQ&login={username}&wp_lang=en_US"
}
```

:::note
Don’t forget to include Basic Authentication for all requests.
:::

0 comments on commit 1278bef

Please sign in to comment.