MEDIA ASSETS

Media Assets are entities which represent the content required for a VOD Publication, and effectively define the state of the relevant MP4.


Media Asset Object

{
    "id": "1ab537cc-e787-46d9-a221-025a8554c79d",
    "publicationId": "6444cb7c-567a-4d8d-bbcf-a4bec5b197d5",
    "destinationId": "133a6e5c-dfb4-459b-b1ba-0ce99d0c47fc",
    "contentUrl": "https://d13hfsir6wgktj.cloudfront.net/vuworkflow/content/vod/432db26a-1c72-4784-bbb3-9f9d3ea70c71/432db26a-1c72-4784-bbb3-9f9d3ea70c71.mp4",
    "client": "vualto-example",
    "assetState": "Complete",
    "delayedState": null,
    "delayedUntil": null,
    "contentUrlId": "8d504555-544c-28c5-7b51-066e1cbbbcd5",
    "retryCount": 0,
    "dateCreated": "2019-05-20T08:42:22Z",
    "dateUpdated": "2019-05-20T08:43:15Z",
    "dateCompleted": "2019-05-20T08:43:15Z",
    "fileSizeInBytes": 14615254,
    "contentDuration": "00:00:33.7600000"
}

Initially, MediaAssets start with the minimal information, but will be populated as the asset progress through it’s state workflow.


Media Asset States

Any MediaAsset will go through a series of states as it processes. The list of states are:

    PendingCapture    = 0   : This asset is awaiting capture externally.
    Capturing         = 1   : This asset is undergoing capture externally.
    CaptureError      = 2   : This asset has failed to capture externally. This will be retried.
    PendingDownload   = 3   : This asset is pending download.
    Downloading       = 4   : This asset is currently downloading.
    DownloadError     = 5   : This asset has failed to download. This will be retried.
    PendingUpload     = 6   : This asset is pending upload.
    Uploading         = 7   : This asset is currently uploading.
    UploadError       = 8   : This asset has failed to upload. This will be retried.
    Complete          = 9   : This asset has completed the process of uploading to the Target.
    Cancelled         = 10  : This asset is not suitable for the Target therefore was cancelled.
    Delayed           = 11  : This asset is delayed to run at a later time.

Supported Actions

GET /mediaassets/

Get all MediaAssets.

Query Parameters:

  contentUrlFilter: {string} - Optional. Search for MediaAssets for a given contentUrl (or part of).

  contentUrlIdFilter: {guid} - Optional. Search for MediaAssets for a given contentUrlId.

  assetStates: {string} - Optional. Search for MediaAssets whose state are in the given comma separated list of states.

  noCache: {bool} - Optional. Set to true to bypass any existing cache.

Response: 200 OK and a JSON array containing multiple MediaAsset objects.


GET /mediaassets/publication/

Get MediaAsset for the given Publication.

Query Parameters:

  publicationId: {guid} - Required. The PublicationId to search for.

  destinationId: {guid} - Required. The DestinationId to search for.
  
  noCache: {bool} - Optional. Set to true to bypass any existing cache.

Response: 200 OK and a MediaAsset object.


PUT /mediaassets/state

Update the state for a given MediaAsset.

Request Body:

{
  "Id": "c68bec3c-c334-47c1-97a0-6be93c3523fd",
  "AssetState": "PendingDownload",
  "ForceChange": false
}

ForceChange is an optional property and will default to False. Passing True will force the state to change, even if it was in-progress or Cancelled.

Response: 200 OK and a MediaAsset object.


PUT /mediaassets/state/content/

Update the state for all MediaAssets for a given ContentUrlId and existing states.

Request Body:

{
  "contentUrlId": "c68bec3c-c334-47c1-97a0-6be93c3523fe",
  "newState": "PendingDownload",
  "applicableStates": [
    "DownloadError"
  ]
}

You must provide a set of states to change from, else the call could affect too many items.

Response: 200 OK and a JSON array containing multiple MediaAsset objects.


PUT /mediaassets/state/content/validate

Update the state for all MediaAssets for a given ContentUrlId and existing states, performing validation on the file size & length.

Request Body:

{
  "contentUrlId": "c68bec3c-c334-47c1-97a0-6be93c3523fe",
  "newState": "PendingDownload",
  "applicableStates": [
    "DownloadError"
  ],
  "contentLength": "00:12:55",
  "fileSizeInBytes": 1000
}

You must provide a set of states to change from, else the call could affect too many items.

If contentLength or fileSizeInBytes is not provided, then this will not be checked, and may error when attempting Upload.

Response: 200 OK and a JSON array containing multiple MediaAsset objects.


DEL /mediaassets/cache/

Clear the MediaAsset cache.

Response: 200 OK