1. 查询会话列表接口
请求方式:POST.
请求地址:/openapi/im/queryWebchatSession.
请求时请进行接口鉴权
请求示例
{
"startTime":"2025-02-04 00:00:00",
"endTime":"2025-02-08 00:00:00",
"limit":"100",
"page":"1",
"visitorId":"hasndg",
"agentNumber":"8088",
"groupId":"10002304"
}
请求参数:
startTime | String | 是 | 开始时间(会话创建) |
endTime | String | 是 | 结束时间(会话创建) |
limit | String | 否 | 每页数量,默认10,最大10000 |
page | String | 否 | 页数,默认为第一页 |
visitorId | String | 否 | 访客id |
agentNumber | String | 否 | 座席工号 |
groupId | int | 否 | 服务组编号 |
返回参数:
字段 | 类型 | 备注 |
count | int | 符合条件的会话数量 |
effectiveCount | int | 符合条件的有效会话数量 |
chatList | array | 会话列表 |
-createTime | String | 会话创建时间 |
-convertManualTime | String | 转人工时间 |
-agentClaimTime | String | 座席接待时间 |
-endTime | String | 会话关闭时间 |
-accountId | String | 租户id |
-channelId | String | 渠道id |
-visitorId | String | 访客id |
-visitorName | String | 访客名称 |
-sessionID | String | 会话id |
-agentNumber | String | 座席工号 |
-agentName | String | 座席名称 |
-groupName | String | 服务组名称 |
-groupId | String | 服务组编号 |
-status | String | 会话状态 undeal初始化中、deal座席处理中、finish已结束、排队:queue、机器人:robot |
-effective | boolean | true:有效会话 false:无效会话 |
-replyMsgCount | int | 座席回复消息数量 |
-totalMsgCount | int | 消息总数 |
-msgCount | int | 访客消息数量 |
2. 查询聊天记录详情接口
- 请求方式:POST
- 请求地址:/openapi/im/queryWebchatMessage
- 请求时请进行接口鉴权
请求体
{
"visitorId":"wx1233123",
"sessionID":"9d3673d3-b901-4641-801b-aeb347b5bcdc",
"messageTimeBegin":"2016-12-06 09:58:23",
"messageTimeEnd":"2016-12-06 09:58:23"
}
请求体字段说明
字段 | 类型 | 是否必须 | 备注 |
visitorId | String | 是 | 访客id |
sessionID | String | 否 | 会话id |
messageTimeBegin | String | 否 | 消息发送时间的开始时间 |
messageTimeEnd | String | 否 | 消息发送时间的结束时间 |
响应体
{
"success": true,
"message": "200 ok!",
"code": "200",
"data": [
{
"messageId": "673edbba-29f4-4eb1-9ce8-a1a3c0edb69f",
"time": "2025-05-20 20:54:08",
"messageType": "out",
"contentType": "text",
"content": "测试一些\n问题\n智能回答\n您好\n第二张图片",
"replyId": "",
"replayMsg": null,
"agentName": "liuluyao",
"agentNumber": "8005",
"agentHeadImg": "",
"read": null,
"fileName": null,
"fileSize": null
}
]
}
响应参数字段说明
字段 | 类型 | 备注 |
messageId | String | 消息id |
time | String | 消息时间,yyyy-MM-dd HH:mm:ss |
messageType | String | 消息类型:访客发送:in座席发送:out系统消息:system 机器人消息:robot |
contentType | String | 消息内容类型:文本/富文本:text 图片:image 文件:file 语音:voice 视频:video 商品卡片:goodsCard |
content | String | 消息内容 |
replyId | String | 引用消息id |
replayMsg | Object | 引用消息内容:结构与推送消息中的replyMsg一致 |
agentName | String | 座席名称 |
agentNumber | String | 座席工号 |
agentHeadImg | String | 座席头像URL |
read | Boolean | 是否已读 |
fileName | String | 文件名称 |
fileSize | String | 文件大小 |