Get detailed information of a single page, supporting retrieval of single page content through single page ID or URL alias.
Points to note
- This interface uses the GET method
- Supports retrieval of single-page content through ID or filename parameters
- Returns complete information of a single page, including title, content, SEO information, etc.
- Only return single-page content that has been published (status is 1)
Request address
{域名地址}/api/page/detail
Description:{域名地址}Replace it with your domain name, such ashttps://en.anqicms.com/api/page/detail
Request Syntax
GET {域名地址}/api/page/detail
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 |
|---|---|---|---|
| id | int | Is | Single-page ID, if filename is passed, ID is not required |
| filename | string | No | Single page URL alias, either single page ID or filename |
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 |
| data | object | Single page detailed information object |
Data result parameter
| Field name | Type | Description |
|---|---|---|
| id | int | Single page ID |
| Title | string | Single page name |
| seo title | string | Single Page SEO Title |
| URL Token | string | Single Page URL Alias |
| keywords | string | Single Page Keywords |
| description | string | Single Page Introduction |
| content | string | Single Page Content Details |
| type | int | Single page attribute value, 1 single page, 3 single page |
| sort | int | Single page sorting value |
| Images | string array | Single page Banner image |
| Logo | string | Single page Logo |
| thumbnail | string | single page thumbnail |
| created_time | int | single page publish timestamp |
| updated_time | int | single page update timestamp |
| status | int | single page display status |
Usage Example
request example (by ID)
GET /api/page/detail?id=1 HTTP/1.1
Host: www.anqicms.com
Example request (through filename obtained)
GET /api/page/detail?filename=help HTTP/1.1
Host: www.anqicms.com
Response Example
{
"code": 0,
"msg": "",
"data": {
"id": 1,
"created_time": 1607308159,
"updated_time": 1657761249,
"title": "AnqiCMS使用帮助",
"seo_title": "",
"keywords": "",
"url_token": "help",
"description": "",
"content": "<p><br/></p>",
"type": 3,
"sort": 1,
"images": [],
"logo": "",
"status": 1,
"thumb": "https://en.anqicms.com/uploads/202012/7/bd36c37ef742c7be.webp"
}
}
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 |