Verify document password interface

Verify if the password for accessing the password-protected document is correct, used to protect the document content that requires password access. If the verification is successful, return the document content; if the verification fails, return an error message.

Points to note

  • This interface uses the POST method to submit a verification request
  • The interface requires both document ID and password for verification
  • The document content will be returned after successful verification, or an error message will be returned upon failure
  • Only applicable to documents with password protection

Request address

{域名地址}/api/archive/password/check

Description:{域名地址}Replace it with your domain name, such ashttps://en.anqicms.com/api/archive/password/check

Request Syntax

POST {域名地址}/api/archive/password/check

Request Headers

This interface involves only public request headers. For more information, please refer toCommon Request Headers (Common Request Headers).

Request parameters

Field name Type Required Description
id int Is Document ID
password string Is Enter the password

Response header

This interface only involves common 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
data object Verification result

Verification result object

Field name Type Description
status boolean Verification result, true/false
content string Document content, returned if the verification passes

example of data request

Parameter Value
id 1
password 123456

Usage Example

Request example

POST /api/archive/password/check HTTP/1.1
Host: your-domain.com
Content-Type: application/json

{
  "id": 1,
  "password": "123456"
}

Response Example

When verification is successful:

{
  "code": 0,
  "msg": "",
  "data": {
    "status": true,
    "content": "<p>...</p>"
  }
}

When verification fails:

{
  "code": 0,
  "msg": "密码错误",
  "data": {
    "status": false,
    "content": ""
  }
}

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