Get the tag list of the website, supporting functions such as obtaining tags of specific documents by document ID, filtering by initial letter, and pagination queries.
Points to note
- This interface uses the GET method
- Can get the complete tag list or tags of specified documents.
- Support filtering tags by first letter
- Supports pagination queries, allowing you to specify the number of items per page and the page number
- Support different return types (list or pagination)
- Return basic information and SEO related information of tags
Request address
{域名地址}/api/tag/list
Description:{域名地址}Replace it with your domain name, such ashttps://en.anqicms.com/api/tag/list
Request Syntax
GET {域名地址}/api/tag/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 |
|---|---|---|---|
| itemId | int | No | Document ID, read the Tag list of the specified document, or read all tags if not specified |
| letter | string | No | The first letter, specifying the first letter can retrieve the specified tag set |
| type | string | No | Link format, default list, can be list|page, type=page when total can be obtained |
| page | int | No | Retrieve specified pagination data, only valid 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[] | Tag list data |
| Total | int | Total count, returned only when type=page |
parameter of data item
| Field name | Type | Description |
|---|---|---|
| id | int | Tag ID |
| Title | string | Tag Name |
| seo title | string | Tag SEO title |
| URL Token | string | Tag URL alias |
| keywords | string | Tab keywords |
| description | string | Tab description |
| first_letter | string | Tag initial letter |
| link | string | Tag link address |
| created_time | int | Tag creation timestamp |
| updated_time | int | Label update timestamp |
| status | int | Label display status |
Usage Example
Request example
Get the tag list of the specified document
GET /api/tag/list?itemId=1 HTTP/1.1
Host: www.anqicms.com
Get all tag list (filtered by first letter)
GET /api/tag/list?letter=A HTTP/1.1
Host: www.anqicms.com
Get all tag list (pagination mode)
GET /api/tag/list?type=page&page=1&limit=10 HTTP/1.1
Host: www.anqicms.com
Get tag list of specified document (pagination mode)
GET /api/tag/list?itemId=1&type=page&page=1&limit=5 HTTP/1.1
Host: www.anqicms.com
Response Example
Get response of tag list of specified document
{
"code": 0,
"msg": "",
"data": [
{
"id": 1,
"title": "AnqiCMS",
"seo_title": "",
"url_token": "anqicms",
"keywords": "",
"description": "",
"first_letter": "A",
"link": "https://en.anqicms.com/tag/1/",
"created_time": 1662733318,
"updated_time": 1662733318,
"status": 1
},
{
"id": 3,
"title": "内容管理",
"seo_title": "",
"url_token": "content-management",
"keywords": "",
"description": "",
"first_letter": "C",
"link": "https://en.anqicms.com/tag/3/",
"created_time": 1662733320,
"updated_time": 1662733320,
"status": 1
}
]
}
Get all tag list response
{
"code": 0,
"msg": "",
"data": [
{
"id": 1,
"title": "AnqiCMS",
"seo_title": "",
"url_token": "anqicms",
"keywords": "",
"description": "",
"first_letter": "A",
"link": "https://en.anqicms.com/tag/1/",
"created_time": 1662733318,
"updated_time": 1662733318,
"status": 1
},
{
"id": 2,
"title": "安企CMS",
"seo_title": "",
"url_token": "an-qi-cms",
"keywords": "",
"description": "",
"first_letter": "A",
"link": "https://en.anqicms.com/tag/2/",
"created_time": 1662733318,
"updated_time": 1662733318,
"status": 1
},
{
"id": 3,
"title": "内容管理",
"seo_title": "",
"url_token": "content-management",
"keywords": "",
"description": "",
"first_letter": "C",
"link": "https://en.anqicms.com/tag/3/",
"created_time": 1662733320,
"updated_time": 1662733320,
"status": 1
}
],
"total": 3
}
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 |