Retrieve Recent Chats

Get Recent Chats#

To get all the list of recent chats, send a request to the server as described below.

await SDK.getRecentChats();

Response Params#

ArgumentsDescriptionType
statusCodeStatus CodeNumber
messageSuccess/Error MessageString
dataArray of Object datasArray

Response Format:#

data: [
{
msgBody: {
media: { // For Media Message Only
caption: "", // String - Media Caption
duration: "", // String - Duration - For Audio/Videos
fileName: "", // String - File Name
file_size: "", // Number - File Size
file_url: "", // String - File Url
is_downloaded: "", // Number - Downloaded Status
is_uploading: "", // Number - Uploading Status
local_path: "", // String - Local Path
thumb_image: "", // Base64 - Thumb Image
}
message: "", // String - Message Body
message_type: "" // String - Message Type
mentionedUsersIds: [], // Array - Mentioned Ids For groupChat
nickName: "Rizwan" // String - User Name
},
msgId: "", // String - Unique Message Id
toUserId: "", // String - To User Id
fromUserId: "", // String - From User Id
msgType: "", // String - Message Type
publisherId: "", // String - Publisher Id
msgStatus: "", // Number - Message Status
unreadCount: "", // Number - Unread Message Count
deleteStatus: "", // Number - Delete Status (Recall)
createdAt: "", // String - Created Time
timestamp: 1681185232000, // Number - TimeStamp - Milliseconds
chatType: "", // String - Chat Type "chat"/"groupchat"
updatedAt: "", // String - Updated Time
userId: "", // String - Notification To
muteStatus: 0, // Number - Mute Status
archiveStatus: 0 // Number - Archive Status
},
//...
];