查询单个聊天记录

服务描述

本接口可获取查询单个聊天记录。

开发须知

调用本接口前,请先获取appId

服务地址

GET https://{您的专属域名}/chat/openapi/v1/chat/chatRecordHistoryStaff

请求参数

参数 位置 类型 是否必填 说明
appId header String Y 应用ID
timestamp header String Y 时间戳,毫秒
sign header String Y 签名
Content-Type header String Y application/json
botSessionId url地址栏 String Y 会话id
pageNum url地址栏 int N 页码,从0开始
pageSize url地址栏 int N 页大小,默认100
请求数据示例:
GET https://{您的专属域名}/chat/openapi/v1/chat/chatRecordHistoryStaff?botSessionId=12&pageNum=0&pageSize=99

返回结果

参数 类型 说明
code String 结果码
message String 结果描述
data Page<BotChatRecordHistoryDTO> 聊天记录分页数据
Page<BotChatRecordHistoryDTO>
参数 类型 说明
list List<BotChatRecordHistoryDTO> 聊天记录列表数据
total int 数据总量
BotChatRecordHistoryDTO
参数 类型 说明
fromTerminal String 发送终端,user_h5:用户;kf_web:坐席
content String 聊天内容
contentType String 消息内容类型(image:图片,audio:语音,file:文件,video:视频)
chatType int 聊天类型[人工-聊天(0),系统-欢迎语(1),系统-访客超时未回复提示消息(10),系统-访客超时未回复-结束会话文案消息(20)]
type String 消息类型[发起会话(chat_probe),聊天消息(chat),用户离开(chat_close),评价消息(evaluate),消息撤回(revoke)]
uuid String 聊天消息uuid
time Long 消息发送时间戳
msgFrom String 消息发送者id
preSessionId String 上一通会话ID
返回结果示例:
{
    "code": "10000",
    "message": "调用成功",
    "data": {
        "total": 9,
        "size": 9,
        "list": [{
            "recordKind": "IM",
            "fromTerminal": "user_h5",
            "content": "con_close",
            "contentType": "none",
            "chatType": 0,
            "type": "chat_close",
            "uuid": "d2d0a56215e74a2dba2d833f0358b5c3",
            "time": 1603095164030,
            "complte": false,
            "msgFrom": "dd72912aea3d44f4afdf82b53889b81e"
        }, {
            "recordKind": "IM",
            "fromTerminal": "kf_web",
            "content": "evaluate_close",
            "contentType": "none",
            "chatType": 0,
            "type": "evaluate",
            "uuid": "AFA9C8EC6DEBCE6A204F3ABC91BA04EF",
            "time": 1603095163951,
            "complte": false,
            "msgFrom": "2697"
        }, {
            "recordKind": "IM",
            "fromTerminal": "user_h5",
            "content": "的撒发射点就",
            "contentType": "none",
            "chatType": 0,
            "type": "chat",
            "uuid": "8A6B5C285D5F4FD9A004B890D8A1F6CD",
            "time": 1603095150949,
            "complte": false,
            "msgFrom": "dd72912aea3d44f4afdf82b53889b81e"
        }, {
            "recordKind": "IM",
            "fromTerminal": "user_h5",
            "content": "阿斯顿发射点",
            "contentType": "none",
            "chatType": 0,
            "type": "chat",
            "uuid": "5146D4A85A29F41D2D6AB5C3894C63B4",
            "time": 1603095149289,
            "complte": false,
            "msgFrom": "dd72912aea3d44f4afdf82b53889b81e"
        }, {
            "recordKind": "IM",
            "fromTerminal": "kf_web",
            "content": "撒旦发射点",
            "contentType": "none",
            "chatType": 0,
            "type": "chat",
            "uuid": "301C8BA64777840A082F9A978BCFCE03",
            "time": 1603095145804,
            "complte": false,
            "msgFrom": "2697"
        }, {
            "recordKind": "IM",
            "fromTerminal": "kf_web",
            "content": "sdafds",
            "contentType": "none",
            "chatType": 0,
            "type": "chat",
            "uuid": "BF015571522A9C011B7E19C8E86B4EF2",
            "time": 1603095143695,
            "complte": false,
            "msgFrom": "2697"
        }, {
            "recordKind": "IM",
            "fromTerminal": "user_h5",
            "content": "dsfasd",
            "contentType": "none",
            "chatType": 0,
            "type": "chat",
            "uuid": "AB4AA66C9B01D63D95D8992BF8E6E22C",
            "time": 1603095134878,
            "complte": false,
            "msgFrom": "dd72912aea3d44f4afdf82b53889b81e"
        }, {
            "recordKind": "IM",
            "fromTerminal": "kf_web",
            "content": "&lt;p&gt;您好,我是您的专属客服小马,请问有什么可以帮您?😗&lt;/p&gt;",
            "contentType": "none",
            "chatType": 1,
            "type": "chat",
            "uuid": "5086BE8B5AC77E948EEF5A7295C5C105",
            "time": 1603095128712,
            "complte": false,
            "msgFrom": "2697"
        }, {
            "recordKind": "IM",
            "fromTerminal": "user_h5",
            "content": "hello",
            "contentType": "none",
            "chatType": 0,
            "type": "chat_probe",
            "uuid": "E5AABD2187AB23A785881377F39E99D0",
            "time": 1603095127919,
            "complte": false,
            "msgFrom": "dd72912aea3d44f4afdf82b53889b81e"
        }]
    }
}
结果码说明
结果码 说明
10000 请求成功
20001 请求失败
21002 认证失败,请重新登录

FAQ:

results matching ""

    No results matching ""