获取房间聊天记录

Example

请求方式 POST

https://global.talk-cloud.net/api/room/v1/getChatList

参数名 必选 类型 说明
Content-Type string application/json;
Tk-authkey string 企业Key
参数名 是否必选 类型 说明
serial 房间id Int 必填
thirdroomid 第三方教室id String 选填
startTime 开始时间 Int 选填(毫秒)
endTime 结束时间 Int 选填(毫秒)
page 页数 Int 选填(默认第一页,每页返回100条)
参数名称 类型 描述
result int 0成功,其他失败
data obj 数据
data.serial String 房间号
data.fromID String 发送的用户id
data.toID String 接收的用户id/__all代表所有人
data.nickname String 发送的用户名
data.type Int 聊天类型 0:公聊 1 私聊
data.ts bigInt 聊天时间截
data.role Int 角色id
data.companyid String 企业ID
data.extra.time bigInt 聊天时间截
data.extra.fromNickName String 发送人昵称
data.room_unit_id Int 课节号
data.msg obj 发送内容
data.msg.type obj 内容类型(em:表情;img:图片;text:文本;)
data.msg.context string/array 发送内容(内容类型 为em是数组;内容类型 为img是图片地址;其他是文本)
pageList obj 分页数据
pageList.total int 总数
pageList.page int 页码
pageList.limit int 每页数量

返回示例

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
{
    "result": 0,
    "data": [
        {
            "serial": "1053823916",
            "msg": {
                "type": "em",
                "context": [
                    "https://tk-static-demo.talk-cloud.net/static/h5_new_4.15.7.2/img/22.png"
                ]
            },
            "fromID": "ae111c29-4332-9bd3-3cbb-e764035cb676",
            "toID": "7f0cce28-0b0a-1a68-d0e0-f04650039827",
            "nickname": "admin",
            "type": 1,
            "ts": 1709780671894,
            "companyid": "10785",
            "role": 0,
            "extra": {
                "time": 1709780671663,
                "fromNickname": "22"
            },
            "room_unit_id": 71
        },
        {
            "serial": "1053823916",
            "msg": {
                "type": "img",
                "context": "https://tk-hwdemocdn.talk-cloud.net/chatimage/10785/1053823916/10785_20240307_110425_xjhguntg-1.png"
            },
            "fromID": "ae111c29-4332-9bd3-3cbb-e764035cb676",
            "toID": "7f0cce28-0b0a-1a68-d0e0-f04650039827",
            "nickname": "admin",
            "type": 1,
            "ts": 1709780666332,
            "companyid": "10785",
            "role": 0,
            "extra": {
                "time": 1709780666139,
                "msgtype": "onlyimg",
                "cospath": "https://tk-hwdemocdn.talk-cloud.net",
                "uploadts": "",
                "fromNickname": "22"
            },
            "room_unit_id": 71
        },
        {
            "serial": "1053823916",
            "msg": {
                "type": "text",
                "context": "老师好"
            },
            "fromID": "7f0cce28-0b0a-1a68-d0e0-f04650039827",
            "toID": "ae111c29-4332-9bd3-3cbb-e764035cb676",
            "nickname": "22",
            "type": 1,
            "ts": 1709780650364,
            "companyid": "10785",
            "role": 2,
            "extra": {
                "time": 1709780650199,
                "fromNickname": "admin"
            },
            "room_unit_id": 71
        },
        {
            "serial": "1053823916",
            "msg": {
                "type": "text",
                "context": "我是33"
            },
            "fromID": "e3501fbf-7be4-c6f5-8c7f-c3efc0ed68f8",
            "toID": "__all",
            "nickname": "33",
            "type": 0,
            "ts": 1709780637875,
            "companyid": "10785",
            "role": 2,
            "extra": {
                "time": 1709780637454
            },
            "room_unit_id": 71
        },
        {
            "serial": "1053823916",
            "msg": {
                "type": "text",
                "context": "AAA"
            },
            "fromID": "ae111c29-4332-9bd3-3cbb-e764035cb676",
            "toID": "7f0cce28-0b0a-1a68-d0e0-f04650039827",
            "nickname": "admin",
            "type": 1,
            "ts": 1709780616301,
            "companyid": "10785",
            "role": 0,
            "extra": {
                "time": 1709780615796,
                "fromNickname": "22"
            },
            "room_unit_id": 71
        }
    ],
    "pageList": {
        "total": 1115,
        "page": "1",
        "shownum": "100"
    },
    "msg": ""
}

© 2016-2023 北京拓课网络科技有限公司 版权所有  京ICP备17018423号-1 京公网安备11010502043461号