Query group member list
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:
|
GroupId only supports digits, English characters, and '!', '#', '$', '%', '&', '(', ')', '+', '-', ':', ';', '<', '=', '.', '>', '?'.
Sample request
-
Sample URL request
Untitledhttps://zim-api.zego.im/?Action=QueryGroupMemberList &<public request parameter>
1 -
Request body:
Untitled{ "GroupId":"groupA", "Limit":1000, "Next":0 }
1
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. |