获取工单消息详情
该接口用于获取服务台工单消息详情。
请求
| 项目 | 值 |
|---|---|
| HTTP URL | https://open.feishu.cn/open-apis/helpdesk/v1/tickets/:ticket_id/messages |
| HTTP Method | GET |
| 接口频率限制 | 特殊频控 |
| 支持的应用类型 | custom |
| 权限要求 调用该 API 所需的权限。开启其中任意一项权限即可调用 | helpdesk:all:readonly 获取服务台资源详情 |
请求头
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| Authorization | string | 是 | tenant_access_token 值格式:"Bearer access_token" 示例值:"Bearer t-7f1bcd13fc57d46bac21793a18e560" 了解更多:如何选择与获取 access token |
Tip: 服务台请求Header中还需添加“服务台token”参数:
Key: X-Lark-Helpdesk-Authorization
Value: base64(helpdesk_id:helpdesk_token),通过base64加密将helpdesk_id和helpdesk_token用':'连接而成的字符串。
路径参数
| 名称 | 类型 | 描述 |
|---|---|---|
ticket_id | string | 工单ID 示例值:"6948728206392295444" |
查询参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
time_start | int | 否 | 起始时间 示例值:1617960686 |
time_end | int | 否 | 结束时间 示例值:1617960687 |
page | int | 否 | 页数ID 示例值:1 |
page_size | int | 否 | 消息数量,最大200,默认20 示例值:10 |
响应
响应体
| 名称 | 类型 | 描述 |
|---|---|---|
code | int | 错误码,非 0 表示失败 |
msg | string | 错误描述 |
data | \- | - |
└ messages | ticket.message\[\] | 工单消息列表 |
└ id | string | 工单消息ID |
└ message_id | string | chat消息ID |
└ message_type | string | 消息类型;text:纯文本;post:富文本;image:图像;file:文件;media:视频 |
└ created_at | int | 创建时间 |
└ content | string | 内容 |
└ user_name | string | 用户名 |
└ avatar_url | string | 用户图片url |
└ user_id | string | 用户open ID |
└ total | int | 消息总数 |
响应体示例
json
{
"code": 0,
"msg": "success",
"data": {
"messages": [
{
"id": "6948728206392295444",
"message_id": "6949088236610273307",
"message_type": "text",
"created_at": 1617960686000,
"content": "{\"content\":\"进入人工服务。 @李宁 为你提供服务,开始聊起来吧~\",\"msg_type\":\"text\"}",
"user_name": "李宁",
"avatar_url": "https://internal-api-lark-file.feishu-boe.cn/static-resource/v1/3e73cdce-54b0-4c6a-8226-b131fb2825dj~?image_size=72x72&cut_type=&quality=&format=image&sticker_format=.webp",
"user_id": "ou_37019b7c830210acd88fdce886e25c71"
}
],
"total": 100
}
}错误码
| 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 | 内部错误,请联系我们 |
