Get detailed information of a specified label, including label name, SEO information, link address, and other basic information.
Points to note
- This interface uses the GET method
- Provide a tag ID or tag URL alias (filename) to specify the query tag
- Label ID or URL alias, either one is optional. If the filename parameter is provided, the ID does not need to be transmitted.
- Return basic information and SEO related information of tags
- Settings that can be used for page title, keywords, and description
Request address
{域名地址}/api/tag/detail
Description:{域名地址}Replace it with your domain name, such ashttps://en.anqicms.com/api/tag/detail
Request Syntax
GET {域名地址}/api/tag/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 | 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 |
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 | Label detail data |
data parameter
| 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 |
| content | string | Label content |
| 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 /api/tag/detail?id=1 HTTP/1.1
Host: www.anqicms.com
Response Example
{
"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/",
"content": "<p>AnqiCMS 是一个基于 PHP 的开源内容管理系统,支持内容管理、内容发布、内容搜索、内容评论、内容标签、内容分类</p>"
"created_time": 1662733318,
"updated_time": 1662733318,
"status": 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 |