We use cookies (just for analytics) on this website. If you continue we will assume you are happy with it. ok

BeBanjo

Back to index

Asset

Note: This resource links can be expanded using the expand option.

The asset resource represents an Editorial Version of a given feature or episode of a series (i.e. with or without violence, with or without ads, etc.), and that Editorial Version can be then held in multiple video renditions (different bit rates, different video formats, etc..)

This is how an asset looks through the API:

<?xml version="1.0" encoding="UTF-8"?>
<asset>
  <name>C5157460053A</name>
  <type nil="true"/>
  <description nil="true"></description>
  <runtime>00:34:20.000</runtime>
  <link rel="self" href="https://movida.bebanjo.net/api/assets/1"/>
  <link rel="metadata" href="https://movida.bebanjo.net/api/assets/1/metadata"/>
  <link rel="title" href="https://movida.bebanjo.net/api/titles/1"/>
  <link rel="renditions" href="https://movida.bebanjo.net/api/assets/1/renditions"/>
  <link rel="segments" href="https://movida.bebanjo.net/api/assets/1/segments"/>
</asset>

Valid attributes

  • id (required): Movida internal identifier of the asset. It mustn’t be supplied in the creation of the asset, because Movida will set this attribute.

  • name (required): the name of the asset. It has to be unique in the scope of the company.

  • type (optional): the asset type. Please, contact your Technical Account Manager in order to define the list of asset types suitable for your company.

  • description (optional): the description of the asset.

  • runtime (optional): the runtime of the asset. Format hh:mm:ss.mmm. The miliseconds are optional, an asset with 01:01:01 is valid, it’s assumed 0 milliseconds.

Get a list of all asset in the current account

Assets are linked from the root of the API, through the link identified with the rel="assets" attribute:

<?xml version="1.0" encoding="UTF-8"?>
<movida>
  <!-- ... -->
  <link rel="assets" href="https://movida.bebanjo.net/api/assets">
</movida>

Following that link, we can fetch the list of assets in the current account.

$ curl --digest -u robot_user:password https://movida.bebanjo.net/api/assets
<?xml version="1.0" encoding="UTF-8"?>
<assets>
  <total-entries>2120</total-entries>
  <link rel="next" href="https://movida.bebanjo.net/api/assets?page=1"/>
  <link rel="prev" href="https://movida.bebanjo.net/api/assets?page=3"/>
  <asset>
    <name>C5157460053A</name>
    <type nil="true"/>
    <description nil="true"></description>
    <runtime>00:34:20.000</runtime>
    <link rel="self" href="https://movida.bebanjo.net/api/assets/1"/>
    <link rel="metadata" href="https://movida.bebanjo.net/api/assets/1/metadata"/>
    <link rel="title" href="https://movida.bebanjo.net/api/titles/1"/>
    <link rel="renditions" href="https://movida.bebanjo.net/api/assets/1/renditions"/>
    <link rel="segments" href="https://movida.bebanjo.net/api/assets/1/segments"/>
  </asset>
  <asset>
    <name>C5157460053B</name>
    <type nil="true"/>
    <description nil="true"></description>
    <runtime>00:35:20.000</runtime>
    <link rel="self" href="https://movida.bebanjo.net/api/assets/2"/>
    <link rel="metadata" href="https://movida.bebanjo.net/api/assets/2/metadata"/>
    <link rel="title" href="https://movida.bebanjo.net/api/titles/1"/>
    <link rel="renditions" href="https://movida.bebanjo.net/api/assets/2/renditions"/>
    <link rel="segments" href="https://movida.bebanjo.net/api/assets/2/segments"/>
  </asset>
  <!-- ... -->
<assets>

Note: This is a paginated resource. By default, only 50 assets will be included in each page but you can override this default by using the per_page parameter described in the next section. The total-entries attribute will indicate the total number of entries and the links rel="next" and rel="prev" should be used to get the next and the previous pages.

You can filter the list of assets returned using the following attributes:

  • name: It will return only the asset with the exact given name (if any).
  • per_page: Number of elements returned in each page. The maximum value allowed is 200 and the default is 50.

Get a list for all assets of a Title

Assets can be accessed via the Title they belong to, as in the example below, through the link identified by the rel="assets" attribute:

<?xml version="1.0" encoding="UTF-8"?>
<title>
  <id type="integer">1</id>
  <title>E01, Episode 1</title>
  <name>Episode 1</name>
  <episode-number type="integer">1</episode-number>
  <external-id>C5155250234</external-id>
  <title-type>episode</title-type>
  <link rel="self" href="https://movida.bebanjo.net/api/titles/30530"/>
  <link rel="schedule" href="https://movida.bebanjo.net/api/titles/30530/schedule"/>
  <link rel="availability_windows" href="https://movida.bebanjo.net/api/titles/30530/availability_windows"/>
  <link rel="series" href="https://movida.bebanjo.net/api/title_groups/3571"/>
  <link rel="licensor" href="https://movida.bebanjo.net/api/licensors/69"/>
  <link rel="images" href="https://movida.bebanjo.net/api/titles/30530/images"/>
  <link rel="assets" href="https://movida.bebanjo.net/api/titles/30530/assets"/>
  <link rel="metadata" href="https://movida.bebanjo.net/api/titles/30530/metadata"/>
</title>

If we follow that link, we can fetch the list of all assets for that title.

$ curl --digest -u robot_user:password https://movida.bebanjo.net/api/titles/30530/assets
<?xml version="1.0" encoding="UTF-8"?>
<assets type="array">
  <asset>
    <name>C5155250234A</name>
    <type nil="true"/>
    <description nil="true"></description>
    <runtime>00:34:20.000</runtime>
    <link rel="self" href="https://movida.bebanjo.net/api/assets/29583"/>
    <link rel="metadata" href="https://movida.bebanjo.net/api/assets/29583/metadata"/>
    <link rel="title" href="https://movida.bebanjo.net/api/titles/30530"/>
    <link rel="renditions" href="https://movida.bebanjo.net/api/assets/29583/renditions"/>
    <link rel="segments" href="https://movida.bebanjo.net/api/assets/29583/segments"/>
  </asset>
</assets>

Get a specific asset

This is a good way to recover information about a specific asset.

$ curl --digest -u robot_user:password https://movida.bebanjo.net/api/assets/29583
<?xml version="1.0" encoding="UTF-8"?>
<asset>
  <name>C5155250234A</name>
  <type nil="true"/>
  <description nil="true"></description>
  <runtime>01:34:00.000</runtime>
  <link rel="self" href="https://movida.bebanjo.net/api/assets/29583"/>
  <link rel="metadata" href="https://movida.bebanjo.net/api/assets/29583/metadata"/>
  <link rel="title" href="https://movida.bebanjo.net/api/titles/30530"/>
  <link rel="renditions" href="https://movida.bebanjo.net/api/assets/29583/renditions"/>
  <link rel="segments" href="https://movida.bebanjo.net/api/assets/29583/segments"/>
</asset>

Creating a new asset for a title

To create an asset, you just need to POST a proper XML asset representation (similar to the ones you get when fetching an asset) to the proper URL. As explained above, that URL is in the link node whose ‘rel’ attribute equals ‘assets’.

For example, this POST would create an asset (we’ll use curl’s @ option, which reads the data that is to be posted to the URL from a file):

cat asset.xml
<?xml version="1.0" encoding="UTF-8"?>
<asset>
  <name>C5151515151</name>
  <description></description>
  <runtime>01:34:00.000</runtime>
</asset>
$ curl --digest -u robot_user:password -H "Content-Type: application/xml" -X POST -d @asset.xml "https://movida.bebanjo.net/api/titles/30530/assets"

Movida will return the full XML of the asset just created:

<?xml version="1.0" encoding="UTF-8"?>
<asset>
  <name>C5151515151</name>
  <type nil="true"/>
  <description nil="true"></description>
  <runtime>01:34:00.000</runtime>
  <link rel="self" href="https://movida.bebanjo.net/api/assets/37366"/>
  <link rel="metadata" href="https://movida.bebanjo.net/api/assets/37366/metadata"/>
  <link rel="title" href="https://movida.bebanjo.net/api/titles/30530"/>
  <link rel="renditions" href="https://movida.bebanjo.net/api/assets/37366/renditions"/>
  <link rel="segments" href="https://movida.bebanjo.net/api/assets/37366/segments"/>
</asset>

Updating an asset

As our introduction to REST APIs guide suggests, you can update an asset using a PUT request to each asset URI. You only need to include those attributes of the asset that you wish to update:

cat asset_update.xml
<asset>
  <type>Asset Type</type>
  <runtime>00:34:00.000</runtime>
  <description>This is the new description</description>
</asset>
$ curl --digest -u robot_user:password -H "Content-Type: application/xml" -X PUT -d @asset_update.xml "https://movida.bebanjo.net/api/assets/37366"

As always Movida will return the full XML of the asset just updated:

<?xml version="1.0" encoding="UTF-8"?>
<asset>
  <name>C5151515151</name>
  <type>Asset Type</type>
  <description>This is the new description</description>
  <runtime>00:34:00.000</runtime>
  <link rel="self" href="https://movida.bebanjo.net/api/assets/37366"/>
  <link rel="metadata" href="https://movida.bebanjo.net/api/assets/37366/metadata"/>
  <link rel="title" href="https://movida.bebanjo.net/api/titles/30530"/>
  <link rel="segments" href="https://movida.bebanjo.net/api/assets/37366/segments"/>
</asset>

Deleting an asset

You can also delete an asset using DELETE request to each asset URI:

$ curl --digest -u robot_user:password -X DELETE "https://movida.bebanjo.net/api/assets/37366"

Deleting an asset will cause any associated segment, rendition, audio track and subtitle to be deleted too. Also, schedulings and linear schedulings associated to the asset will be updated and associated to no asset.

Last updated October 10th, 2017.