查询消息列表
服务描述
根据条件查询所有会话的聊天记录,相当于查询会话列表+查询单个会话聊天记录的集合,更专注于做消息导出
开发须知
调用本接口前,请先获取appId
服务地址
POST https://{您的专属域名}/imchat/openapi/v1/report/message/list
请求参数
参数 | 位置 | 类型 | 是否必填 | 说明 |
---|---|---|---|---|
appId | header | String | Y | 应用ID |
timestamp | header | String | Y | 时间戳,毫秒 |
sign | header | String | Y | 签名 |
Content-Type | header | String | Y | application/json |
pageSize | body | int | N | 分页大小,最多500个会话的消息 |
beginIndex | body | int | N | 分页起始行,从0开始 |
startTimeStr | body | String | Y | 开始时间戳,单位毫秒(以会话开始时间刷选) |
endTimeStr | body | String | Y | 结束时间戳,单位毫秒(以会话开始时间刷选) |
staffId | body | String | N | 客服id |
staffGroupId | body | String | N | 技能组ID |
productId | body | String | N | 渠道id |
questions | body | String | N | 会话小结,多级会话小结用“,”隔开。 例如:["小结1,小结2","小结3"] |
appraiseResult | body | int | N | 满意度。1:满意;2:不满意;3:非常满意;4:非常不满意 |
invalidTag | body | int | N | 会话类型:0:无效会话,1:有效会话 |
estartTimeStr | body | String | Y | 开始时间戳,单位毫秒(以会话结束时间刷选) |
eendTimeStr | body | String | Y | 结束时间戳,单位毫秒(以会话结束时间刷选) |
注意:以会话开始时间刷选和以会话结束时间刷选至少要传一对数据(开始时间戳和结束时间戳)。并且开始时间和结束时间间隔不能超过31天!!
请求数据示例:
POST https://{您的专属域名}/imchat/openapi/v1/report/message/list
返回结果
参数 | 类型 | 说明 |
---|---|---|
code | String | 结果码 |
message | String | 结果描述 |
data | List<ChatMessageDownloadDto> | 消息列表数据 |
ChatMessageDownloadDto
参数 | 类型 | 说明 |
---|---|---|
sessionId | String | 会话id |
productName | String | 渠道名称 |
msgTime | String | 消息时间 |
msgType | String | 消息类型 1:发起会话(chat_probe) 2:聊天消息(chat), 3:用户离开(chat_close), 4:评价消息(evaluate): 5:消息撤回(revoke) |
msgStaffName | String | 接线客服 |
msgFromTerminal | String | 消息来源终端 |
msgContent | String | 消息内容 |
返回结果示例:
{
"code": "10000",
"data": [{
"msgContent": "客官,稀客啊,里面请!1111",
"msgFromTerminal": "kf_web",
"msgStaffName": "洋洋1",
"msgTime": "2020-10-19 14:02:23",
"msgType": "chat",
"productName": "聊天测试11",
"sessionId": "AB546C9AFF2DBFFBE076184436CE421C"
}, {
"msgContent": "留言消息1",
"msgFromTerminal": "user_h5",
"msgStaffName": "洋洋1",
"msgTime": "2020-10-19 14:02:24",
"msgType": "chat",
"productName": "聊天测试11",
"sessionId": "AB546C9AFF2DBFFBE076184436CE421C"
}, {
"msgContent": "留言消息2",
"msgFromTerminal": "user_h5",
"msgStaffName": "洋洋1",
"msgTime": "2020-10-19 14:02:24",
"msgType": "chat",
"productName": "聊天测试11",
"sessionId": "AB546C9AFF2DBFFBE076184436CE421C"
}, {
"msgContent": "客官,稀客啊,里面请!1111",
"msgFromTerminal": "kf_web",
"msgStaffName": "洋洋1",
"msgTime": "2020-10-19 14:02:25",
"msgType": "chat",
"productName": "聊天测试11",
"sessionId": "AB546C9AFF2DBFFBE076184436CE421C"
}, {
"msgContent": "撒旦发射点",
"msgFromTerminal": "kf_web",
"msgStaffName": "洋洋1",
"msgTime": "2020-10-19 14:02:30",
"msgType": "chat",
"productName": "聊天测试11",
"sessionId": "AB546C9AFF2DBFFBE076184436CE421C"
}, {
"msgContent": "打算发多少",
"msgFromTerminal": "user_h5",
"msgStaffName": "洋洋1",
"msgTime": "2020-10-19 14:02:43",
"msgType": "chat",
"productName": "聊天测试11",
"sessionId": "AB546C9AFF2DBFFBE076184436CE421C"
}, {
"msgContent": "的撒范德萨",
"msgFromTerminal": "kf_web",
"msgStaffName": "洋洋1",
"msgTime": "2020-10-19 14:02:47",
"msgType": "chat",
"productName": "聊天测试11",
"sessionId": "AB546C9AFF2DBFFBE076184436CE421C"
}, {
"msgContent": "打算发多少",
"msgFromTerminal": "kf_web",
"msgStaffName": "洋洋1",
"msgTime": "2020-10-19 14:02:55",
"msgType": "chat",
"productName": "聊天测试11",
"sessionId": "AB546C9AFF2DBFFBE076184436CE421C"
}, {
"msgContent": "打算发多少",
"msgFromTerminal": "user_h5",
"msgStaffName": "洋洋1",
"msgTime": "2020-10-19 14:02:58",
"msgType": "chat",
"productName": "聊天测试11",
"sessionId": "AB546C9AFF2DBFFBE076184436CE421C"
}, {
"msgContent": "con_close",
"msgFromTerminal": "user_h5",
"msgStaffName": "洋洋1",
"msgTime": "2020-10-19 14:07:27",
"msgType": "chat_close",
"productName": "聊天测试11",
"sessionId": "AB546C9AFF2DBFFBE076184436CE421C"
}, {
"msgContent": "",
"msgFromTerminal": "",
"msgStaffName": "",
"msgTime": "",
"msgType": "",
"productName": "",
"sessionId": ""
}],
"message": "请求成功"
}
结果码说明
结果码 | 说明 |
---|---|
10000 | 请求成功 |
20001 | 请求失败 |
21002 | 认证失败,请重新登录 |