Retrieve the list of relevant documents under the specified tag, supporting various sorting methods and pagination queries.
Points to note
- This interface uses the GET method
- Provide a tag ID or tag URL alias (filename) to specify the query tag
- Supports various sorting methods, you can choose different sorting fields as needed
- Supports pagination queries, allowing you to specify the number of items per page and the page number
- Supports data retrieval in different ways (pagination, list, related documents, etc.)
- Returns basic and extended information of the document
Request address
{域名地址}/api/tag/data/list
Description:{域名地址}Replace it with your domain name, such ashttps://en.anqicms.com/api/tag/data/list
Request Syntax
GET {域名地址}/api/tag/data/list
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 | No | Tag ID, if filename is provided, ID is not required |
| filename | string | No | Tag URL alias, either Tag ID or filename can be selected |
| order | string | No | Sorting method, such as:id desc, supported fields include:id/views/category_id/created_time/updated_timeetc |
| type | string | No | Method of acquisition, supportedpage/list/relatedList in the manner, the default value islist |
| page | int | No | Specify the page content to be obtained, only effective when type=“page” |
| limit | int | No | Display count, supports offset mode, such as "2,10" indicating to retrieve 10 records starting from the 2nd one |
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[] | result content |
| Total | int | Document count, returned only when type=page |
parameter of data item
| Field name | Type | Description |
|---|---|---|
| id | int | Document ID |
| 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 |
| extra | object | extended field information of document |
| link | string | document link address |
Usage Example
Request example
GET /api/tag/data/list?id=1&type=page&page=1&limit=10 HTTP/1.1
Host: www.anqicms.com
Response Example
{
"code": 0,
"msg": "",
"data": [
{
"id": 1,
"title": "关于AnqiCMS",
"seo_title": "",
"url_token": "design",
"keywords": "",
"description": "安企内容管理系统(AnqiCMS),是一款使用 GoLang 开发的企业站内容管理系统...",
"module_id": 1,
"category_id": 1,
"views": 1338,
"comment_count": 0,
"images": null,
"logo": "https://en.anqicms.com/uploads/202012/7/bd36c37ef742c7be.webp",
"thumb": "https://en.anqicms.com/uploads/202012/7/thumb_bd36c37ef742c7be.webp",
"flag": "",
"canonical_url": "",
"fixed_link": "",
"created_time": 1607308159,
"updated_time": 1662717106,
"status": 1,
"user_id": 0,
"price": 0,
"stock": 9999999,
"extra": {
"author": {
"name": "作者",
"value": "AnqiCMS",
"default": null
}
},
"link": "https://en.anqicms.com/design"
}
],
"total": 1
}
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 |