API – Migration and Integration
Migrating historic radio data
While there is no official migration tool, several radios have built tools and scripts for performing migrations from other radio software. Besides offering Best Practices, we can also share some code for a sample migration service, if that’s what you need.
Beside migrating textual content, you might also want to migrate audio files.
For example you can reference audio files from your old system in AURA, by mounting the storage
location to the AURA server and referencing the files in your AURA Media Source objects via the
API (source property). This way you there is no need to import existing audio files to the
AURA Battery Media Storage service.
Use the API documentation to get started with your own migration. In the most common scenarios only the Steering API is required.
Let’s chat in Matrix to exchange tips.
Integrating with CMS and Website
So far radio stations have integrated AURA with Wordpress and Directus CMS.
Use the API documentation to get started with your own integration.
CBA API
Get media files for website radio player
Use the mediaId of CBA media URLs (e.g the 123456 in https://cba.media/123456) to query
for details of the media file using the following GET request:
cba.fro.at/wp-json/wp/v2/media?api_key=${apiKey}&parent=${mediaId}
This allows you to get metadata of CBA-hosted media files for integration into your website radio player.
Linking to CBA Podcast pages
Instead of adding CBA podcast URLs in the AURA
show settings, use the CBA ID
field to store the CBA podcast series ID. This allows you to link to CBA podcast pages from your
website.
For example rendering a link to the podcast series using the CBA ID as URL parameter as in
https://cba.media/?p=263671 (263671 is the series ID) redirects to the pretty url at
https://cba.media/podcast/szenenwechsel-lokale-sounds-aus-den-freien-radios.
This is the preferred way, as it allows podcast hosts to change the slug on CBA, which may otherwise result in broken links.
CBA API endpoints which require authentication
Verify if the CBA API spec is still up to date.
Purpose |
Endpoint |
Method |
Payload |
Return value |
|---|---|---|---|---|
Authentication |
cba.fro.at/wp-json/wp/ |
POST |
(1) |
bearer token |
Upload |
cba.fro.at/wp-json/wp/v2/media/ |
PUT |
(2) |
post_id (attachment) |
Post publication |
cba.fro.at/wp-json/wp/v2/posts/ |
PUT |
(3) |
|
Get all categories |
cba.fro.at/wp-json/wp/v2/categories?per_page=100 |
GET |
Array of objects |
|
Get all languages |
cba.fro.at/wp-json/wp/v2/language?per_page=100 |
GET |
Array of objects |
Payloads:
(1)
cba_username(str),cba_token(str)(2)
filename(3)
post_parent(=cba_series_id),post_title,post_content,post_category,language_id,production_date,broadcast_date,is_copyright(boolean),attachment_id