chat.getConversationList(options);
Name | Type | Description |
options | undefined | Array | Parameter options. If options are not passed, it means all conversations are retrieved If a non-empty array parameter is passed in, it indicates to get multiple specified conversations |
Promise
// Get the full conversation listlet promise = chat.getConversationList();promise.then(function(imResponse) {const conversationList = imResponse.data.conversationList; // Full list of conversations, overwrite the original list}).catch(function(imError) {console.warn('getConversationList error:', imError); // Failed to obtain the conversation list});
// Get the list of specified conversationslet promise = chat.getConversationList([conversationID1, conversationID2]);promise.then(function(imResponse) {const conversationList = imResponse.data.conversationList; // List of specified conversations that exist in the cache}).catch(function(imError) {console.warn('getConversationList error:', imError); // Failed to obtain the conversation list});
chat.getConversationProfile(conversationID);
Name | Type | Description |
conversationID | String | Conversation ID. Conversation ID formation method: C2C${userID} (Private chat) GROUP{groupID}(Group Chat) @TIM#SYSTEM (System Notification Session) |
Promise
let promise = chat.getConversationProfile(conversationID);promise.then(function(imResponse) {// Obtained successfullyconsole.log(imResponse.data.conversation); // Conversation profile}).catch(function(imError) {console.warn('getConversationProfile error:', imError); // Failed to obtain the conversation profile});
Was this page helpful?