Skip to content

获取全部知识库分类

该接口用于获取服务台知识库所有分类。

请求

项目
HTTP URLhttps://open.feishu.cn/open-apis/helpdesk/v1/categories
HTTP MethodGET
权限要求 调用该 API 所需的权限。开启其中任意一项权限即可调用获取服务台资源详情

请求头

名称类型必填描述
Authorizationstringtenant_access_token 值格式:"Bearer access_token" 示例值:"Bearer t-7f1bcd13fc57d46bac21793a18e560" 了解更多:如何选择与获取 access token
Content-Typestring固定值:"application/json; charset=utf-8"

Tip: 服务台请求Header中还需添加“服务台token”参数:

Key: X-Lark-Helpdesk-Authorization

Value: base64(helpdesk_id:helpdesk_token),通过base64加密将helpdesk_id和helpdesk_token用':'连接而成的字符串。

了解更多:获取与使用服务台token

查询参数

名称类型必填描述
langstring知识库分类语言 示例值:"zh_cn"
order_byint排序键。1: 根据知识库分类更新时间排序 示例值:1
ascboolean顺序。true: 正序;false:反序 示例值:true

响应

响应体

名称类型描述
codeint错误码,非 0 表示失败
msgstring错误描述
data\--
∟ categoriescategory\[\]知识库分类列表
∟ category_idstring知识库分类ID
∟ idstring知识库分类ID,(旧版,请使用category_id)
∟ namestring名称
∟ parent_idstring父知识库分类ID
∟ helpdesk_idstring服务台ID
∟ languagestring语言
∟ childrencategory[]子分类详情

响应体示例

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状态码错误码描述排查建议
401154001Unauthorized, please check you have the correct access检查Authorization 和 X-Lark-Helpdesk-Authorization 是否正确,应用和服务台属于同一租户
500155000Internal error内部错误,请联系我们

内容来源:飞书开放平台 · 自动爬取整理