Browse SDKs · HarmonyOS
Platform
SDKsHarmonyOSEnterprise

Get specified groups info

Batch query the latest profile information for specified group IDs.

Copy

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

ParameterTypeRequiredDescription
groupIDsstring[]YesArray of group identifiers to query.

Return value

Returns a Promise resolving to GetSpecifiedGroupsInfoResp:

PropertyTypeDescription
groupsIMGroup[]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.