Skip to content

Developers

How can we help you?

← Go back

Publication

A metadata error is the resource that explains why Scheduling’s metadata are not valid to be published.

Metadata errors are only present for schedulings on platforms with publications enabled, in case that they have invalid publication status. Schedulings with valid metadata will have empty array of metadata errors.

A metadata error looks like this:


<?xml version="1.0" encoding="UTF-8"?>
<metadata-error>
  <id type="integer">123456789</id>
  <message>editorial version: attribute Asset Runtime is required</message>
  <link rel="self" href="https://movida.bebanjo.net/api/metadata_errors/123456789"/>
  <link rel="scheduling" href="https://movida.bebanjo.net/api/schedulings/23816"/>
</metadata-error>
{
  "resource_type": "metadata_error",
  "id": 123456789,
  "message": "editorial version: attribute Asset Runtime is required",
  "self_link": "https://movida.bebanjo.net/api/metadata_errors/123456789",
  "scheduling_link": "https://movida.bebanjo.net/api/schedulings/23816"
}

Get a list of all metadata errors of a scheduling

Metadata errors are accessed via the scheduling they are related to, as in the example below, through the link identified by the rel="metadata_errors" attribute:

<?xml version='1.0' encoding='utf-8' ?>
<scheduling>
  <id type='integer'>23816</id>
  <put-up type='datetime'>2010-04-01T00:00:00Z</put-up>
  <take-down type='datetime'>2010-06-01T21:59:59Z</take-down>
  <!-- ... -->
  <link rel="metadata_errors" href="https://movida.bebanjo.net/api/schedulings/23816/metadata_errors"/>
  <!-- ... -->
</scheduling>
{
  "resource_type": "scheduling",
  "id": 23816,
  "put_up": "2010-04-01T00:00:00Z",
  "take_down": "2010-06-01T21:59:59Z",
  // ...
  "metadata_errors_link": "https://movida.bebanjo.net/api/schedulings/23816/metadata_errors",
  // ...
}

If we follow that link, we’ll fetch the list of all the metadata errors of that scheduling.

$ curl --digest -u robot_user:password https://movida.bebanjo.net/api/schedulings/23816/metadata_errors
$ curl --digest -u robot_user:password -H "Accept: application/json" https://movida.bebanjo.net/api/schedulings/23816/metadata_errors
<?xml version="1.0" encoding="UTF-8"?>
<metadata-errors type="array">
  <metadata-error>
    <id type="integer">123456788</id>
    <message>editorial version: attribute Asset Runtime is required</message>
    <link rel="self" href="https://movida.bebanjo.net/api/metadata_errors/123456788"/>
    <link rel="scheduling" href="https://movida.bebanjo.net/api/schedulings/23816"/>
  </metadata-error>
  <metadata-error>
    <id type="integer">123456789</id>
    <message>editorial version: metadata Editorial Version: Rating must be present</message>
    <link rel="self" href="https://movida.bebanjo.net/api/metadata_errors/123456789"/>
    <link rel="scheduling" href="https://movida.bebanjo.net/api/schedulings/23816"/>
  </metadata-error>
</metadata-errors>
{
  "entries": [
    {
      "resource_type": "metadata_error",
      "id": 123456788,
      "message": "editorial version: attribute Asset Runtime is required",
      "self_link": "https://movida.bebanjo.net/api/metadata_errors/123456788",
      "scheduling_link": "https://movida.bebanjo.net/api/schedulings/23816"
    },
    {
      "resource_type": "metadata_error",
      "id": 123456789,
      "message": "editorial version: metadata Editorial Version: Rating must be present",
      "self_link": "https://movida.bebanjo.net/api/metadata_errors/123456789",
      "scheduling_link": "https://movida.bebanjo.net/api/schedulings/23816"
    }
  ]
}

Metadata errors are transient

Unlike other entities in Movida metadata API, metadata errors are very transient in some cases. Both the publication_status and metadata_errors of a scheduling might be changing often, as the metadata get updated. As the publication_status gets recalculated multiple times, metadata_errors can get deleted and created again.

There might even be metadata errors with identical message and different id (in multiple points in time). Your integration needs to be ready to handle these cases.