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

    List open channels

    This action retrieves a list of open channels. You can use various query parameters to determine the search scope and select what kind of information you want to receive about the queried channels.


    HTTP request

    GET https://api-{application_id}.sendbird.com/v3/open_channels
    

    Parameters

    The following table lists the parameters that this action supports.

    Optional
    Parameter nameTypeDescription

    token

    string

    Specifies a page token that indicates the starting index of a chunk 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)

    custom_types

    string

    Specifies a comma-separated string of one or more custom types to filter open channels. Urlencoding each type is recommended (for example, ?custom_types=urlencoded_type_1,urlencoded_type_2). If not specified, all channels are returned, regardless of their custom type.

    name_contains

    string

    Searches for open channels containing the specified value in their channel names. Note that this parameter is case-insensitive. Urlencoding the value is recommended.

    url_contains

    string

    Searches for open channels containing the specified value in their channel URLs. Urlencoding the value is recommended.

    show_frozen

    boolean

    Determines whether to include frozen channels in the response. Frozen channels are channels where only channel operators are allowed to send messages. (Default: true)

    show_metadata

    boolean

    Determines whether to include channel metadata in the response. (Default: false)

    custom_type

    string

    (Deprecated) Searches channels whose custom_type matches the given value. If not specified, all channels are returned. The string passed here must be urlencoded.

    ?token=&limit=5&custom_types=live&name_contains=streaming
    

    Responses

    If successful, this action returns a list of open channel resources that match the query parameters in the response body.

    {
        "channels": [
            {
                "name": "LA Lakers vs. Miami Heat Basketball Live streaming today!",
                "channel_url": "monday_channel7_at_9_pm",
                "custom_type": "live",
                "is_ephemeral": false,
                "participant_count": 1023,
                "max_length_message": 5000,
                "created_at": 1484789122,
                "cover_url": "https://sendbird.com/main/img/cover/cover_12.jpg",
                "data": "{event_trigger:100,500,1000,2000}",
                "operators": [
                    {
                        "user_id": "Daniel",
                        "nickname": "Smileguy",
                        "profile_url": "https://sendbird.com/main/img/profiles/profile_26_512px.png"
                    }
                ],
                "freeze": false,
                "metadata": {
                    "background_image": "https://sendbird.com/main/img/bg/theme_013.png",
                    "text_size": "large"
                }
            },
            ... # More open channels
        ],
        "next": "XYZEK1VVQVErEUBXWFNeFp3Q2FkFVA~~"
    }
    

    List of response properties

    Property nameTypeDescription

    channels[]

    array of objects

    An array of open channel resources that match the specified optional parameters.

    next

    string

    The value for the token parameter to retrieve the next page in the result.

    Error

    In the case of an error, an error object like below is returned. See the error codes section for more details.

    {
        "message": "Invalid value: \"token\".",
        "code": 400111,
        "error": true
    }