SDKsHarmonyOSEnterprise
Get specified groups info
Batch query the latest profile information for specified group IDs.
Use this method when you already hold group IDs and need to fetch the latest group profile data. It is not intended as a public directory search or for discovering unknown groups by name.
Code example
import sdk, { GetSpecifiedGroupsInfoReq, GetSpecifiedGroupsInfoResp } from '@openimsdk/imsdk';
const request: GetSpecifiedGroupsInfoReq = {
groupIDs: ['group_001', 'group_002'],
};
const response: GetSpecifiedGroupsInfoResp = await sdk.getSpecifiedGroupsInfo(request);
const groups = response.groups;Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
groupIDs | string[] | Yes | Array of group identifiers to query. |
Return value
Returns a Promise resolving to GetSpecifiedGroupsInfoResp:
| Property | Type | Description |
|---|---|---|
groups | IMGroup[] | Array of group profile records. |
State changes after the call
Even when querying a single group, pass the ID inside an array. The returned array order is not guaranteed to correspond 1:1 with the input array index; match records using groupID. This is a read-only query that does not trigger events. If the view remains active, handle group profile updates as described in Group overview.
Was this page helpful?