标签字典
基于 dp_tag_categories、dp_tags_base 返回按业务大类分组的启用标签。用于前端展示筛选条件,以及向 公共数字人 等接口传入 tag_ids。
请求地址
http
GET /open/v1/common/tag_listHeader
http
access_token: {{access_token}}请求参数 Query Params
| Key | 示例 | 说明 |
|---|---|---|
| business_type | 1 | 业务类型,可重复传参或使用逗号分隔多个值;多个值为并集(返回这些业务类型下大类的合集)。常见取值:1 数字人、2 声音(以平台实际配置为准) |
| (不传) | — | 不传 business_type 时,返回全部业务大类及其下启用标签 |
传参说明
- 与 OpenAPI 约定一致时,数组型查询可使用 CSV(如
business_type=1,2)或 重复键(如business_type=1&business_type=2)。
响应
响应示例
json
{
"trace_id": "a1b2c3d4e5f678901234567890abcdef",
"code": 0,
"msg": "success",
"data": {
"list": [
{
"id": 10,
"name": "场景",
"business_type": 1,
"weight": 100,
"tag_child_count": 3,
"update_time": "2026-03-24 12:00:00",
"tag_list": [
{
"id": 101,
"name": "美妆",
"category_id": 10,
"parent_id": 0,
"level": 1,
"weight": 10,
"status": 1,
"update_time": "2026-03-24 12:00:00"
}
]
}
]
}
}响应字段说明
data.list[](业务大类 / 标签分组)
| 字段 | 说明 |
|---|---|
| id | 大类 ID |
| name | 大类名称 |
| business_type | 业务类型 |
| weight | 排序权重 |
| tag_child_count | 子标签数量 |
| update_time | 更新时间 |
| tag_list | 该大类下的标签明细列表 |
data.list[].tag_list[](单条标签)
| 字段 | 说明 |
|---|---|
| id | 标签 ID(用于 list_common_dp 的 tag_ids 等筛选参数) |
| name | 标签名称 |
| category_id | 所属大类 ID |
| parent_id | 父标签 ID;顶级为 0 |
| level | 层级 |
| weight | 排序权重 |
| status | 状态 |
| update_time | 更新时间 |
响应状态码说明
| code | 说明 |
|---|---|
| 0 | 响应成功 |
| 10400 | AccessToken 验证失败 |
| 40000 | 参数错误 |
| 50000 / 51000 | 系统内部错误 |
示例代码
shell
curl -L -X GET 'https://www.chanjing.cc/api/open/v1/common/tag_list?business_type=1' \
-H 'access_token: {{your_token}}' \
-H 'Content-Type: application/json'go
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
url := "https://www.chanjing.cc/api/open/v1/common/tag_list?business_type=1"
req, err := http.NewRequest("GET", url, nil)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("access_token", "{{your_token}}")
req.Header.Add("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}java
OkHttpClient client = new OkHttpClient().newBuilder().build();
Request request = new Request.Builder()
.url("https://www.chanjing.cc/api/open/v1/common/tag_list?business_type=1")
.get()
.addHeader("access_token", "{{your_token}}")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();py
import requests
url = "https://www.chanjing.cc/api/open/v1/common/tag_list?business_type=1"
headers = {
"access_token": "{{your_token}}",
"Content-Type": "application/json",
}
print(requests.get(url, headers=headers).text)