Quick Reference for AI Agents & Developers
Retrieve the List of Group Members
To fetch the list of group members for a group, use theGroupMembersRequest class. 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 group members are fetched.
The GroupMembersRequestBuilder class allows you to set the following parameters:
The GUID of the group for which the members are to be fetched must be specified in the constructor of the GroupMembersRequestBuilder class.
Set Limit
This method sets the limit i.e. the number of members that should be fetched in a single iteration.- Java
- Kotlin
Set Search Keyword
This method allows you to set the search string based on which the group members are to be fetched.- Java
- Kotlin
Set Scopes
This method allows you to fetch group members based on the specified scopes.- Java
- Kotlin
build() method to get the object of the GroupMembersRequest class.
Once you have the object of the GroupMembersRequest class, call the fetchNext() method. This method returns a list of GroupMember objects containing N number of members depending on the limit set.
- Java
- Kotlin
Best Practices
Use Pagination for Large Groups
Use Pagination for Large Groups
Set an appropriate limit (e.g., 30) and call
fetchNext() multiple times to load members in batches, especially for large groups.Filter by Scope for Admin Views
Filter by Scope for Admin Views
Use
setScopes() to fetch only admins and moderators when building admin panels or management interfaces.Implement Member Search
Implement Member Search
Use
setSearchKeyword() to allow users to quickly find specific members by name or UID in large groups.Cache Member Lists
Cache Member Lists
Cache fetched member lists locally to reduce API calls and improve performance when users navigate back to member lists.
Troubleshooting
Empty Members List
Empty Members List
Symptom:
fetchNext() returns an empty list even though the group has members.Cause: The GUID is incorrect, or filters are too restrictive.Solution: Verify the GUID is correct. Remove filters temporarily to check if members exist.Cannot Fetch Members - Not a Member
Cannot Fetch Members - Not a Member
Symptom:
fetchNext() fails with “Not a member” error.Cause: User is not a member of the group (for private groups).Solution: Ensure the user has joined the group before fetching members. Use join-group first.Scope Filter Not Working
Scope Filter Not Working
Symptom:
setScopes() returns all members instead of filtered results.Cause: Scope values must be lowercase strings: “admin”, “moderator”, “participant”.Solution: Use lowercase scope values. Check the Group Class for valid scope constants.