Chat / Platform API
Current version: v3
    Chat Platform API v3
    Chat Platform API
    Chat
    Platform API
    Home
    /
    Chat
    /
    Platform API

    List blocked users

    Retrieves a list of users that a user has blocked.


    HTTP request

    GET https://api-{application_id}.sendbird.com/v3/users/{user_id}/block
    

    Parameters

    The following table lists the parameters that this action supports.

    Parameters
    RequiredTypeDescription

    user_id

    string

    Specifies the unique ID of the user.

    OptionalTypeDescription

    token

    string

    Specifies a page token that indicates the starting index of results to retrieve. If not specified, the index is set as 0.

    limit

    int

    Specifies the number of results to return per page. Acceptable values are 1 to 100, inclusive. (Default: 10)

    user_ids

    string

    Specifies the user IDs of the blocked users to search for. The value should be a comma-separated string that consists of multiple urlencoded user IDs. An example of a urlencoded string is ?user_ids=urlencoded_id_1, urlencoded_id_2.

    metadatakey

    string

    Specifies a keyword to search for. The keyword acts as a filter to search for blocked users with metadata containing the keyword as a key. This parameter should be specified in conjunction with the metadatavalues_in parameter below.

    metadatavalues_in

    string

    Specifies a keyword to search for. The keyword acts as a filter to search for blocked users with metadata containing the keyword in its values. This parameter works in conjunction with the key specified by the metadatakey parameter above. The value of metadatakey must match one or more values specified by this parameter. The string should be specified with multiple comma-separated, urlencoded metadata values. An example of a urlencoded string is ?metadatavalues_in=urlencoded_value_1, urlencoded_value_2. This parameter should be specified in conjunction with metadatakey above.

    ?token=BFRTAQBTQlWeEUBXWFNeF1E2FEdFRF~~&limit=3&metadatakey=marriage&metadatavalues_in=Y
    

    Response

    If successful, this action returns a list of blocked user resources in the response body.

    {
        "users": [
            {
                "user_id": "Tom",
                "nickname": "MissionImpossible",
                "profile_url": "https://sendbird.com/main/img/profiles/profile_26_512px.png",
                "is_online": false,
                "last_seen_at": 2001604082551,
                "metadata": {
                    "location": "Los Angeles",
                    "marriage": "Y"
                }
            },
            {
                "user_id": "Kelly",
                "nickname": "Traveler",
                "profile_url": "https://sendbird.com/main/img/profiles/profile_42_512px.png",
                "is_online": true,
                "last_seen_at": 0,
                "metadata": {
                    "location": "Las Vegas",
                    "marriage": "N"
                }
            }
        ],
        "next": "AQdfe45fs1AIEUYXX1RcE2d0FUZSUlkJFVQRHB86AkAgNn8eABABFeA3X11fUl34df31"
    }
    

    List of response properties

    Property nameTypeDescription

    users[]

    array of objects

    An array of blocked user.

    next

    string

    The value that can be used in the token parameter to retrieve the next page in the result set.

    In the case of an error, an error object is returned. A detailed list of error codes is available here.