Reset the user's password through email verification, the user needs to provide the email address, new password, verification token, and verification code.
Points to note
- The API uses the POST method and requires data to be submitted in application/ format
- Currently, the password can only be reset through email
- To be used in conjunction with the email sending email feature, the user needs to obtain the verification link first
- Provide the email sending verification token and code values
- The new password must meet the system password strength requirements
- The verification information has an expiration period, and a new verification email needs to be sent after expiration
Request address
{域名地址}/api/password/reset
Description:{域名地址}Replace it with your domain name, such ashttps://en.anqicms.com/api/password/reset
Request Syntax
POST {域名地址}/api/password/reset
Content-Type: application/json
Request Headers
This interface also involves common request headers. For more information, please refer toCommon Request Headers (Common Request Headers).
Request parameters
| Field name | Type | Required | Description |
|---|---|---|---|
| string | Is | The email address registered by the user | |
| password | string | Is | New password, must meet password strength requirements |
| token | string | Is | Token value in the link sent to the email, used to verify identity |
| code | string | Is | Code value in the link sent to the email, used to verify identity |
Response header
This interface only involves public response headers. For more information, please refer toCommon 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": "密码重置成功"
}
Invalid verification response
{
"code": -1,
"msg": "验证信息无效或已过期"
}
error code
| Error code | Description |
|---|---|
| 0 | OK |
| -1 | Error, the reason is indicated in msg |
| 1001 | Not logged in |
| 1002 | Not authorized |
| 200 | API request OK |