Distribute a now-playing track
POST
/events/de.ard.eventhub.v1.radio.track.playingAuthorization
AuthorizationBearer token (JWT) · headerrequiredRequest body
requiredapplication/json
New event to be distributed to subscribers.
The Eventhub format validation expects only a subset of these variables as minimum set. All other fields are technically optional, but **highly encouraged** to be included, so a best-possible metadata exchange is possible.
The subset is defined in the list of required fields of Schemas `eventV1PostBody`, resulting in this body:
```json
{
"type": "music",
"start": "2020-01-19T06:00:00+01:00",
"title": "Song name",
"services": [ { ... } ],
"playlistItemId": "swr3-5678"
}
```
Required fields not specified in the Schema, will cause your request to fail.
The `id` is inserted by Eventhub as string-formatted number, but might be a true string in the future, do not expect this string to remain numbers only!
eventstringIf set, it needs to match the URL event parameter
Allowed:
de.ard.eventhub.v1.radio.track.playingde.ard.eventhub.v1.radio.track.nexttypestringrequiredThe type of the element that triggered this event. See additional file in docs for details.
Allowed:
audiocommercialjinglelivemusicnewstrafficweatherstartstringrequiredISO8601 compliant timestamp
lengthnumberrequiredEstimated length of the element in seconds. Must be set to a positive number (not 0 or null). The end of the current element is defined by the start of the next element.
titlestringrequiredRepresentative title for external use
artiststring | nullPre-formatted artist information
contributorscontributor[] | nullFull details about involved artists if available
Show propertiesHide properties
Array of
contributorcontributorservicesservices[]requiredThe playing stations unique Service-IDs. Do not include the Service-Type suffix.
Show propertiesHide properties
Array of
servicesservicesreferencesreference[] | nullrelated external entities
Show propertiesHide properties
Array of
referencereferenceplaylistItemIdstringrequiredUnique identifier (within a publisher) to connect next and playing items if needed
hfdbIdsstring[] | nullCan reference all available tracks in ARD HFDB instances. Should ideally at least include the common ZSK instance.
externalIdstring | nullCan reference the original ID in the publisher's system
isrcstring | nullAppropriate ISRC code if track is a music element
upcstring | nullCorresponding reference to an album where such ISRC was published
mpnstring | nullIf available the reference to the original delivery from MPN
mediamediaItem[] | nullCan contain an array of media files like cover, artist, etc.
Show propertiesHide properties
Array of
mediaItemmediaItempluginseventPlugin[] | nullHighly optional field for future third-party metadata distribution or other connected services
Show propertiesHide properties
Array of
eventPlugineventPluginidstringID gets inserted by Eventhub as string-formatted number, but might be a true string in the future, do not expect this string to remain numbers only!
Responses
201
Event created
*Note:* The first request of an event for an externalId that is not registered yet, will return the status `failed: 1`. This indicates that a new topic for the externalId has been created, and the request needs to be repeated:
```json
"statuses": {
"published": 0,
"blocked": 0,
"failed": 1
}
```
If the request returns the status `blocked: 1`, it indicates that you are not allowed to publish events under the given publisherId.
statusesobjectrequiredShow propertiesHide properties
publishedintegerrequiredmin -9007199254740991 · max 9007199254740991
blockedintegerrequiredmin -9007199254740991 · max 9007199254740991
failedintegerrequiredmin -9007199254740991 · max 9007199254740991
eventeventV1PostBodyrequiredShow propertiesHide properties
eventV1PostBodytracestring | nullrequireddeprecatedAlways null. Deprecated; may be removed in a future release.
400Bad Request (invalid input)
messagestringrequirederrorsopenApiErrorItem[]requiredmin items 1
Show propertiesHide properties
Array of
openApiErrorItemopenApiErrorItemtracestring | nullrequireddeprecatedAlways null. Deprecated; may be removed in a future release.
401Missing authentication
messagestringrequirederrorsopenApiErrorItem[]requiredmin items 1
Show propertiesHide properties
Array of
openApiErrorItemopenApiErrorItemtracestring | nullrequireddeprecatedAlways null. Deprecated; may be removed in a future release.
403Invalid authorization
messagestringrequirederrorsopenApiErrorItem[]requiredmin items 1
Show propertiesHide properties
Array of
openApiErrorItemopenApiErrorItemtracestring | nullrequireddeprecatedAlways null. Deprecated; may be removed in a future release.
413Payload Too Large (JSON body exceeds 400kb limit)
messagestringrequirederrorsopenApiErrorItem[]requiredShow propertiesHide properties
Array of
openApiErrorItemopenApiErrorItemtracestring | nullrequireddeprecatedAlways null. Deprecated; may be removed in a future release.
500Internal server error
messagestringrequiredtracestring | nullrequireddeprecatedAlways null. Deprecated; may be removed in a future release.
Request
curl -X POST "/events/de.ard.eventhub.v1.radio.track.playing" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"event": "de.ard.eventhub.v1.radio.track.playing",
"type": "music",
"start": "2020-01-19T06:00:00+01:00",
"length": 240,
"title": "Song name",
"artist": "Sam Feldt feat. Someone Else",
"contributors": [
null
],
"services": [
null
],
"references": [
null
],
"playlistItemId": "swr3-5678",
"hfdbIds": [
"swrhfdb1.KONF.12345",
"zskhfdb1.KONF.12345"
],
"externalId": "M012345.001",
"isrc": "DE012345678",
"upc": "string",
"mpn": "string",
"media": [
null
],
"plugins": [
null
],
"id": "1234567890"
}'const response = await fetch("/events/de.ard.eventhub.v1.radio.track.playing", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"event": "de.ard.eventhub.v1.radio.track.playing",
"type": "music",
"start": "2020-01-19T06:00:00+01:00",
"length": 240,
"title": "Song name",
"artist": "Sam Feldt feat. Someone Else",
"contributors": [
null
],
"services": [
null
],
"references": [
null
],
"playlistItemId": "swr3-5678",
"hfdbIds": [
"swrhfdb1.KONF.12345",
"zskhfdb1.KONF.12345"
],
"externalId": "M012345.001",
"isrc": "DE012345678",
"upc": "string",
"mpn": "string",
"media": [
null
],
"plugins": [
null
],
"id": "1234567890"
})
});Response
{
"statuses": {
"published": 1,
"blocked": 0,
"failed": 0
},
"event": null,
"trace": null
}{
"message": "request.body should have required property 'XYZ'",
"errors": [
null
],
"trace": null
}{
"message": "request.headers should have required property 'Authorization'",
"errors": [
null
],
"trace": null
}{
"message": "user is missing required permission",
"errors": [
null
],
"trace": null
}{
"message": "Payload Too Large",
"errors": [
null
],
"trace": null
}{
"message": "Internal Server Error",
"trace": null
}