七鱼开发文档中心
总览服务端 APIWebiOSAndroid鸿蒙Uniapp微信小程序插件三方接入
工单系统

获取工单详情

获取单张工单的完整信息。成功响应的 message 字段为工单详情 JSON 字符串,调用方需要按 JSON 再解析一次。响应包含:创建附件列表(attachments)、全部流转评论及其附件(comments)、自定义字段值列表(custom)。跨企业工单满足关联条件时,自定义字段从关联工单所在企业查询。

请求参数

名称类型必填描述示例值
appKeystring是应用 AppKey
timeint64是请求时间戳(秒)
checksumstring是请求签名校验和
checksumAlgorithmint32否签名算法:0 - 默认(SHA1),1 - SHA256

请求体

名称类型必填描述示例值
ticketIdint64是工单 ID123456

返回参数

名称类型描述示例值
codeint32状态码,200 表示成功200
messageobject工单详细信息[{"id":123456,"staffId":10001,"holderId":10002,"lastFinishProcessor":10002,"templateId":30001,"typeId":40001,"priority":8,"groupId":20001,"title":"售后咨询:订单取消后未退款","content":"用户反馈订单取消后 3 个工作日仍未收到退款,请协助核实。","status":10,"createTime":1720085400000}]
└idint64工单ID123456
└staffIdint64发起人(坐席)ID10001
└holderIdint64受理人(坐席)ID10002
└lastFinishProcessorint64最后完结人ID10002
└templateIdint64工单模板ID30001
└typeIdint64工单分类ID40001
└priorityint32优先级:2-低,5-一般,8-紧急,10-非常紧急8
└groupIdint64受理组ID20001
└titlestring工单标题售后咨询:订单取消后未退款
└contentstring工单内容用户反馈订单取消后 3 个工作日仍未收到退款,请协助核实。
└statusint32工单状态:0-未知,1-已提交,5-未受理,10-受理中,20-完结,25-已驳回,50-已挂起,999-已删除10
└createTimeint64工单创建时间(毫秒时间戳)1720085400000
└userNamestring用户姓名张三
└userEmailstring用户邮箱zhangsan@example.com
└userMobilestring用户手机号13800138000
└propertiesstring工单附加属性(JSON 字符串){"orderId":"SO202407010001","channel":"wechat"}
└typeStrstring分类名称路径字符串(请求返回分类路径时返回)售后服务/退款问题
└modifyLastboolean最后一次操作是否为修改false
└attachmentsobject[]创建工单时的附件列表[{"name":"退款凭证.pdf","size":245760,"url":"https://nos.example.com/ticket/refund-proof.pdf"}]
└namestring附件文件名退款凭证.pdf
└sizeint64附件大小(字节)245760
└urlstring附件下载地址https://nos.example.com/ticket/refund-proof.pdf
└commentsobject[]工单流转评论列表[{"staffId":10001,"comment":"已联系财务核实退款状态,请耐心等待。","timestamp":1720087200000,"attachments":[]}]
└staffIdint64操作坐席ID10001
└commentstring回复/备注内容已联系财务核实退款状态,请耐心等待。
└timestampint64操作时间(毫秒时间戳)1720087200000
└attachmentsobject[]随此次操作上传的附件列表[{"name":"退款凭证.pdf","size":245760,"url":"https://nos.example.com/ticket/refund-proof.pdf"}]
└namestring附件文件名退款凭证.pdf
└sizeint64附件大小(字节)245760
└urlstring附件下载地址https://nos.example.com/ticket/refund-proof.pdf
└customobject[]自定义字段值列表[{"id":91001,"name":"订单号","value":"SO202407010001","fieldId":81001}]
└idint64自定义字段记录ID91001
└namestring自定义字段名称订单号
└valueobject自定义字段值SO202407010001
└fieldIdint64自定义字段定义 ID81001
└followerstring关注人ID列表(JSON 字符串)[10003,10004]
└crmUserNamestringCRM 用户姓名张三
└crmUserEmailstringCRM 用户邮箱zhangsan@example.com
└crmUserPhonestringCRM 用户手机号13800138000
└crmIdstringCRM 用户IDcrm_78901
└userIdint64访客用户ID556677
└crmForeignIdstringCRM 外部ID(foreignId)crm_ext_001
└connectionTypeint32关联会话连接类型1
└connectionIdint64关联会话连接ID987654321
└holderPlatformIdint64受理方平台ID1
└mailReplyListobject[]邮件回复列表(withMailReplyList=true 时返回)[{"ticketId":123456,"id":88001,"sender":{"nickname":"七鱼售后","address":"support@example.com"},"toMailList":[{"nickname":"张三","address":"zhangsan@example.com"}],"ccMailList":[{"nickname":"财务","address":"finance@example.com"}],"subject":"Re: 订单退款咨询","sendTime":1720089000000,"monitorStatus":1,"replyStatus":2,"mailDir":2,"lastOperatorId":10002,"replyStaffId":10002,"lastUpdateTime":1720089300000}]
└ticketIdint64关联工单ID123456
└idint64邮件记录ID88001
└senderobject邮箱昵称与地址[{"nickname":"财务","address":"finance@example.com"}]
└nicknamestring邮箱昵称七鱼售后
└addressstring邮箱地址support@example.com
└toMailListobject[]收件人列表[{"nickname":"张三","address":"zhangsan@example.com"}]
└nicknamestring邮箱昵称七鱼售后
└addressstring邮箱地址support@example.com
└ccMailListobject[]抄送人列表[{"nickname":"财务","address":"finance@example.com"}]
└nicknamestring邮箱昵称七鱼售后
└addressstring邮箱地址support@example.com
└subjectstring邮件主题Re: 订单退款咨询
└sendTimeint64发送时间(毫秒时间戳)1720089000000
└monitorStatusint32监测状态1
└replyStatusint32回复状态2
└mailDirint32邮件方向:1-接收,2-发送2
└lastOperatorIdint64最后操作坐席ID(目前为修改监测状态的坐席)10002
└replyStaffIdint64回复坐席ID10002
└lastUpdateTimeint64最后修改时间(毫秒时间戳,目前为最后修改监测状态的时间)1720089300000
└pluginUrlstring工单插件 URLhttps://openapi.qiyukf.com/plugin/ticket/123456
└groupNamestring受理组名称售后组
└holderNamestring受理人名称李四
└commentstring最新回复内容已联系财务核实退款状态,请耐心等待。
└commentStaffNamestring最新回复坐席姓名李四
└modifyTimeint64工单最后更新时间(毫秒时间戳)1720089000000
└firstDispatchTimeint64首次分配时间(毫秒时间戳)1720086000000

错误码

状态码描述
14004ticketId 为空;请求体 JSON 格式错误
14106工单不存在
14500服务内部异常
postEndpoint
/openapi/v2/ticket/detail
POST
/openapi/v2/ticket/detail
curl -X POST "https://qiyukf.com/openapi/v2/ticket/detail?appKey=string&time=0&checksum=string" \  -H "Content-Type: application/json" \  -d '{    "ticketId": 123456  }'
{
  "code": 200,
  "message": [
    {
      "id": 123456,
      "staffId": 10001,
      "holderId": 10002,
      "lastFinishProcessor": 10002,
      "templateId": 30001,
      "typeId": 40001,
      "priority": 8,
      "groupId": 20001,
      "title": "售后咨询:订单取消后未退款",
      "content": "用户反馈订单取消后 3 个工作日仍未收到退款,请协助核实。",
      "status": 10,
      "createTime": 1720085400000
    }
  ]
}
{
  "code": 14004,
  "message": "ticketId 为空;请求体 JSON 格式错误"
}
{
  "code": 14106,
  "message": "工单不存在"
}
{
  "code": 14500,
  "message": "服务内部异常"
}

这篇文档有帮助吗?