Skip to main content

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 NameExample ValueOptionalTypeDescription
operationID1646445464564RequiredstringUsed for global trace tracking. It is recommended to use a timestamp, unique for each request
tokeneyJhbxxxx3XsRequiredstringAdmin token

Request Parameters Example

{
"userID": "9906953281",
"conversationIDs": ["si_2699373280_9906953281"],
"pagination": {
"pageNumber": 1,
"showNumber": 20
}
}
Field NameOptionalTypeDescription
userIDRequiredstringCurrent user ID
conversationIDsOptionalstringList of conversation IDs. If provided, returns the specified conversations. If not provided, returns the default paginated conversation list
paginationRequiredobjectPagination parameter structure
pagination.pageNumberRequiredstringCurrent page number, starting from 1
pagination.showNumberRequiredstringNumber 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 NameTypeDescription
errCodeintError code, 0 indicates success
errMsgstringBrief error message, empty if none
errDlterrDltDetailed error information, empty if none
unreadTotalstringTotal number of unread messages
conversationTotalstringTotal number of conversations
dataobjectCommon data object, see below for specific structure
conversationElemsarray-
conversationIDstringConversation ID
recvMsgOptstringGroup chat message mute option
unreadCountstringNumber of unread messages
msgInfoobjectMessage content
serverMsgIDstringServer message ID
clientMsgIDstringClient message ID
sessionTypestringSession type. 1 for single chat, 2 for group chat (normal distribution), 3 for large group (read distribution interface), 4 for notification sessions
recvIDstringReceiver ID
sendIDstringSender ID
faceURLstringAvatar URL. In single chats, if the sender is the current user, this field is the friend's avatar URL
senderNamestringSender'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
LatestMsgRecvTimestringTimestamp of the latest received message
msgFromstringMessage source. 100 for user-sent messages, 200 for admin-sent or system broadcast notifications, etc.
contentobjectDetailed content of the message, internally a JSON object. For other message types, refer to the Message Type Format Description document
contentTypeintMessage type
groupIDstringGroup chat ID
groupNamestringGroup chat name
groupFaceURLstringGroup chat avatar URL
groupMemberCountstringNumber of group members
IsPinnedstringWhether the conversation is pinned
exstringExtension field

Failure Response Example

{
"errCode": 1004,
"errMsg": "RecordNotFoundError",
"errDlt": ": 1004 RecordNotFoundError"
}

Failure Response Parameters Description

Parameter NameTypeDescription
errCodeintError code, refer to global error code documentation
errMsgstringBrief error message
errDlterrDltDetailed error information