In-app Chat
  • iOS : Objective-C
  • Android
  • Web
  • Flutter
  • React Native
  • Unity3D
  • Windows
  • macOS
  • Introduction
    • Overview
    • Basic concepts
  • Sample app
  • Getting started
  • Client SDKs
    • SDK downloads
    • Release notes
    • Upgrade guide
  • Guides
    • Authentication
    • Manage users
    • Room
    • Group
    • Messaging
    • Call invitation (signaling)
    • Manage sessions
  • Offline push notifications
  • Error codes
  • Client APIs
  • Server APIs
  • Documentation
  • In-app Chat
  • Server APIs
  • Group related
  • Query group member list

Query group member list

Last updated:2024-04-16 10:57

Description

Get the user list in a group based on the group ID.

The group ID can be obtained through Query Group List in the app.

Operation prototype

  • Request method: POST
  • Request endpoint: https://zim-api.zego.im/?Action=QueryGroupMemberList
  • Protocol: HTTPS
  • Rate limit: 20 requests/second

Request parameters

Listed below are the parameters specific to this request and part of the public request parameters. For the complete list of public request parameters, see Accessing Server APIs - Public parameters.

Parameter Type Required Description
GroupId
String
Yes
The group ID.
Limit
Number
No
The number of members obtained in a single request. The value range is [0, 1000], that is, up to 1000 members can be returned in a single call to this interface.

When the number of members in the group exceeds the Limit, this interface needs to be called multiple times.

If the number filled in exceeds 1000 or is not filled in, the default value is the maximum value of 1000.

Next
Number
No
The pagination flag. Fill in 0 for the first time, and fill in the value returned last time for subsequent times. If the Next returned is 0, the group member list is complete.

For example, if there are 2500 members in the group and you call this interface to query the group member list:

  • Call this interface for the first time, with Limit set to 1000 and Next set to 0 to query users 1-1000; the value of Next returned in the result is 1.
  • Call this interface for the second time, with Limit set to 1000 and Next set to 1 to query users 1001-2000; the value of Next returned in the result is 2.
  • Call this interface for the third time, with Limit set to 1000 and Next set to 2 to query users 2001-2500; the query is complete, and the value of Next returned in the result is 0.

GroupId only supports digits, English characters, and '!', '#', '$', '%', '&', '(', ')', '+', '-', ':', ';', '<', '=', '.', '>', '?'.

Sample request

  • Sample URL request

    https://zim-api.zego.im/?Action=QueryGroupMemberList
    &<public request parameter>
  • Request body:

    {
       "GroupId":"groupA",
       "Limit":1000,
       "Next":0
    }

Response parameters

Parameter Type Description
Code
Number
The return code.
Message
String
The explanation of the request result.
RequestId
String
The request ID.
TotalCount
Number
The total number of group members when the server starts querying.
Next
Number
The flag for paginated pulling.
MemberList
Array of String
The collection of group member information.
UserId
String
The ID of the group member.
UserName
String
The name of the group member.
UserNickName
String
The nickname of the user in the group.

Sample response

{
   "Code": 0,
   "Message": "success",
   "RequestId": "343649807833778782",
   "TotalCount": 1680,
   "Next": 168,
   "MemberList": [
      {
         "UserId": "u1",
         "UserName": "userName1",
         "UserNickName": "userNickName1"
      },
      {
         "UserId": "u2",
         "UserName": "userName2",
         "UserNickName": "userNickName2"
      }
   ]
}

Return codes

The following table describes only the return codes related to the business logic of the operation. For the complete list of return codes, see Return codes.

Return Code Description Solution
660000002
Parameter error.
Please refer to the request parameters and input the correct parameters.
660600001
The group does not exist.
Please confirm whether GroupId is correct.
660600003
Error when querying the group member list.
Please contact ZEGOCLOUD technical support.
660600004
The call frequency of the QueryGroupMemberList interface exceeds the limit.
The rate limit is 20 requests/second. Please do not exceed the limit.
Page Directory