客户管理
查询工单关联服务记录
查询与工单关联的在线服务记录。crmId、userId、sessionId 为可选查询条件;type/offset/limit 为必填字段,limit 最大 20。
请求参数
| 名称 | 类型 | 必填 | 描述 | 示例值 |
|---|---|---|---|---|
| appKey | string | 是 | 应用 AppKey | |
| time | int64 | 是 | 请求时间戳(秒) | |
| checksum | string | 是 | 请求签名校验和 | |
| checksumAlgorithm | int32 | 否 | 签名算法:0 - 默认(SHA1),1 - SHA256 |
请求体
| 名称 | 类型 | 必填 | 描述 | 示例值 |
|---|---|---|---|---|
| crmId | string | 否 | CRM 客户 ID(可选) | crm_123 |
| userId | int64 | 否 | 用户 ID(可选) | 10001 |
| sessionId | int64 | 否 | 会话 ID(可选) | 20001 |
| type | int32 | 是 | 查询类型 | 1 |
| offset | int64 | 是 | 偏移量 | 0 |
| limit | int64 | 是 | 每页数量,最大值 20 | 10 |
返回参数
| 名称 | 类型 | 描述 | 示例值 |
|---|---|---|---|
| code | int32 | 状态码,200 表示成功 | 200 |
| result | object[] | 服务记录列表(含在线、呼叫、工单三种会话类型) | |
| └sessionType | int32 | 会话类型:0-在线,1-呼叫,6-工单 | 0 |
| └id | int64 | 记录 ID | 10001 |
| └status | int32 | 会话状态 | 2 |
| └startTime | int64 | 开始时间(毫秒时间戳) | 1700000000000 |
| └closeTime | int64 | 结束时间(毫秒时间戳) | 1700003600000 |
| └categoryPath | string | 分类路径 | 售前咨询/产品问题 |
| └mobile | string | 用户手机号 | 13800138000 |
| └userName | string | 用户姓名 | 张三 |
| └uid | string | 用户唯一标识(foreignId) | user_12345 |
| └staffName | string | 坐席姓名 | 李四 |
| └satisfactionName | string | 满意度名称 | 满意 |
| └platform | string | 会话平台(在线会话) | web |
| └callNum | string | 呼叫号码(呼叫中心) | 0571-88888888 |
| └recordSrc | string | 录音地址(呼叫中心) | https://record.example.com/123.wav |
| └worksheetCreateTime | int64 | 工单创建时间(毫秒时间戳) | 1700000100000 |
| └workSheetTitle | string | 工单标题 | 售后咨询 |
| └workSheetDealer | string | 工单处理人 | 王五 |
| └workSheetDealGroup | string | 工单处理组 | 售后组 |
| message | string | 提示信息 | success |
| total | int32 | 总记录数 | 5 |
错误码
| 状态码 | 描述 |
|---|---|
| 14001 | AppKey 不存在 |
| 14002 | checksum 校验失败 |
| 14003 | 请求时间戳与服务器时间误差超过 10 分钟 |
| 14004 | 请求体 JSON 格式错误;type/offset/limit 缺失;limit 超过 20 |
| 14500 | 服务内部异常 |
postEndpoint
/openapi/user/ws/relationWsRecordcurl -X POST "https://qiyukf.com/openapi/user/ws/relationWsRecord?appKey=string&time=0&checksum=string" \ -H "Content-Type: application/json" \ -d '{ "type": 1, "offset": 0, "limit": 10 }'{
"code": 200,
"result": [
{
"sessionType": 0,
"id": 10001,
"status": 2,
"startTime": 1700000000000,
"closeTime": 1700003600000,
"categoryPath": "售前咨询/产品问题",
"mobile": "13800138000",
"userName": "张三",
"uid": "user_12345",
"staffName": "李四",
"satisfactionName": "满意",
"platform": "web",
"callNum": "0571-88888888",
"recordSrc": "https://record.example.com/123.wav",
"worksheetCreateTime": 1700000100000,
"workSheetTitle": "售后咨询",
"workSheetDealer": "王五",
"workSheetDealGroup": "售后组"
}
],
"message": "success",
"total": 5
}{
"code": 14001,
"message": "AppKey 不存在"
}{
"code": 14002,
"message": "checksum 校验失败"
}{
"code": 14003,
"message": "请求时间戳与服务器时间误差超过 10 分钟"
}{
"code": 14004,
"message": "请求体 JSON 格式错误;type/offset/limit 缺失;limit 超过 20"
}{
"code": 14500,
"message": "服务内部异常"
}这篇文档有帮助吗?