Skip to main content

Get All Members

The getAllMembers method is used to retrieve a list of members based on their state. This function supports pagination and provides detailed member data.

Steps to Get All Members

  1. Create a GetAllMembersRequest object with the required member state and optional pagination details.
  2. Call the getAllMembers() function using the instance of the LMChatClient class.
  3. Use the response LMResponse<GetAllMembersResponse> to handle the retrieved member list.
GetAllMembersRequest request = (GetAllMembersRequestBuilder()
..memberState(1) // Provide the member state
..page(1)) // Optional: Provide the page number for pagination
.build();

final LMResponse<GetAllMembersResponse> response = await lmChatClient.getAllMembers(request);

if (response.success) {
// Use the retrieved member data
handleMembers(response.data.members);
} else {
// Handle error
handleError(response);
}
tip

The memberState parameter determines the type of members to retrieve. For example, active, inactive, or specific states as defined in your application.

Models

GetAllMembersRequest

List of parameters for the GetAllMembersRequest class:

VariableTypeDescriptionOptional
memberStateintState of members to retrieve
pageintPage number for pagination✔️

GetAllMembersResponse

List of parameters for the GetAllMembersResponse class:

VariableTypeDescriptionOptional
membersList<DmAllMember>List of members retrieved✔️

DmAllMember

List of parameters for the DmAllMember class:

VariableTypeDescriptionOptional
customTitleStringCustom title assigned to the member✔️
idintUnique identifier for the member✔️
imageUrlStringURL of the member's profile image✔️
isDeletedboolIndicates if the member is deleted✔️
isGuestboolIndicates if the member is a guest✔️
nameStringName of the member✔️
questionAnswersStringAnswers to any custom questions✔️
sdkClientInfoSDKClientInfoSDK client information✔️
userUniqueIdStringUnique user ID✔️
uuidStringUniversally unique identifier for member✔️