Skip to main content
Fetch the members of a group with filtering by scope, online status, and search keyword. Results are returned as GroupMember objects, which extend User with group-specific fields like scope.

Retrieve the List of Group Members

In order to fetch the list of groups members for a group, you can use the GroupMembersRequest class.
Available via: SDK | REST API | UI Kits
To use this class i.e to create an object of the GroupMembersRequest class, you need to use the GroupMembersRequestBuilder class. The GroupMembersRequestBuilder class allows you to set the parameters based on which the groups are to be fetched. The GUID of the group for which the members are to be fetched must be specified in the constructor of the GroupMembersRequestBuilder class.

GroupMembersRequestBuilder

Set Limit

This method sets the limit i.e. the number of members that should be fetched in a single iteration.

Set Search Keyword

This method allows you to set the search string based on which the group members are to be fetched.

Set Scopes

This method allows you to fetch group members based on the specified scopes.
Relevant fields to access on returned members:

Set Status

Filters members by online status: If not set, returns all members regardless of status.
Finally, once all the parameters are set to the builder class, you need to call the build() method to get the object of the GroupMembersRequest class. Once you have the object of the GroupMembersRequest class, you need to call the fetchNext() method. Calling this method will return a list of GroupMember objects containing N number of members depending on the limit set.
The fetchNext() method returns a list of GroupMember objects. GroupMember extends User and adds group-specific fields.
On Success — A List<GroupMember> containing the group members for the specified group (each item is a GroupMember object):GroupMember Object (per item in array):

Next Steps

Add Members

Add new members to your groups

Kick/Ban Members

Remove or ban members from groups