Skip to content

获取指定工单自定义字段

该接口用于获取工单自定义字段详情。

请求

项目
HTTP URLhttps://open.feishu.cn/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id
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

路径参数

名称类型描述
ticket_customized_field_idstring工单自定义字段ID 示例值:"6948728206392295444"

响应

响应体

名称类型描述
codeint错误码,非 0 表示失败
msgstring错误描述
dataticket_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": {
        "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":"a2ac322d-8d8c-432e-9631-17c4acaddbf7",
               "display_name":"a"
            },
            {
               "tag":"67068d18-20c9-412e-afc0-714d0e8fac29",
               "display_name":"b"
            },
            {
               "tag":"d135b9f3-f260-49e6-bb7b-32e334a99caf",
               "display_name":"c"
            }
         ]
      },
        "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内部错误,请联系我们

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