Reset user password through email verification, user needs to provide the email address, new password, verification token, and verification code.
Cautionary notes
- This interface uses the POST method and requires data to be submitted in application/ format
- Currently, passwords can only be reset by email
- Need to be used with the email sending email function, the user must first obtain the verification link
- Need to provide the email sending verification token and code value
- The new password must meet the system password strength requirements
- Verification information has an expiration period, and a new verification email needs to be sent after expiration
Request address
{域名地址}/api/password/reset
Description:{域名地址}It needs to be replaced with your domain address, such ashttps://en.anqicms.com/api/password/reset
Request Syntax
POST {域名地址}/api/password/reset
Content-Type: application/json
Request Headers
This interface also involves public request headers. More information, please refer toPublic Request Headers (Common Request Headers).
Request Parameters
| Field Name | Type | Required | Description |
|---|---|---|---|
| string | yes | email address registered by the user | |
| password | string | yes | new password, must meet the password strength requirements |
| token | string | yes | The token value in the link sent to the email, used for identity verification |
| code | string | yes | The code value in the link sent to the email, used for identity verification |
Response header
This interface only involves public response headers. More information, please refer toPublic Request Headers (Common Request Headers).
Return parameters
| Field Name | Type | Description |
|---|---|---|
| code | int | Error code |
| msg | string | Error Description |
Usage Example
Request Example
POST /api/password/reset HTTP/1.1
Host: www.anqicms.com
Content-Type: application/json
{
"email": "[email protected]",
"password": "NewPassword123",
"token": "abc123def456",
"code": "789xyz"
}
Response Example
Successful Response
{
"code": 0,
"msg": "密码重置成功"
}
Validation failed response
{
"code": -1,
"msg": "验证信息无效或已过期"
}
Error code
| Error code | Description |
|---|---|
| 0 | OK |
| -1 | Error, the error reason is indicated in msg |
| 1001 | Not logged in |
| 1002 | Unauthorized |
| 200 | API request OK |