Query the host list
Updated
Retrieves hosts in a specified channel.
https://api.agora.io/dev/v1/channel/user/{appid}/{channelName}/hosts_onlyUse this endpoint to get the list of hosts in a specified channel. This endpoint is only available in the LIVE_BROADCASTING profile (mode = 2); all users in the channel must use the same profile, otherwise query results may be inaccurate.
Path Parameters
The App ID of the project. You can get it through one of the following methods:
- Copy from the Agora Console
- Call the Get all projects API, and read the value of the
vendor_keyfield in the response body.
The channel name.
Request
-
The request URL and request body is case-sensitive. All requests must use HTTPS.
-
Content-Type:application/json -
The request header must contain the
Authorizationfield. For details, see RESTful authentication.
Response
-
A
200status code indicates success. The response body contains the following parameters: -
If the status code is not
200, the request fails. See themessagefield in the response body for the reason for this failure. Refer to Response status codes for details.
Response Body
application/json
Response schema
200application/jsonA 200 status code indicates success. The response body contains the result of the request.
defaultapplication/jsonThe request failed. See the message field in the response body for the reason. Refer to Response status codes for details.
Reference
Synchronizing host online status
To synchronize the online status of hosts, you can use this endpoint or the query user status endpoint. This endpoint requires a lower call frequency and offers higher efficiency, so Agora recommends it for this purpose.
Request examples
curl --request GET \ --url https://api.sd-rtn.com/dev/v1/channel/user/<appid>/<channelName>/hosts_only \ --header 'Accept: application/json' \ --header 'Authorization: Basic <your_base64_encoded_credentials>'Response example
{ "success": true, "data": { "channel_exist": true, "mode": 2, "broadcasters": [ 574332, 1347839 ] }}