SDKsHarmonyOSEnterprise
Query group IDs by conversation ID
Retrieve all conversation groups currently associated with a specific conversation.
A conversation can belong to multiple groups simultaneously. This method returns complete conversation group objects rather than just raw string IDs.
Code example
import sdk, {
GetConversationGroupByConversationIDReq,
GetConversationGroupByConversationIDResp,
} from '@openimsdk/imsdk';
const request: GetConversationGroupByConversationIDReq = {
conversationID: conversationID,
};
const response: GetConversationGroupByConversationIDResp =
await sdk.getConversationGroupByConversationID(request);
const groups = response.conversationGroups;Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
conversationID | string | Yes | Target OpenIM conversation identifier (not a chat group ID). |
Return value
Returns a Promise that resolves to a GetConversationGroupByConversationIDResp object:
| Property | Type | Description |
|---|---|---|
conversationGroups | IMConversationGroup[] | Array of complete conversation groups linked to this conversation. |
State changes after the call
Resolving the Promise provides the current group associations for this conversation without triggering real-time events. Extract conversationGroupID from each item if you only need the IDs. When group associations change, synchronize state via the events described in Conversation groups overview or re-invoke this query.
Was this page helpful?