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

Metadata

The metadata resource represents all of the text fields associated to a title, title group, asset, brand, scheduling or deal, like synopsis, descriptions, compliance information, etc.

You can access and update the metadata of a title, title group, asset, brand, scheduling, deal, contributor or image just by following the metadata link of each of these resources.

One very important thing to note is that each account in Movida may have a different set of metadata fields. These are defined in a template within each account in Movida, so the output when calling this API may vary depending on the account. In fact, if the template changes, the API will also change automatically. This is very important to note when performing an integration; you should not assume the metadata nodes will always be there or that their name will never change!

An example of a metadata information could look like the following:

<?xml version='1.0' encoding='utf-8' ?>
<metadata type='document'>
  <episode-name>Episode 6</episode-name>
  <episode-number>6</episode-number>
  <episode-sort-name>Episode 6</episode-sort-name>
  <genre>documentary</genre>
  <slot-length>00:58:00</slot-length>
  <running-time>00:45:00</running-time>
  <episode-short-description>Lorem ipsum dolor sit amet</episode-short-description>
  <episode-detail>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</episode-detail>
  <source>File</source>
  <rating>PG</rating>
  <silent type="boolean">true</silent>
  <dvd-release type="datetime">2012-02-12T23:00:00Z</dvd-release>
  <actors type="array">
    <actor>Leonardo Di Caprio</actor>
  </actors>
</metadata>

Updating metadata

When you issue a GET request to a title’s metadata URL (e.g. https://movida.bebanjo.net/api/titles/11824/metadata), you get something like:

<metadata type="document">
 <episode-name>Tuesday 25 May</episode-name>
 <episode-sort-name>Tuesday 25 May</episode-sort-name>
 <episode-number>92</episode-number>
 <genre>entertainment</genre>
 <slot-length>01:00:00</slot-length>
 <running-time>00:45:00</running-time>
 <episode-short-description>Daily chat show with Jenna James.</episode-short-description>
 <episode-detail>Daily chat show with Jenna James.</episode-detail>
</metadata>

All you have to do to update the metadata is to send a similar XML to the same URL via a PUT request. You can send the whole document or part of it. Let’s say that you wanted to change the “episode number” only, then you would issue a PUT request to the same URL with an XML like the following as the body:

<metadata type="document">
 <episode-number>99</episode-number>
</metadata>

Let’s say that you have to update a multi-value metadata field. The process is mostly the same. You would send a PUT request with an XML, but in this case you would include attribute "type=array" in the metadata field. You have to include all values for that field as well, not only those values you want to add. And the order is preserved too:

<metadata type="document">
  <actors type="array">
    <actor>Leonardo Di Caprio</actor>
    <actor>Jed Bartlett</actor>
    <actor>Cedric Yarbrough</actor>
  </actors>
</metadata>

Please note also that multi-value metadata fields will be represented as in the example before: the root node with the "type=array" will be plural (e.g. “actors”), while the inner nodes for each value will be singular (e.g. “actor”). This representation will always be used in GET requests and will always be accepted on PUT requests.

Empty metadata document

Note: Deprecated feature.

The metadata fields that haven’t ever been set won’t be present in the metadata document when you fetch it. For instance, the metadata of title just created will look like this:

<metadata type="document"></metadata>

As the values of the different fields are set, either from the UI or from the API, the API will show the fields when fetching the metadata resource.

Please note that this behaviour is deprecated, and you shouldn’t rely on it in your integration. In the future, all the fields will always be present and they’ll be empty when no value will be assigned. For example:

<metadata type='document'>
  <episode-name nil="true"></episode-name>
  <episode-number nil="true"></episode-number>
  <episode-sort-name nil="true"></episode-sort-name>
  <genre nil="true"></genre>
  <slot-length nil="true"></slot-length>
  <running-time nil="true"></running-time>
  <episode-short-description nil="true"></episode-short-description>
  <episode-detail nil="true"></episode-detail>
  <source nil="true"></source>
  <rating nil="true"></rating>
  <silent type="boolean" nil="true"></silent>
  <dvd-release type="datetime" nil="true"></dvd-release>
  <actors type="array"></actors>
</metadata>

Last updated March 31st, 2017.