提交工单
咨询集成、功能及报价等问题
Lists all IM chat messages of a room.
Request method: POST
Request address:
Service environment | Rate limit | Endpoint |
---|---|---|
Production | 1 request/second | https://roomkit-api.zego.im/im/v2/list_history_records |
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
secret_id | Int | Yes | 12580 | The Secret ID assigned to your project by ZEGO. |
access_token | String | Yes | "CIE7hNPK6Y55DeUJBSDrInP" | The server access token obtained via the get_access_token request. |
pid | Int64 | Yes | 1200 | The Product ID assigned to your project by ZEGO. |
room_id | String | Yes | "19949235175" | Room ID. The numeric value it represents must be a 64-bit integer. |
offset | Int | No | 0 | The starting record offset. Default value: 0, which means the query starts from the first record. |
limit | Int | No | 500 | The maximum number of records allowed to be retrieved. Default value: 500. |
{
"secret_id": 1000001,
"access_token": "access_token",
"pid": 1200,
"room_id": "19949235175",
"offset": 2680
}
Parameter | Type | Example | Description |
---|---|---|---|
ret | Object | - | The returned status of the request. |
ret.code | Int | 0 | The returned code. |
ret.message | String | "succeed" | The returned message. |
ret.version | String | "1.0.0" | Version number. |
data | Object | - | The returned data of the request. |
data.size | Int | 1000 | The total number of records returned. |
data.msgs | Array of Object | - | Message list. |
data.msgs[0].sender | Object | - | Information of the message sender. |
data.msgs[0].sender.uid | Int64 | 100062163 | User ID of the message sender. |
data.msgs[0].sender.nickname | String | "Elias" | Nickname of the message sender. |
data.msgs[0].sender.role | Int | 2 | User role of the message sender. |
data.msgs[0].seq | Int64 | 80567 | Message sequence number. |
data.msgs[0].timestamp | Int64 | 1617072080000 | Time message sent, in milliseconds. |
data.msgs[0].body | Object | - | Message body. |
data.msgs[0].body.msg_type | String | "text" | Message type:
|
data.msgs[0].body.content | Object | - | Message content. |
Parameter | Type | Example | Description |
---|---|---|---|
text | String | "test 0_80567" | Text message content. |
Parameter | Type | Description |
---|---|---|
data | String | Data of the custom message. |
desc | String | Description of the custom message. |
ext | String | Extension field. |
sound | String | Custom APNs push notification ring tone. |
{
"ret": {
"code": 0,
"message": "succeed",
"version": ""
},
"data": {
"size": 2694,
"msgs": [
{
"sender": {
"uid": 100062163,
"nickname": "Elias",
"role": 32
},
"seq": 80567,
"timestamp": 1617072080000,
"body": {
"msg_type": "text",
"content": {
"text": "test 0_80567"
}
}
},
{
"sender": {
"uid": 100062163,
"nickname": "Elias",
"role": 32
},
"seq": 80568,
"timestamp": 1617072081000,
"body": {
"msg_type": "text",
"content": {
"text": "test 1_80568"}
}
}
]
}
}