Content Automation API
Welcome to Global Conductor Content Automation API. This API provides access to PlayNetwork’s audio assets, including upload, retrieval, transcoding, and basic search.
Application Version ¶
Get the current version of the API
Asset API ¶
Provides access to upload, retrieve, and transcode an asset
Resource ¶
POST/v0/assets
Upload an audio file to Content Automation.
Example URI
Headers
Content-Type: multipart/form-data; boundary=---BOUNDARY
x-client-id: 216c2f3cf288432eb75cbea1431f5axx
x-authentication-token: eb0fc26ad7484c2db34d0cbba7ac1f8e
assetType: audio/x-flac
assetLength: 19782435
legacyTrackToken: 370456Body
---BOUNDARY
Content-Disposition: form-data; name="assetfile"; filename="370456.flac"
Content-Type: audio/x-flac
Content-Transfer-Encoding: binary
$binarydata
---BOUNDARY201Headers
Content-Type: application/jsonBody
{
"assetType": "audio/x-flac",
"originalAssetId": "0001fcbe1459a8e2db2b04fa8a22a74fbefccea5374ca1709e39857502493e3c",
"bitrate": 846000,
"channels": 2,
"duration": 187000,
"lufs": -9,
"deleted": false,
"modified": "2014-10-02T20:16:42.079Z",
"created": "2014-10-02T20:16:42.079Z"
}Resource ¶
GET/v0/assets/{assetId}{?bitrate,channels,format,exact}
Retrieve an asset by its original asset id.
If bitrate/channels/format are included, Content API will transcode and return an asset in the quality specified.
When the quality of an original asset is not enough to be further transcoded, Content API by default will return an asset with an asset with the closest quality
All bitrate, channels, format must be all provided for Content API to transcode an asset.
Example URI
- assetId
string(required)the original asset id of the asset
- bitrate
number(optional)retrieve an asset in the bitrate specified; supported values: 64000, 80000, 96000, 128000, 160000, 256000, and 320000
- channels
number(optional)- format
string(optional)retrieve an asset in the format specified. Followings are the supported formats: flac, mp3, ogg, and wav
- exact
boolean(optional)default to false. set to true to enforce Content API to generate and return an asset to match the exact bitrate, channels, and format specified in the request. When set to true, and the quality of the original asset is not high enough to support requested bitrate/channels/format, a LowQualityError will be returned.
Headers
x-client-id: 216c2f3cf288432eb75cbea1431f5axx
x-authentication-token: eb0fc26ad7484c2db34d0cbba7ac1f8e302Headers
Content-Type: application/jsonBody
{
"name": "ModelNotReadyError",
"message": "asset {id} in requested format is not ready",
"statusCode": 409
}404Headers
Content-Type: application/jsonBody
{
"name": "ModelNotFoundError",
"message": "Original asset not found ({asset id})"
}409Headers
Content-Type: application/jsonBody
{
"name": "LowQualityError",
"message": "Quality for asset {id} is too low",
"statusCode": 409
}409Headers
Content-Type: application/jsonBody
{
"name": "ModelInvalidError",
"message": "unable to sign a url for asset {id}",
"statusCode": 409
}Legacy Track Support API ¶
Provides access to retrieve assets and asset information through legacy track tokens
Resource ¶
GET/v0/legacy/tracks/{trackToken}{?bitrate,channels,format}
To retrieve an asset by its legacy track token
Example URI
- trackToken
string(required)the legacy track token of an asset
- bitrate
number(optional)retrieve an asset in the bitrate specified; supported values: 64000, 80000, 96000, 128000, 160000, 256000, and 320000
- channels
number(optional)- format
string(optional)retrieve an asset in the format specified. Followings are the supported formats: flac, mp3, ogg, and wav
Headers
x-client-id: 216c2f3cf288432eb75cbea1431f5axx
x-authentication-token: eb0fc26ad7484c2db34d0cbba7ac1f8e302Headers
Content-Type: application/jsonBody
{
"name": "ModelNotReadyError",
"message": "asset {id} in requested format is not ready",
"statusCode": 409
}404Headers
Content-Type: application/jsonBody
{
"name": "ModelNotFoundError",
"message": "Original asset not found ({asset id})"
}409Headers
Content-Type: application/jsonBody
{
"name": "ModelInvalidError",
"message": "Unable to sign a url for asset {id}",
"statusCode": 409
}Resource ¶
GET/v0/legacy/tracks/{trackToken}/originalAssets
To retrieve an asset’s meta data by its legacy track token
Example URI
- trackToken
string(required)the legacy track token
Headers
x-client-id: 216c2f3cf288432eb75cbea1431f5axx
x-authentication-token: eb0fc26ad7484c2db34d0cbba7ac1f8e200Headers
Content-Type: application/jsonBody
{
"assetType": "audio/x-flac",
"originalAssetId": "0001fcbe1459a8e2db2b04fa8a22a74fbefccea5374ca1709e39857502493e3c",
"bitrate": 846000,
"channels": 2,
"duration": 187000,
"lufs": -9,
"deleted": false,
"modified": "2014-10-02T20:16:42.079Z",
"created": "2014-10-02T20:16:42.079Z"
}Resource ¶
HEAD/v0/legacy/tracks/{trackToken}
To quickly find out if Content API has an asset in its catalog by the asset’s legacy track token
Example URI
- trackToken
string(required)the legacy track token
Headers
x-client-id: 216c2f3cf288432eb75cbea1431f5axx
x-authentication-token: eb0fc26ad7484c2db34d0cbba7ac1f8e200404409Headers
Content-Type: application/jsonResource ¶
POST/v0/legacy/tracks/{trackToken}/originalAssets
To create a mapping between a legacy track token and one or more original assets
Example URI
- trackToken
string(required)the legacy track token
Headers
x-client-id: 216c2f3cf288432eb75cbea1431f5axx
x-authentication-token: eb0fc26ad7484c2db34d0cbba7ac1f8eBody
[
"0001fcbe1459a8e2db2b04fa8a22a74fbefccea5374ca1709e39857502493e3c",
"2493e3c0db2b04fa8a22a7001fcbe1459a4ca1709e398e24fbefccea53785750"
]201Headers
Content-Type: application/jsonBody
[
{
"originalAssetId": "0001fcbe1459a8e2db2b04fa8a22a74fbefccea5374ca1709e39857502493e3c",
"legacyTrackToken": "1153552"
},
{
"originalAssetId": "2493e3c0db2b04fa8a22a7001fcbe1459a4ca1709e398e24fbefccea53785750",
"legacyTrackToken": "1153552"
}
]Legacy Asset Support API ¶
Similar to Legacy Track Support API, this API provides resources to create, update, verify, and sign the CDN URL of a legacy asset by a legacy track token. The source of all legacy assets is from the Cache folder on Playnetwork’s media server (aka “Skynyrd”).
Resource ¶
GET/v0/legacy/assets{?filters,count,start}
To retrieve a list of legacy assets with pagination
Example URI
- filters
string(optional)apply search conditions to filter returned recordset. Please refer to Mongoose-Middleware for further detail
- count
number(optional)number of legacy assets to retrieve. default and maximum to 100
- start
number(optional)the starting index of the legacy assets in the database, default is 0
Headers
x-client-id: 216c2f3cf288432eb75cbea1431f5axx
x-authentication-token: eb0fc26ad7484c2db34d0cbba7ac1f8e200Headers
Content-Type: application/jsonBody
{
"options": {
"count": 2,
"filters": {},
"sort": {},
"start": 0
},
"results": [
{
"legacyTrackToken": "1032904",
"originalFileName": "1032904.wav",
"legacyAssetId": "0002b8c48609bb965a85de217d788b2a2ec8dd945746e74966062646936a001c"
},
{
"legacyTrackToken": "1032902",
"originalFileName": "1032902.wav",
"legacyAssetId": "e3c69a2a0fb2f3dd20199c5fa66c3e192e85bf5da2f61894d5fcf7e5c2ff58ba"
}
],
"total": 11
}Resource ¶
GET/v0/legacy/assets/{compositeKey}
To sign a CDN URL for a legacy asset by its legacyTrackToken
Example URI
- compositeKey
string(required)A composite key representing a key-value pair separated by a colon
:. For example, to retrieve a legacy asset by its track token, use trackToken:{value}
Headers
x-client-id: 216c2f3cf288432eb75cbea1431f5axx
x-authentication-token: eb0fc26ad7484c2db34d0cbba7ac1f8e302Headers
Content-Type: text/htmlBody
Moved Temporarily404Headers
Content-Type: application/jsonBody
{
"name": "ModelNotFoundError",
"message": "legacy asset {track token} was not found",
"statusCode": 404
}409Headers
Content-Type: application/jsonBody
{
"name": "ModelInvalidError",
"message": "unable to sign a url for asset {id}",
"statusCode": 409
}Resource ¶
HEAD/v0/legacy/assets/{compositeKey}
To check the existence of a legacy asset. If so, obtain its legacyAssetId, which is a SHA256 string of the actual bits of the asset
Example URI
- compositeKey
string(required)A composite key representing a key-value pair separated by a colon
:. For example, to retrieve a legacy asset by its track token, use trackToken:{value}
Headers
x-client-id: 216c2f3cf288432eb75cbea1431f5axx
x-authentication-token: eb0fc26ad7484c2db34d0cbba7ac1f8e404200Headers
x-legacy-asset-id: 0002b8c48609bb965a85de217d788b2a2ec8dd945746e74966062646936a001cResource ¶
POST/v0/legacy/assets
To create a legacy asset, which contains following properties:
-
legacyTrackToken (required, string) … the legacy track token of the legacy assetId
-
originalFileName (optional, string) … the original file name of the track
-
legacyAssetId (optional, string) … the SHA256 of the track file
Example URI
Headers
Content-Type: application/json
x-client-id: 216c2f3cf288432eb75cbea1431f5axx
x-authentication-token: eb0fc26ad7484c2db34d0cbba7ac1f8eBody
{
"originalFileName": "1032920.wav"
}404Headers
Content-Type: application/jsonBody
{
"statusCode": 409,
"name": "ArgumentNullOrEmptyError",
"message": "legacyTrackToken cannot be null or empty"
}Headers
Content-Type: application/json
x-client-id: 216c2f3cf288432eb75cbea1431f5axx
x-authentication-token: eb0fc26ad7484c2db34d0cbba7ac1f8eBody
{
"legacyTrackToken": "1032920",
"originalFileName": "1032920.wav"
}201Headers
Content-Type: application/jsonBody
{
"legacyTrackToken": "1032920",
"legacyAssetId": null,
"originalFileName": "1032920.wav"
}Resource ¶
PUT/v0/legacy/assets/{compositeKey}
To modify an existing legacy asset
Example URI
- compositeKey
string(required)A composite key representing a key-value pair separated by a colon
:. For example, to retrieve a legacy asset by its track token, use trackToken:{value}
Headers
Content-Type: application/json
x-client-id: 216c2f3cf288432eb75cbea1431f5axx
x-authentication-token: eb0fc26ad7484c2db34d0cbba7ac1f8e404Headers
Content-Type: application/jsonBody
{
"statusCode": 409,
"name": "ArgumentNullOrEmptyError",
"message": "legacyTrackToken cannot be null or empty",
"sentryId": "7a69ad74624f4202b2ea9bbfafebd9e1"
}Headers
Content-Type: application/json
x-client-id: 216c2f3cf288432eb75cbea1431f5axx
x-authentication-token: eb0fc26ad7484c2db34d0cbba7ac1f8eBody
{
"legacyAssetId": "0001fcbe1459a8e2db2b04fa8a22a74fbefccea5374ca1709e39857502493e3c",
"originalFileName": "1032920.ogg"
}202Headers
Content-Type: application/jsonBody
{
"legacyTrackToken": "1032920",
"legacyAssetId": "0001fcbe1459a8e2db2b04fa8a22a74fbefccea5374ca1709e39857502493e3c",
"originalFileName": "1032920.ogg"
}