Retrieve detailed information about a single document in the AnQiCMS system, including basic document information, classification information, content details, and other custom field information.This interface is applicable to content of document and product types.
Points to note
- The interface supports retrieving document details through document ID or URL alias (filename) in two ways
- You can get the previous and next documents through this interface
- Some fields such as price, stock, and SKU are only valid in product type documents
- The response includes SEO-related fields for easy SEO optimization
- If the document does not exist, the interface will return an error code
Request address
{域名地址}/api/archive/detail
Description:{域名地址}Replace it with your domain name, such ashttps://en.anqicms.com/api/archive/detail
Request Syntax
GET {域名地址}/api/archive/detail?{参数}
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, if filename is provided, ID is not required |
| filename | string | No | Document URL alias, choose either document ID or filename, if ID is provided and filename is prev/next, then return the previous or next document |
| password | string | No | Document password, if the document is set with a password, then you need to enter the password to obtain the full content |
| render | bool | No | Whether to render Markdown content, default is true |
NoteThis interface can also retrieve the previous or next document of a specified document, the method of use is: when parameters id and filename are passed at the same time, the value of filename is prev/next, then the previous or next document is returned
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#archive | result content |
data document information
| Field name | Type | Description |
|---|---|---|
| id | int | Document ID |
| is_wholesale | bool | Is it a wholesale product |
| wholesale rule | object | applicable to wholesale rules |
| Wholesale rules | object[] | List of wholesale rules |
| sku | object | single, a selected sku, such as favorites, shopping cart, wish list, etc., used when reading |
| Skus | object[] | Sku list |
| options | object[] | specification options information |
| is_favorite | bool | whether to collect |
| brand | string | Product Brand |
| Video URL | string | Video address |
| Need Logistics | bool | Whether need logistics |
| Is Free Shipping | bool | Is Delivery Free |
| sold_count | int | sold count |
| review count | int | Number of reviews |
| favorite count | int | Number of favorites |
| option type | int | Specification type, 0 No SKU, 1 Composite SKU, 2 Markup SKU |
| weight | int | weight |
| weight unit | string | Weight unit |
| allow oversold | bool | Are there overselling allowed |
| has_order_fields | bool | Do you have order fields extended |
| order_fields | object[] | Order extension fields |
| Title | string | Document title |
| seo title | string | Document SEO Title |
| URL Token | string | Document URL Alias |
| keywords | string | Document keyword |
| description | string | Document Introduction |
| module_id | int | Document Model ID |
| category_id | int | Document Category ID |
| Views | int | Document Views |
| Comment Count | int | Document Comment Volume |
| Images | string array | document group chart |
| Logo | string | document logo |
| thumbnail | string | document thumbnail |
| flag | string | Document recommendation attribute, headline [h] recommendation [c] slide [f] featured [a] scroll [s] bold [h] image [p] jump [j] |
| canonical_url | string | canonical URL |
| fixed link | string | document fixed link |
| created_time | int | document publish timestamp |
| updated_time | int | document update timestamp |
| status | int | document display status |
| user_id | int | user ID |
| price | int | price, in cents |
| stock | int | inventory quantity |
| user_id | int | user ID |
| category | object#category | Document category information |
| data | object#content | Document content information |
| extra | object#map | Other fields information in the document |
category document classification information
| Field name | Type | Description |
|---|---|---|
| id | int | Category ID |
| parent_id | int | Category Parent ID |
| Title | string | Category Name |
| seo title | string | Category SEO Title |
| URL Token | string | Category URL Alias |
| keywords | string | Category Keywords |
| description | string | Category introduction |
| module_id | int | Model ID |
| content | string | category content details |
| type | int | Category Attribute Value, 1 Category, 3 Single Page |
| sort | int | Category Sorting Value |
| Images | string array | Category Banner Image |
| Logo | string | Category Thumbnail |
| thumbnail | string | Category Thumbnail |
| created_time | int | document publish timestamp |
| updated_time | int | document update timestamp |
| status | int | document display status |
content document content information
| Field name | Type | Description |
|---|---|---|
| id | int | Category ID |
| content | string | document content details |
Extra other fields information in the document
extra According to the model settings, the field display is, the field structure is key => item: key is the name of the form field, item is the content:
| Field name | Type | Description |
|---|---|---|
| name | string | field name |
| value | string | written value |
| default | string | Default value |
example of data request
GET /api/archive/detail?id=1 HTTP/1.1
Host: your-domain.com
Content-Type: application/json
or
GET /api/archive/detail?filename=anqicms HTTP/1.1
Host: your-domain.com
Content-Type: application/json
example of data return
{
"code": 0,
"data": {
"id": 1,
"created_time": 1607308159,
"updated_time": 1662717106,
"title": "欢迎使用AnqiCMS",
"seo_title": "",
"url_token": "anqicms",
"keywords": "",
"description": "欢迎使用AnqiCMS",
"module_id": 1,
"category_id": 1,
"views": 1338,
"comment_count": 0,
"images": null,
"status": 1,
"canonical_url": "",
"fixed_link": "",
"flag": "",
"user_id": 0,
"price": 0,
"stock": 9999999,
"category": {
"id": 1,
"created_time": 1607308159,
"updated_time": 1657761249,
"title": "AnqiCMS帮助",
"seo_title": "",
"keywords": "",
"url_token": "goruning",
"description": "",
"content": "<p>欢迎使用AnqiCMS</p>",
"module_id": 1,
"parent_id": 0,
"type": 1,
"sort": 1,
"images": [],
"logo": "https://en.anqicms.com/uploads/202012/7/bd36c37ef742c7be.webp",
"status": 1,
"thumb": "https://en.anqicms.com/uploads/202012/7/thumb_bd36c37ef742c7be.webp"
},
"data": {
"id": 1,
"content": "<p>欢迎使用AnqiCMS</p>"
},
"logo": "https://en.anqicms.com/uploads/202012/7/bd36c37ef742c7be.webp",
"thumb": "https://en.anqicms.com/uploads/202012/7/thumb_bd36c37ef742c7be.webp",
"extra": {
"author": {
"name": "作者",
"value": "AnqiCMS",
"default": ""
}
},
"link": ""
},
"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 |