Broadcastify-Calls-API
From The RadioReference Wiki
Contents
Notes
- API is currently under development and may change at any time
Development Process
- Developer contacts broadcastify at support@broadcastify.com with details and intentions
- Developer is issued an API Key and System ID for a test system to use in the development environment
- Developer codes some awesome implementation to use the Broadcastify Calls API documented below
- Developer gets paid when production systems come online as indicated in the "Development Incentives" section below.
API Process
- Application verifies that proper time sync is installed, configured, running, and time is properly synched on the host computer.
- Application records a call and associated metadata (talkgroup, frequency, site, source ID)
- Application converts call audio to AAC Audio (*.m4a)
- Application calls the Broadcastify Calls API to register the clip, and an upload URL is returned
- Application uploads the call to Broadcastify's storage servers with an HTTP PUT request
Upload API
Apply for an API Key and System ID
An API key and unique system ID identifier is required for every uploaded system. For trunked radio systems, you will need to provide the RadioReference.com Database Unique SID for the trunked system, and the unique siteID. API Keys and System Identifiers will be different between development and production.
Contact support@broadcastify.com to get an API and System ID assigned.
Convert to M4A AAC Audio
ffmpeg -i "${basename}.wav" -c:a libfdk_aac -b:a 32k -cutoff 18000 "${basename}.m4a
Get the duration of the audio clip
ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "${basename}.m4a
Register the Clip and get the Upload URL
This is a RFC1867 multipart/form-data POST request to the API Endpoint.
curl -s https://api.broadcastify.com/call-upload-dev -F "apiKey=${APIKEY}" -F "systemId=${SYSTEMID}" -F "callDuration=${duration}" -F "ts=${timestamp}" -F "tg=${tg}" -F "src=${src}" -F "freq=${freq}"
URL for Development: https://api.broadcastify.com/call-upload-dev URL for Production: https://api.broadcastify.com/call-upload apiKey = API Key systemId = Unique System ID Assigned to this call ingest system (paired with API Key Assignment) callDuration = duration of the call in seconds (float number) ts = call START timestamp in epoch seconds (unix timestamp) tg = call talkgroup decimal ID (trunked call upload only). If patch, a comma delimited string of talkgroups with Patch ID listed first src = call source decimal ID (unit ID) freq = call frequency (float number - trunked and conventional call upload)
Successful return is a single line with a return code followed by a one time use upload URL.
Example: 0 https://upload.hostname.com/uploadPath/oneTimeUseKey
Error return is an error code followed by an error message
Example: 100 NO-API-KEY-SPECIFIED
Upload the Audio File
curl --write-out %{http_code} --silent --output /dev/null -X PUT -H "Content-Type: audio/aac" -T ${basename}.m4a "${uploadURL}"
Development Incentives
- To qualify for incentives, developers must apply and have an approved agreement with RadioReference.com/Broadcastify. Developers can request to be part of the incentive program by contact us at support@broadcastify.com
- When first system comes online in production, developer receives a $500 USD check
- When 5 systems come online in production, developer receives an additional $2000 USD check