获取全部工单自定义字段
该接口用于获取全部工单自定义字段。
请求
| 项目 | 值 |
|---|---|
| HTTP URL | https://open.feishu.cn/open-apis/helpdesk/v1/ticket_customized_fields |
| HTTP Method | GET |
| 支持的应用类型 | custom |
| 权限要求 调用该 API 所需的权限。开启其中任意一项权限即可调用 | helpdesk:all:readonly 获取服务台资源详情 |
请求头
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| 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用':'连接而成的字符串。
查询参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
page_token | string | 否 | 分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回新的 page_token,下次遍历可采用该 page_token 获取查询结果 示例值:"6948728206392295444" |
page_size | int | 否 | 分页大小 示例值:10;默认为20 数据校验规则: - 最大值:100 |
请求体
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
visible | boolean | 否 | 是否可见 示例值:true |
请求体示例
json
{
"visible": true
}响应
响应体
| 名称 | 类型 | 描述 |
|---|---|---|
code | int | 错误码,非 0 表示失败 |
msg | string | 错误描述 |
data | \- | - |
∟ has_more | boolean | 是否还有更多项 |
∟ next_page_token | string | 下一分页标识 |
∟ items | ticket_customized_field\[\] | 工单自定义字段列表 |
∟ ticket_customized_field_id | string | 工单自定义字段ID |
∟ helpdesk_id | string | 服务台ID |
∟ key_name | string | 键名 |
∟ display_name | string | 名称 |
∟ position | string | 字段在列表后台管理列表中的位置 |
∟ field_type | string | 类型 |
∟ description | string | 描述 |
∟ visible | boolean | 是否可见 |
∟ editable | boolean | 是否可以修改 |
∟ required | boolean | 是否必填 |
∟ created_at | string | 创建时间 |
∟ updated_at | string | 更新时间 |
∟ created_by | ticket_user | 创建用户 |
∟ id | string | 用户ID |
∟ avatar_url | string | 用户头像url |
∟ name | string | 用户名 |
∟ email | string | 用户邮箱 |
∟ updated_by | ticket_user | 更新用户 |
∟ id | string | 用户ID |
∟ avatar_url | string | 用户头像url |
∟ name | string | 用户名 |
∟ email | string | 用户邮箱 |
∟ dropdown_options | dropdown_option | 下拉列表选项 |
∟ children | dropdown_option[] | 选项列表 |
∟ tag | string | 选项ID |
∟ display_name | string | 展示名称 |
∟ children | dropdown_option[] | 同上:选项列表,只适用于多层下拉列表(最多可以设置三级下拉列表) |
∟ dropdown_allow_multiple | boolean | 是否支持多选,仅在字段类型是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状态码 | 错误码 | 描述 | 排查建议 |
|---|---|---|---|
| 400 | 154000 | Bad request, please check your request body | 请求不合法,请检查参数 |
| 401 | 154001 | Unauthorized, please check you have the correct access | 检查Authorization 和 X-Lark-Helpdesk-Authorization 是否正确,应用和服务台属于同一租户 |
| 403 | 154003 | Please check you have the correct access | 检查是否申请正确权限 |
| 500 | 155000 | Internal error | 内部错误,请联系我们 |
