/ Platform API
Platform API
    Chat Platform API v3
    Chat Platform API
    Chat Platform API
    Version 3

    List banned participants in an open channel

    Copy link

    Retrieves a list of users who are banned from the specified open channel.


    HTTP request

    Copy link
    GET https://api-{application_id}.sendbird.com/v3/open_channels/{channel_url}/ban
    

    Parameters

    Copy link

    The following table lists the parameters that this action supports.

    Parameters
    RequiredTypeDescription

    channel_url

    string

    Specifies the URL of a channel.

    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. This value must be between 0 and 100. (Default: 10)

    show_total_ban_count

    boolean

    Determines whether to include the number of all users banned from the channel in the response. If set to true, includes the number of all users banned from the channel in the response. (Default: false)

    ?token=YnQSRDpSRl1AEE1WXlVaF2R3&limit=5&show_total_ban_count=true
    

    Response

    Copy link

    If successful, this action returns a list of banned user resource and ban information in the response body.

    {
        "banned_list": [
            {
                "user": {
                    "user_id": "Matthew",
                    "nickname": "Mooch",
                    "profile_url": "https://sendbird.com/main/img/profiles/profile_47_512px.png",
                    "metadata": {
                        "font_preference": "times new roman",
                        "font_color": "black"
                    }
                },
                "start_at": 1543211469000,
                "end_at": 1543211529000,
                "description": "Too much talking"
            },
            ... # More banned users
        ],
        "total_ban_count" : 10,
        "next": "KQnRP2aZR1nRAE1WXlVaR4w6",
    }
    

    List of response properties

    Copy link
    Property nameTypeDescription

    banned_list[]

    array of objects

    An array of JSON objects that contain information about the user who is banned from the channel, the duration of ban, and the reason for ban.

    banned_list.(ban).user

    nested object

    The user resource that contains brief information about the banned user.

    banned_list.(ban).start_at

    long

    The timestamp of when the ban starts. The value is in Unix milliseconds format.

    banned_list.(ban).end_at

    long

    The timestamp of when the ban is scheduled to end. The value is in Unix milliseconds format.

    banned_list.(ban).description

    string

    The reason for ban.

    total_ban_count

    int

    The count of all users banned from the channel.

    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.