-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add description how to reset user password
- Loading branch information
Yuliya Pazniak
committed
Nov 12, 2024
1 parent
5c522c0
commit 1278bef
Showing
1 changed file
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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. | ||
::: |