Browse SDKs · WASM
SDKsWASMEnterprise

Get conversations in a group

Page through a conversation group and its conversation details.

Copy

Use getConversationGroupInfoWithConversations() to retrieve one conversation group together with one page of its conversation details.

Parameters

ParameterTypeRequiredDescription
conversationGroupIDstringYesConversation group ID to query.
pagination.pageNumbernumberYesPage number, starting at 1.
pagination.showNumbernumberYesNumber of conversations per page.
const { data } = await openimsdk.getConversationGroupInfoWithConversations({
  conversationGroupID,
  pagination: {
    pageNumber: 1,
    showNumber: 20,
  },
});

renderConversationGroup(data.group, data.conversationElems, data.conversationTotal);

Return result

FieldTypeDescription
groupConversationGroupCurrent conversation group details.
conversationTotalnumberTotal number of conversations in the group.
conversationElemsConversationItem[]Conversation details for the current page.

See Get conversation groups for group fields and Get the conversation list for conversationElems fields. Determine the end of pagination from conversationTotal and the number of conversations already loaded.

This query does not trigger group events. Conversations in the group can change during pagination. If the page must show the latest data after pagination finishes, query again and use the latest result. See Conversation group overview for handling the related events.