Skip to content

获取全部工单自定义字段

该接口用于获取全部工单自定义字段。

请求

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

请求头

名称类型必填描述
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

查询参数

名称类型必填描述
page_tokenstring分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 示例值:"6948728206392295444"
page_sizeint分页大小 示例值:10;默认为20 数据校验规则: - 最大值:100

请求体

名称类型必填描述
visibleboolean是否可见 示例值:true

请求体示例

json
{
    "visible": true
}

响应

响应体

名称类型描述
codeint错误码,非 0 表示失败
msgstring错误描述
data\--
∟ has_moreboolean是否还有更多项
∟ next_page_tokenstring下一分页标识
∟ itemsticket_customized_field\[\]工单自定义字段列表
∟ ticket_customized_field_idstring工单自定义字段ID
∟ helpdesk_idstring服务台ID
∟ key_namestring键名
∟ display_namestring名称
∟ positionstring字段在列表后台管理列表中的位置
∟ field_typestring类型
∟ descriptionstring描述
∟ visibleboolean是否可见
∟ editableboolean是否可以修改
∟ requiredboolean是否必填
∟ created_atstring创建时间
∟ updated_atstring更新时间
∟ created_byticket_user创建用户
∟ idstring用户ID
∟ avatar_urlstring用户头像url
∟ namestring用户名
∟ emailstring用户邮箱
∟ updated_byticket_user更新用户
∟ idstring用户ID
∟ avatar_urlstring用户头像url
∟ namestring用户名
∟ emailstring用户邮箱
∟ dropdown_optionsdropdown_option下拉列表选项
∟ childrendropdown_option[]选项列表
∟ tagstring选项ID
∟ display_namestring展示名称
∟ childrendropdown_option[]同上:选项列表,只适用于多层下拉列表(最多可以设置三级下拉列表)
∟ dropdown_allow_multipleboolean是否支持多选,仅在字段类型是dropdown的时候有效

响应体示例

json
{
    "code": 0,
    "msg": "success",
    "data": {
        "has_more": true,
        "next_page_token": "6948728206392295444",
        "items": [
            {
                "ticket_customized_field_id": "6834320707288072194",
                "helpdesk_id": "1542164574896126",
                "key_name": "test dropdown",
                "display_name": "test dropdown",
                "position": "3",
                "field_type": "dropdown",
                "description": "下拉示例",
                "visible": true,
                "editable": true,
                "required": false,
                "created_at": "1591239289000",
                "updated_at": "1591239289000",
                "created_by": {
                    "id": "ou_37019b7c830210acd88fdce886e25c71",
                    "avatar_url": "https://xxxx",
                    "name": "abc",
                    "email": "xxxx@abc.com"
                },
                "updated_by": {
                    "id": "ou_37019b7c830210acd88fdce886e25c71",
                    "avatar_url": "https://xxxx",
                    "name": "abc",
                    "email": "xxxx@abc.com"
                },
                "dropdown_options": {
                    "children": [
                        {
                            "tag": "c495fe14-aac0-4fd6-8851-9fde726e2a40",
                            "display_name": "l1",
                            "children": [
                                {
                                    "tag": "498ed5f1-f2b1-4585-b21f-3d4d2cd0cd26",
                                    "display_name": "l2"
                                },
                                {
                                    "tag": "51285604-367f-454f-adca-b4760c38850d",
                                    "display_name": "l22"
                                }
                            ]
                        },
                        {
                            "tag": "295cf315-df56-445b-b430-b58925ef331c",
                            "display_name": "l11"
                        }
                    ]
                },
                "dropdown_allow_multiple": true
            }
        ]
    }
}

错误码

HTTP状态码错误码描述排查建议
400154000Bad request, please check your request body请求不合法,请检查参数
401154001Unauthorized, please check you have the correct access检查Authorization 和 X-Lark-Helpdesk-Authorization 是否正确,应用和服务台属于同一租户
403154003Please check you have the correct access检查是否申请正确权限
500155000Internal error内部错误,请联系我们

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