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

    List channels where a user is banned

    Retrieves a list of open channels and group channels where a user is banned. The response contains information about the channels, such as channel_url and custom_type.


    HTTP request

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

    Parameters

    The following table lists the parameters that this action supports.

    Parameters
    RequiredTypeDescription

    user_id

    string

    Specifies the unique ID of a 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)

    ?token=WEFWRFBTFlArENBXWFNeF2p2FEdER~~&limit=3
    

    Response

    If successful, this action returns a list of banned open channel and group channel resources in the response body.

    {
        "banned_channels": [
            {
                "start_at": 1483688660939,
                "end_at": 1483688720939,
                "description": "rude behavior",
                "channel": {
                    "name": "Louvre Museum",
                    "custom_type": "art",
                    "channel_url": "sendbird_open_channel_11694_f94eba708909d33c34cb37b043838ecce07afc04",
                    "created_at": 1483606460,
                    "cover_url": "",
                    "data": ""
                }
            },
            {
                "start_at": 1483688620389,
                "end_at": 1483688680389,
                "description": "spam",
                "channel": {
                    "name": "Today's ESPN",
                    "custom_type": "sports",
                    "channel_url": "sendbird_group_channel_11694_61f545ddc85549592737afafe4bc2ec0d7ba92a0",
                    "created_at": 1483688557,
                    "cover_url": "",
                    "data": ""
                }
            }
        ],
        "next": "rsrFQ1AIEUYXX1cE2d0USlkJFVQRHB86AAgNn8eABBBFX1fUl3R22Ef4a53FREa4Dfw3"
    }
    

    List of response properties

    Property nameTypeDescription

    banned_channels[]

    array of objects

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

    banned_channels[].(ban).start_at

    long

    The time when the user becomes banned in the channel. The value is in Unix milliseconds format.

    banned_channels[].(ban).end_at

    long

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

    banned_channels[].(ban).description

    string

    The reason for banning the user.

    banned_channels[].(ban).channel

    nested object

    The simplified open channel or group channel resource that the user is banned from.

    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.