Skip to main content

Retrieve host list

Gethttps://api.agora.io/dev/v1/channel/user/{appid}/{channelName}/hosts_only

This API is only used in the live broadcast profile. Users in the same channel must use the same profile. Otherwise, the query results may be inaccurate. This API and the query user status API can both be used to synchronize the online status of hosts. Compared to the query user status API, this API requires a lower call frequency and has a higher efficiency. Therefore, Agora recommends using this API for this purpose.

Path parameters
  • appidstringrequired
    Your APP ID.
  • channelNamerequired
    The channel name
Body
  • page_nonumber
    The page number that you want to query. The default value is 0, that is, the first page. The value of page_no cannot exceed (the total number of channels/the value of page_size - 1); otherwise, the specified page does not contain any channel.
  • page_sizenumber
    The number of channels on a page. The value range is [1,500], and the default value is 100.
Response
  • successbool
    • true: Success.
    • false: Reserved for future use.
  • dataobject
    User information, including the following fields:
    • channel_existBoolean
      • true: Success.
      • false: Reserved for future use.
    • modenumber
      • 1: The COMMUNICATION profile.
      • 2: The LIVE_BROADCASTING profile.
    • broadcastersArray
      User IDs of all hosts in the channel. This field is returned only when mode is `2`
Authorization
This endpoint requires Basic Auth. Use your Customer ID as the username and Customer Secret as the password.
Request example
curl --request GET --url https://api.sd-rtn.com/dev/v1/channel/user/appid/channelName/hosts_only --header 'Accept: application/json' --header 'Authorization: Basic 123'
Response example
{
"success": true,
"data": {
"channel_exist": true,
"mode": 2,
"broadcasters": [
574332,
1347839
]
}
}