Browse SDKs · Android
Platform
SDKsAndroid

Get group member profiles

Use getGroupMembersInfo to retrieve specified users’ profiles within a group.

Copy

Retrieve detailed member profiles for specific users within a given group (including in-group nickname, role level, and mute status). Pass the target group ID and a list of user IDs. This method is commonly used for message bubble rendering, member profile cards, and mention parsing.

Code example

String groupID = "group_123";
List<String> userIDs = Arrays.asList("user_a", "user_b");

OpenIMClient.getInstance().groupManager.getGroupMembersInfo(
    new OnBase<List<GroupMembersInfo>>() {
        @Override
        public void onSuccess(List<GroupMembersInfo> members) {
            // members contains the retrieved group member profiles
        }

        @Override
        public void onError(int code, String error) {
            // Failed to retrieve member profiles
        }
    },
    groupID,
    userIDs
);

Parameters

ParameterTypeRequiredDescription
baseOnBase<List<GroupMembersInfo>>YesCallback handler for the asynchronous request.
groupIDStringYesGlobally unique ID of the target group.
userIDsList<String>YesList of user IDs whose member profiles are being queried.

Return value

Upon success, onSuccess returns a list of member profiles (List<GroupMembersInfo>). Each entry contains member attributes such as nickname, faceURL, roleLevel, and muteEndTime.

State changes after the call

  1. Snapshot retrieval: This is a read-only query that retrieves the specified member records without mutating group state.
  2. Local cache update: The client should merge the returned items into the local member cache using groupID:userID as the unique key.
  3. Modifications: To update a member's in-group information, see Set group member nickname.