Skip to main content

Get Sorted Conversation List

Brief Description

  • Get the sorted conversation list based on whether it is pinned and the chronological order of messages.

Request Method

  • post

Request URL

  • {API_ADDRESS}/conversation/get_sorted_conversation_list
Header NameExample ValueOptionalTypeDescription
operationID1646445464564RequiredstringUsed for global link tracking, timestamp is recommended, independent in each request
tokeneyJhbxxxx3XsRequiredstringAdmin token

Request Parameter Example

{
"userID": "9906953281",
"conversationIDs": ["si_2699373280_9906953281"],
"pagination":{
"pageNumber":1,
"showNumber":20
}
}

Field NameOptionalTypeDescription
userIDRequiredstringCurrent user ID
conversationIDsOptionalstringConversation ID list, if filled, returns the specified conversation list, if not filled, returns the default paginated conversation list
paginationRequiredstringPagination parameter structure
pageNumberRequiredstringCurrent page number, starting from 1
showNumberRequiredstringNumber of requests on the current page

Success Return 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":""
}
}
]
}
}

Parameter Description for Success Return Example

Field NameTypeDescription
errCodeintError code, 0 means success
errMsgstringBrief error message, empty
errDlterrDltDetailed error message, empty
unreadTotalstringTotal number of unread messages
conversationToalstringTotal number of conversations
dataobjectGeneral data object, see structure below
conversationElemsarrayNone
conversationIDstringConversation ID
recvMsgOptstringGroup chat message Do Not Disturb
unreadCountstringNumber of unread messages
msgInfoobjectMessage content
serverMsgIDstringServer message ID
clientMsgIDstringClient message ID
sessionTypestringConversation type, whether the sent message is a single chat or a group chat, single chat is 1, group chat (normal write diffusion) is 2, large group (read diffusion interface) is 3, notification conversation is 4
recvIDstringReceiver ID
SendIDstringSender ID
faceURLstringAvatar URL. In a single chat, when the sender is the current user, this field is the friend's avatar URL
senderNamestringSender nickname. In a single chat, when the sender is the current user, this field is the friend's nickname. In a group chat, this field is the corresponding sender nickname
LatestMsgRecvTimestringReceiving time of the last message
msgFromstringMessage source, 100 comes from user sending, 200 comes from admin sending or system broadcast notification, etc.
contentobjectThe specific content of the message, internally a json object, for detailed fields of other messages, please refer to the Message Type Format Description document
contentTypeintMessage Type
groupIDstringGroup chat ID
groupNamestringGroup chat name
groupFaceURLstringGroup chat avatar URL
groupMemberCountstringNumber of people in group chat
IsPinnedstringWhether the conversation is pinned
exstringExtension field

Failure Return Example

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

Parameter Description for Failure Return Example

Parameter NameTypeDescription
errCodeintError code, see global error code document for details
errMsgstringBrief error message
errDlterrDltDetailed error message