Skip to main content

Query channel list

GET
https://api.agora.io/dev/v1/channel/{appid}

Use this endpoint to get the list of all channels under a specified project. The channel list is returned by page; specify the page number and page size in the request URL.

info

If the number of users in a channel changes frequently, the query results may be inaccurate. The following situations may occur:

  • A channel appears repeatedly on different pages.
  • A channel does not appear on any page.

Request

The request URL and request body is case-sensitive. All requests must use HTTPS.

Request header

  • Content-Type: application/json
  • The request header must contain the Authorization field. For details, see RESTful authentication.

Path parameters

appid stringrequired

The App ID of the project. You can get it through one of the following methods:

Query parameters

QUERY
  • page_no numbernullable

    Default: 0

    The page number to query. The default value is 0, which is the first page. The value of page_no cannot exceed (total number of channels / page_size) - 1; otherwise, the specified page contains no channels.

  • page_size numbernullable

    Default: 100

    Range: [1, 500]

    The number of channels per page.

Response

A 200 status code indicates success. The response body contains the following parameters:

OK
  • success boolean

    The state of this request:

    • true: Success.
    • false: Reserved for future use.
  • data object

    Channel statistics.

    Show propertiesHide properties
    • channels array

      The list of channels. Each object in the array represents one channel and contains the following fields. If the specified page contains no channels, this field is empty.

      Show propertiesHide properties
    • total_size number

      The total number of channels under the specified project.

If the status code is not 200, the request fails. See the message field in the response body for the reason for this failure. Refer to Response status codes for details.

Authorization

This endpoint requires Basic authentication.

Request example

Test this request in Postman or use one of the following code examples:


_4
curl --request GET \
_4
--url 'https://api.sd-rtn.com/dev/v1/channel/<appid>?page_no=0&page_size=100' \
_4
--header 'Accept: application/json' \
_4
--header 'Authorization: Basic <your_base64_encoded_credentials>'

Response example


_12
{
_12
"success": true,
_12
"data": {
_12
"channels": [
_12
{
_12
"channel_name": "lkj144",
_12
"user_count": 3
_12
}
_12
],
_12
"total_size": 1
_12
}
_12
}