Get Sorted Conversation List
Brief Description
- Retrieves a sorted list of conversations based on whether they are pinned and the chronological order of message timestamps.
Request Method
post
Request URL
{API_ADDRESS}/conversation/get_sorted_conversation_list
Header
Header Name | Example Value | Optional | Type | Description |
---|---|---|---|---|
operationID | 1646445464564 | Required | string | Used for global trace tracking. It is recommended to use a timestamp, unique for each request |
token | eyJhbxxxx3Xs | Required | string | Admin token |
Request Parameters Example
{
"userID": "9906953281",
"conversationIDs": ["si_2699373280_9906953281"],
"pagination": {
"pageNumber": 1,
"showNumber": 20
}
}
Field Name | Optional | Type | Description |
---|---|---|---|
userID | Required | string | Current user ID |
conversationIDs | Optional | string | List of conversation IDs. If provided, returns the specified conversations. If not provided, returns the default paginated conversation list |
pagination | Required | object | Pagination parameter structure |
pagination.pageNumber | Required | string | Current page number, starting from 1 |
pagination.showNumber | Required | string | Number of items requested per page |
Success Response Example
{
"errCode": 0,
"errMsg": "",
"errDlt": "",
"data": {
"conversationTotal": 2,
"unreadTotal": 2,
"conversationElems": [
{
"conversationID": "si_110_114",
"recvMsgOpt": 0,
"unreadCount": 1,
"IsPinned": false,
"msgInfo": {
"serverMsgID": "c54203436b727117226cb528fc7b08e8",
"clientMsgID": "c972d53afb9d6b9744f1edfc4ac1aeef",
"sessionType": 1,
"sendID": "114",
"recvID": "110",
"senderName": "yourNickname",
"faceURL": "yourFaceURL",
"groupID": "",
"groupName": "",
"groupFaceURL": "",
"groupType": 0,
"groupMemberCount": 0,
"LatestMsgRecvTime": 1695212630741,
"msgFrom": 200,
"contentType": 101,
"content": "{\"content\":\"hello!!\"}",
"ex": ""
}
},
{
"conversationID": "si_110_111",
"recvMsgOpt": 0,
"unreadCount": 1,
"IsPinned": false,
"msgInfo": {
"serverMsgID": "5c3d8542f9eae1487283a5fe335aab1a",
"clientMsgID": "e09109bdfeb221cec1827317c313e3d0",
"sessionType": 1,
"sendID": "111",
"recvID": "110",
"senderName": "yourNickname",
"faceURL": "yourFaceURL",
"groupID": "",
"groupName": "",
"groupFaceURL": "",
"groupType": 0,
"groupMemberCount": 0,
"LatestMsgRecvTime": 1695212630740,
"msgFrom": 200,
"contentType": 101,
"content": "{\"content\":\"hello!!\"}",
"ex": ""
}
}
]
}
}
Success Response Parameters Description
Parameter Name | Type | Description |
---|---|---|
errCode | int | Error code, 0 indicates success |
errMsg | string | Brief error message, empty if none |
errDlt | errDlt | Detailed error information, empty if none |
unreadTotal | string | Total number of unread messages |
conversationTotal | string | Total number of conversations |
data | object | Common data object, see below for specific structure |
conversationElems | array | - |
conversationID | string | Conversation ID |
recvMsgOpt | string | Group chat message mute option |
unreadCount | string | Number of unread messages |
msgInfo | object | Message content |
serverMsgID | string | Server message ID |
clientMsgID | string | Client message ID |
sessionType | string | Session type. 1 for single chat, 2 for group chat (normal distribution), 3 for large group (read distribution interface), 4 for notification sessions |
recvID | string | Receiver ID |
sendID | string | Sender ID |
faceURL | string | Avatar URL. In single chats, if the sender is the current user, this field is the friend's avatar URL |
senderName | string | Sender's nickname. In single chats, if the sender is the current user, this field is the friend's nickname. In group chats, this field is the sender's nickname |
LatestMsgRecvTime | string | Timestamp of the latest received message |
msgFrom | string | Message source. 100 for user-sent messages, 200 for admin-sent or system broadcast notifications, etc. |
content | object | Detailed content of the message, internally a JSON object. For other message types, refer to the Message Type Format Description document |
contentType | int | Message type |
groupID | string | Group chat ID |
groupName | string | Group chat name |
groupFaceURL | string | Group chat avatar URL |
groupMemberCount | string | Number of group members |
IsPinned | string | Whether the conversation is pinned |
ex | string | Extension field |
Failure Response Example
{
"errCode": 1004,
"errMsg": "RecordNotFoundError",
"errDlt": ": 1004 RecordNotFoundError"
}
Failure Response Parameters Description
Parameter Name | Type | Description |
---|---|---|
errCode | int | Error code, refer to global error code documentation |
errMsg | string | Brief error message |
errDlt | errDlt | Detailed error information |