logo
In-app Chat
Powered Byspreading
On this page

Check blockships


Overview

You can call this operation to batch check the blockships of a user between up to 20 users, that is, whether the user blocks them. If you need a higher limit, contact ZEGOCLOUD technical support.

Operation prototype

  • Request method: POST
  • Request URL: https://zim-api.zego.im/?Action=CheckUsersIsInBlacklist
  • 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.

ParameterTypeRequiredDescription
FromUserIdStringYesThe ID of the registered user whose blockships are to be checked.
UserIdsArray of StringYesThe list of users to be checked. Up to 20 user IDs can be included.
Note

The FromUserId and UserIds parameters can contain only digits, letters, and the following characters: '!', '#', '$', '%', '&', '(', ')', '+', '-', ':', ';', '<', '=', '.', '>', '?', '@', '[', ']', '^', '_', ' ', ', ', '|', '~'.

Sample request

  • Request URL:

    Untitled
    https://zim-api.zego.im/?Action=CheckUsersIsInBlacklis
    &<Common request parameters>
    
    1
    Copied!
  • Request body:

    Untitled
    {
        "FromUserId": "zego_user",
        "UserIds": [
            "user1",
            "user2",
            "user3",
            "user4"
        ]
    }
    
    1
    Copied!

Response parameters

ParameterTypeDescription
CodeNumberThe return code.
Note
When you request to check the blockships between FromUserId and multiple users, take note of the following items:
  • If one or more blockships are successfully checked, 0 is returned. For more information, see ErrList.
  • If all blockships fail to be checked, a corresponding code is returned. For more information, see Return codes.
MessageStringThe description of the request result.
RequestIdStringThe request ID.
SuccArray of ObjectThe list of successful results.
└UserIdStringThe ID of the user whose blockship with FromUserId is successfully checked.
└ResultNumberThe check result. Valid values:
  • 0: not blocked.
  • 1: blocked.
ErrListArray of Object

The list of failed results.

  • If Code is 0:

    • If ErrList is empty, the blockships between FromUserId and all specified users are successfully checked.
    • If ErrList is not empty, the blockships between FromUserId and some specified users fail to be checked. In this case, see SubCode.
  • If Code is not 0:

    • If ErrList is empty, one or more parameters are invalid, the QPS limit is exceeded, or a system error occurs.
    • If ErrList is not empty, the blockships between FromUserId and all specified users fail to be checked.
└UserIDStringThe ID of the user whose blockship with FromUserId fails to be checked.
└SubCodeNumberThe code returned when the request fails.

Sample response

Untitled
{
    "Code": 0,
    "Message": "success",
    "RequestId": "343649807833778782",
    "Succ": [
        {
            "UserId": "user1",
            "Result": 1
        },
        {
            "UserId": "user2",
            "Result": 1
        }
    ],
    "ErrList": [
        {
            "UserId": "user3",
            "SubCode": 660000002
        },
        {
            "UserId": "user4",
            "SubCode": 660000002
        }
    ]
}
1
Copied!

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 CodeDescriptionSolution
660000002Invalid parameter.Check the input parameter.
660300005The QPS limit specified in AppID is exceeded.Try again later.
660500002FromUserId is not registered.

Check whether the user is registered.

  • If so, contact ZEGOCLOUD technical support.
  • If not, register the user.
660700015The target user is not registered.

Check whether the user is registered.

  • If so, contact ZEGOCLOUD technical support.
  • If not, register the user.
660800001FromUserId is not registered.

Check whether the user is registered.

  • If so, contact ZEGOCLOUD technical support.
  • If not, register the user.
660800039Too many users are included in the list.Reduce the number of users.

Previous

Query the blocklist

Next

Batch delete friends