Broadcast Database Monitoring API

Monitoring API for Broadcast Database

Please get the “access_key” from the “Broadcast Database” project and click the project name to find the “channel_id” on Stream Management page.

Get full day results:

This API will get full day results, change “YYYYMMDD” to change the date. If the date is the current day, then the results are till the moment you call this API. Timezone is UTC.

https://api.acrcloud.com/v1/acrcloud-monitor-streams/{channel_id}/results?access_key={project access_key}&date={YYYYMMDD}

 

Callback URL for Broadcast Database Monitoring

You can set Callback URL for monitoring results by the following steps: select the project under Broadcast Database Monitoring projects then click “Action” —> click “Set Result Callback” in the dropdown menu —> input the callback URL and click “Confirm”.

The system will post “stream_id”, “stream_url”,”status” and monitoring results “data” (json format) to the callback URL

Field NameTypeDescription
bucket_idstringCustom bucket ID
stream_idstringthe channel id in broadcast database
stream_namestringChannel Name
stream_countrystringCountry of the channel
stream_urlstringthe stream url (empty)
user_defineddictionaryCustom ID or user defined field
datastringthe monitoring result with json format
statusinteger0: no result
1: detected a result

PHP Examples:
For “JSON” Post Type:

For “Form” Post Type:

 

 

Callback URL for Stream Status of Broadcast Database

You can set Callback URL for streams (that added by yourself) status of the broadcast database by the following steps: select the project under Broadcast Database Monitoring projects then click“Action” —> click ”Set State Callback” in the dropdown menu —> input “State Callback URL” and click “Update”.

action: POST
type: JSON
data:

Fields description:

nametypedescription
stream_idstringstream id
statusstringstream status
codeintstream status code
typestringstream type (audio, video or unknown)
timestampstringstatus UTC timestamp

Status description:
codestatusdescription
0runningThe stream is working
1timeoutThe stream is currently not stable, no results will be shown at the moment, the system will try to rectify the stream, and in the meantime why not use another stream link.
4pausedThe stream is paused
6invalid URLThe stream URL has a problem, our system can not access the stream, please check the stream or change to another stream URL.
10deletedThe stream is deleted
12muteThe audio of the current stream URL is muted

 

Recording API for Broadcast Database

https://console.acrcloud.com/monitoring/acrcloud_record_cut/{access_key}/{stream_id}?begin_date={the field “record_timestamp” in the result }&played_duration={the field “played_duration” in the result}

 

Console API for Broadcast Database

You can use the following code to get the list of the channels in the project, please refer to the code here.