Query the blocklist
Overview
You can call this operation to pull the list of all blocked friends based on user IDs by page.
Operation prototype
- Request method: GET
- Request URL:
https://zim-api.zego.im/?Action=QueryBlacklist
- Protocol: HTTPS
- QPS limit: 20 calls per second
Request parameters
The following table describes only the operation-specific request parameters and some common request parameters. For the complete list of common request parameters, see the Public request parameters section of the Accessing Server APIs topic.
Parameter | Type | Required | Description |
---|---|---|---|
FromUserId | String | Yes | The ID of the registered user whose blocklist is to be queried. |
Limit | Number | Yes | The number of blocked friends to be pulled per time. Value range: [0, 100]. If this parameter is not specified, is set to 0 , or is greater than 100, the value 100 is used. |
Next | Number | Yes | The flag for a paginated pull. For the first pull, set this parameter to For example, if
|
Sample request
https://zim-api.zego.im/?Action=QueryBlacklist
&FromUserId=zego
&Limit=100
&Next=2
&<Common request parameters>
Response parameters
Parameter | Type | Description |
---|---|---|
Code | Number | The return code. |
Message | String | The description of the request result. |
RequestId | String | The request ID. |
TotalCount | Number | The total number of blocked friends. |
Next | Number | The flag for a paginated pull. If this parameter is not 0 , information about more blocked friends is to be returned. In this case, set this parameter as needed to pull the remaining information. If this parameter is 0 , information of all blocked friends is returned. |
Blacklist | Array of Object | The list of blocked friends. |
└UserId | String | The user ID. |
└UserName | String | The username. |
└Avatar | STRING | The user avatar URL. |
└UpdateTime | Number | The time when a friend was blocked. Unit: milliseconds. |
Sample response
{
"Code": 0,
"Message": "success",
"RequestId": "343649807833778782",
"TotalCount": 500,
"Next": 1,
"Blacklist": [
{
"UserId": "usera1",
"UserName": "Nicknamea1",
"Avatar": "Avatar1",
"UpdateTime": 1698310534000,
},
{
"UserId": "usera2",
"UserName": "Nicknamea2",
"Avatar": "Avatar2",
"UpdateTime": 1698310534000,
}
]
}
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 | Invalid parameter. | Check the input parameter. |
660300005 | The QPS limit specified in AppID is exceeded. | Try again later. |
660500002 | FromUserId is not registered. | Check whether the user is registered. - If so, contact ZEGOCLOUD technical support. - If not, register the user. |
660800001 | FromUserId is not registered. | Check whether the user is registered. - If so, contact ZEGOCLOUD technical support. - If not, register the user. |