工单系统
查询访客工单状态
查询指定访客的某张工单当前状态及流转历史。工单 userId 必须与访客匹配,否则视为无效工单返回错误。history=2 时返回最新一条有 comment 的流转记录,history=3 返回全部;默认不含历史。details=true 时追加标题、内容、优先级、分类、关注人、附加属性及附件列表。
请求参数
| 名称 | 类型 | 必填 | 描述 | 示例值 |
|---|---|---|---|---|
| appKey | string | 是 | 应用 AppKey | |
| time | int64 | 是 | 请求时间戳(秒) | |
| checksum | string | 是 | 请求签名校验和 | |
| checksumAlgorithm | int32 | 否 | 签名算法:0 - 默认(SHA1),1 - SHA256 |
请求体
| 名称 | 类型 | 必填 | 描述 | 示例值 |
|---|---|---|---|---|
| uid | string | 是 | 访客外部 ID(uid) | user_3f9a2c8d |
| sheetId | int64 | 是 | 工单 ID(JSON 字段名:sheetId) | 123456 |
| history | int32 | 否 | 历史记录范围:1-不含历史(默认),2-最新一条,3-全部 | 1 |
| details | boolean | 否 | 是否返回工单详情,默认 false | true |
返回参数
| 名称 | 类型 | 描述 | 示例值 |
|---|---|---|---|
| code | int32 | 状态码,200 表示成功 | 200 |
| message | object | 工单状态数据 | {"status":10,"history":[{"datetime":"2024-07-04 11:30:00","comment":"客服已受理,正在核实退款进度。"}],"worksheet":{"title":"售后咨询:订单取消后未退款","content":"用户反馈订单取消后 3 个工作日仍未收到退款,请协助核实。","priority":8,"typeId":40001,"typeName":"退款问题","followerIds":"[10003,10004]","properties":"{\"orderId\":\"SO202407010001\",\"channel\":\"wechat\"}","attachments":[{"name":"退款凭证.pdf","size":245760,"url":"https://nos.example.com/ticket/refund-proof.pdf"}]}} |
| └status | int32 | 工单状态:0-未知,1-已提交,5-未受理,10-受理中,20-完结,25-已驳回,50-已挂起,999-已删除 | 10 |
| └history | object[] | 历史流转记录列表(history 参数控制范围) | [{"datetime":"2024-07-04 11:30:00","comment":"客服已受理,正在核实退款进度。"}] |
| └datetime | string | 操作时间(可读格式) | 2024-07-04 11:30:00 |
| └comment | string | 流转备注内容 | 客服已受理,正在核实退款进度。 |
| └worksheet | object | 工单状态详情(details=true 时返回) | {"title":"售后咨询:订单取消后未退款","content":"用户反馈订单取消后 3 个工作日仍未收到退款,请协助核实。","priority":8,"typeId":40001,"typeName":"退款问题","followerIds":"[10003,10004]","properties":"{\"orderId\":\"SO202407010001\",\"channel\":\"wechat\"}","attachments":[{"name":"退款凭证.pdf","size":245760,"url":"https://nos.example.com/ticket/refund-proof.pdf"}]} |
| └title | string | 工单标题 | 售后咨询:订单取消后未退款 |
| └content | string | 工单内容 | 用户反馈订单取消后 3 个工作日仍未收到退款,请协助核实。 |
| └priority | int32 | 优先级:2-低,5-一般,8-紧急,10-非常紧急 | 8 |
| └typeId | int64 | 分类ID | 40001 |
| └typeName | string | 分类名称 | 退款问题 |
| └followerIds | string | 关注人ID列表(JSON 字符串) | [10003,10004] |
| └properties | string | 附加属性(JSON 字符串) | {"orderId":"SO202407010001","channel":"wechat"} |
| └attachments | object[] | 附件列表 | [{"name":"退款凭证.pdf","size":245760,"url":"https://nos.example.com/ticket/refund-proof.pdf"}] |
| └name | string | 附件文件名 | 退款凭证.pdf |
| └size | int64 | 附件大小(字节) | 245760 |
| └url | string | 附件下载地址 | https://nos.example.com/ticket/refund-proof.pdf |
错误码
| 状态码 | 描述 |
|---|---|
| 14004 | uid 或 sheetId 为空;请求体 JSON 格式错误 |
| 14105 | uid 对应访客不存在 |
| 14106 | 工单不存在或不属于该访客 |
| 14500 | 服务内部异常 |
| 16001 | 企业工单服务不可用 |
postEndpoint
/openapi/v2/ticket/statuscurl -X POST "https://qiyukf.com/openapi/v2/ticket/status?appKey=string&time=0&checksum=string" \ -H "Content-Type: application/json" \ -d '{ "uid": "user_3f9a2c8d", "sheetId": 123456 }'{
"code": 200,
"message": {
"status": 10,
"history": [
{
"datetime": "2024-07-04 11:30:00",
"comment": "客服已受理,正在核实退款进度。"
}
],
"worksheet": {
"title": "售后咨询:订单取消后未退款",
"content": "用户反馈订单取消后 3 个工作日仍未收到退款,请协助核实。",
"priority": 8,
"typeId": 40001,
"typeName": "退款问题",
"followerIds": "[10003,10004]",
"properties": "{\"orderId\":\"SO202407010001\",\"channel\":\"wechat\"}",
"attachments": [
{
"name": "退款凭证.pdf",
"size": 245760,
"url": "https://nos.example.com/ticket/refund-proof.pdf"
}
]
}
}
}{
"code": 14004,
"message": "uid 或 sheetId 为空;请求体 JSON 格式错误"
}{
"code": 14105,
"message": "uid 对应访客不存在"
}{
"code": 14106,
"message": "工单不存在或不属于该访客"
}{
"code": 14500,
"message": "服务内部异常"
}{
"code": 16001,
"message": "企业工单服务不可用"
}这篇文档有帮助吗?