工单系统
转交工单
将工单转交给其他坐席或客服组。targetStaffId 和 targetGroupId 至少填一个。两者同时传入时按「转给组+指定人」模式处理;仅传 targetGroupId 时,支持第三方组映射(查 thirdPlatformDepartmentMapping)。转交前会校验工单是否已被删除。
请求参数
| 名称 | 类型 | 必填 | 描述 | 示例值 |
|---|---|---|---|---|
| appKey | string | 是 | 应用 AppKey | |
| time | int64 | 是 | 请求时间戳(秒) | |
| checksum | string | 是 | 请求签名校验和 | |
| checksumAlgorithm | int32 | 否 | 签名算法:0 - 默认(SHA1),1 - SHA256 |
请求体
| 名称 | 类型 | 必填 | 描述 | 示例值 |
|---|---|---|---|---|
| ticketId | int64 | 是 | 工单 ID | 123456 |
| staffId | int64 | 是 | 发起转交的坐席 ID | 10001 |
| targetStaffId | int64 | 否 | 目标坐席 ID(与 targetGroupId 至少填一个) | 10002 |
| targetGroupId | int64 | 否 | 目标客服组 ID(与 targetStaffId 至少填一个) | 20001 |
| comment | string | 否 | 转交备注 | 用户要求由售后组继续跟进退款问题。 |
| attachments | string | 否 | 附件列表 JSON 字符串,每项:{type, payload, fileName} | [{"type":2,"payload":"openapi/attachments/2024/07/refund-proof.pdf","fileName":"退款凭证.pdf"}] |
返回参数
| 名称 | 类型 | 描述 | 示例值 |
|---|---|---|---|
| code | int32 | 状态码,200 表示成功 | 200 |
| message | string | 提示信息:成功时为业务数据,失败时为错误描述 | true |
错误码
| 状态码 | 描述 |
|---|---|
| 14004 | ticketId 或 staffId 为空;targetStaffId 和 targetGroupId 均为空;JSON 格式错误 |
| 14100 | staffId 不存在或已停用 |
| 14106 | 工单已被删除 |
| 14500 | 服务内部异常 |
postEndpoint
/openapi/v2/ticket/transfercurl -X POST "https://qiyukf.com/openapi/v2/ticket/transfer?appKey=string&time=0&checksum=string" \ -H "Content-Type: application/json" \ -d '{ "ticketId": 123456, "staffId": 10001 }'{
"code": 200,
"message": "true"
}{
"code": 14004,
"message": "ticketId 或 staffId 为空;targetStaffId 和 targetGroupId 均为空;JSON 格式错误"
}{
"code": 14100,
"message": "staffId 不存在或已停用"
}{
"code": 14106,
"message": "工单已被删除"
}{
"code": 14500,
"message": "服务内部异常"
}这篇文档有帮助吗?
回复工单
坐席对工单进行回复,产生一条流转记录。comment 最长 3000 字符;customerSee=true 表示访客可见,仅支持非邮件工单且模板开启了访客查询功能(queryStatus=1)。appendFields 格式为 JSON 数组,每项 typename 为自定义字段 ID 或字符串 uploadFile(对应模板文件字段),最多 50 项。有 appendFields 时 customerSee 必须为 true;工单被删除时返回对应业务错误。
改派工单
将流程工单当前节点改派给其他坐席或客服组,面向流程工单当前节点改派,与 /transfer 的普通转交不同。toStaffId 和 toGroupId 二选一,两者同时为空或同时不为空均会报错;改派前会校验工单是否已被删除。processInstanceExeId 为流程节点执行记录 ID,可选,传入后定向改派指定节点。