获取全部知识库分类
该接口用于获取服务台知识库所有分类。
请求
| 项目 | 值 |
|---|---|
| HTTP URL | https://open.feishu.cn/open-apis/helpdesk/v1/categories |
| HTTP Method | GET |
| 权限要求 调用该 API 所需的权限。开启其中任意一项权限即可调用 | 获取服务台资源详情 |
请求头
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| Authorization | string | 是 | tenant_access_token 值格式:"Bearer access_token" 示例值:"Bearer t-7f1bcd13fc57d46bac21793a18e560" 了解更多:如何选择与获取 access token |
| Content-Type | string | 是 | 固定值:"application/json; charset=utf-8" |
Tip: 服务台请求Header中还需添加“服务台token”参数:
Key: X-Lark-Helpdesk-Authorization
Value: base64(helpdesk_id:helpdesk_token),通过base64加密将helpdesk_id和helpdesk_token用':'连接而成的字符串。
查询参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
lang | string | 否 | 知识库分类语言 示例值:"zh_cn" |
order_by | int | 否 | 排序键。1: 根据知识库分类更新时间排序 示例值:1 |
asc | boolean | 否 | 顺序。true: 正序;false:反序 示例值:true |
响应
响应体
| 名称 | 类型 | 描述 |
|---|---|---|
code | int | 错误码,非 0 表示失败 |
msg | string | 错误描述 |
data | \- | - |
∟ categories | category\[\] | 知识库分类列表 |
∟ category_id | string | 知识库分类ID |
∟ id | string | 知识库分类ID,(旧版,请使用category_id) |
∟ name | string | 名称 |
∟ parent_id | string | 父知识库分类ID |
∟ helpdesk_id | string | 服务台ID |
∟ language | string | 语言 |
∟ children | category[] | 子分类详情 |
响应体示例
json
{
"code": 0,
"msg": "success",
"data": {
"categories": [
{
"category_id": "6948728206392295444",
"id": "6948728206392295444",
"name": "创建团队和邀请成员",
"parent_id": "0",
"helpdesk_id": "6939771743531696147",
"language": "zh_cn",
"children": [
{
"id": "4",
"name": "Hardware",
"parent_id": "6841014521893552132",
"children": [
{
"id": "5",
"name": "Computer",
"parent_id": "4",
"helpdesk_id": "123456",
"language": "en_us"
}
],
"helpdesk_id": "123456",
"language": "en_us"
}
],
}
]
}
}错误码
| HTTP状态码 | 错误码 | 描述 | 排查建议 |
|---|---|---|---|
| 401 | 154001 | Unauthorized, please check you have the correct access | 检查Authorization 和 X-Lark-Helpdesk-Authorization 是否正确,应用和服务台属于同一租户 |
| 500 | 155000 | Internal error | 内部错误,请联系我们 |
