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

Scheduling

Note: This resource links can be expanded using the expand option, except the metadata link.

A ‘Scheduling’ is a shortcut for ‘Scheduled Title’. In the VoD world, it corresponds to the period where a Title is scheduled in a particular Platform.

A VOD schedule is composed of many schedulings; it is composed of all the list of all the titles that have been scheduled in it (from a put up date to a take down date). In Movida, a scheduling looks like this:

Scheduling

In this case, “Episode 10, One to Go” of series (or title group) “CSI: Crime Scene Investigation. 9” is scheduled in “Platform BeBanjo Movies from Apr 1, 2010 to June 1, 2010”.

This is how this very same Scheduling would look through the API:

<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>
  <scheduling-type>archive</scheduling-type>
  <rights-status>cleared</rights-status>
  <publication-status>valid</publication-status>
  <tags>Drama,Action</tags>
  <external-id>C5080530001</external-id>
  <automatic-asset-selection type="boolean">false</automatic-asset-selection>
  <link href="https://movida.bebanjo.net/api/schedulings/23816" rel="self"/>
  <link href="https://movida.bebanjo.net/api/title_groups/190" rel="title_group"/>
  <link href="https://movida.bebanjo.net/api/titles/613" rel="title"/>
  <link href="https://movida.bebanjo.net/api/assets/1231" rel="asset"/>
  <link href="https://movida.bebanjo.net/api/schedulings/23816/conflicts" rel="conflicts"/>
  <link href="https://movida.bebanjo.net/api/platforms/1" rel="platform"/>
  <link href="https://movida.bebanjo.net/api/schedulings/23816/publications" rel="publications"/>
  <link href="https://movida.bebanjo.net/api/playlists/99" rel="playlist">
  <link href="https://movida.bebanjo.net/api/schedulings/23816/workflow" rel="workflow">
  <link href="https://movida.bebanjo.net/api/schedulings/23816/metadata" rel="metadata">
</scheduling>

Accessing schedulings

Schedulings are accessed via the schedule of a platform, title group or title. Refer to the schedule page to find out how to access the schedule. In additon, they can be accessed from the root of the API.

Get a scheduling by external_id

If you needed to access a scheduling by external_id, you can do so by passing the parameter external_id to the list of schedulings, like this:

$ curl --digest -u robot_user http://movida.bebanjo.net/api/schedulings?external_id=C5147630001

Which would filter by the passed external_id like:

<?xml version="1.0" encoding="UTF-8"?>
<schedulings type="array">
  <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>
    <scheduling-type>archive</scheduling-type>
    <rights-status>cleared</rights-status>
    <publication-status>valid</publication-status>
    <tags>Drama,Action</tags>
    <external-id>C5147630001</external-id>
    <automatic-asset-selection type="boolean">false</automatic-asset-selection>
    <link href="https://movida.bebanjo.net/api/schedulings/23816" rel="self"/>
    <link href="https://movida.bebanjo.net/api/title_groups/190" rel="title_group"/>
    <link href="https://movida.bebanjo.net/api/titles/613" rel="title"/>
    <link href="https://movida.bebanjo.net/api/assets/1231" rel="asset"/>
    <link href="https://movida.bebanjo.net/api/schedulings/23816/conflicts" rel="conflicts"/>
    <link href="https://movida.bebanjo.net/api/platforms/1" rel="platform"/>
    <link href="https://movida.bebanjo.net/api/schedulings/23816/publications" rel="publications"/>
    <link href="https://movida.bebanjo.net/api/schedulings/23816/workflow" rel="workflow">
    <link href="https://movida.bebanjo.net/api/schedulings/23816/metadata" rel="metadata">
  </scheduling>
</schedulings>

Note: You can also search by external_id in platform, title group or title schedule pages.

Valid attributes

Note: These attributes are optional, but the moment you use one of them, the three of them are required.

By default, when accessing a list of schedulings, you will get the whole list. This list could be a massive one, so the following attributes can be used to filter them down:

  • scope: going_online, coming_offline or online.

    • going_online: Will return all the schedulings that are going online within the supplied from and to dates

    • coming_offline: Will return all the schedulings that are coming offline within the supplied from and to dates

    • online: Will return all the schedulings that are online at any time between the supplied from and to dates, even if these were put up before that period or are being taken down after that period.

  • from (date / datetime): If a date is passed, bear in mind it will adjust to midnight that date. Examples would be:

    • 2010-01-01

    • 2010-01-01T00:00:00

    • 2010-01-01T00:00:00Z

  • to (date / datetime) If a date is passed, bear in mind it will adjust to midnight that date. Examples would be:

    • 2010-02-01

    • 2010-02-01T23:59:59

    • 2010-02-01T23:59:59Z

So, to recover all items that are online on a specific platform in a defined period, you would do:

$ curl --digest -u robot_user "https://movida.bebanjo.net/api/platforms/1/schedule/schedulings?scope=online&from=2010-01-01&to=2010-03-01"

If you wanted however, to see what titles are going online in a specific period, you would do:

$ curl --digest -u robot_user "https://movida.bebanjo.net/api/platforms/1/schedule/schedulings?scope=going_online&from=2010-01-01&to=2010-03-01"

And finally, if you wanted to see which titles will be taken down on a specific period, you would do:

$ curl --digest -u robot_user "https://movida.bebanjo.net/api/platforms/1/schedule/schedulings?scope=coming_offline&from=2010-01-01&to=2010-03-01"

Any of these would return the schedulings array for that platform, with the applied filters.

Accessing schedulings directly

If you look carefully at the previous example, you”ll notice each scheduling has a self link, whose url you can use to access it directly:

$ curl --digest -u robot_user "https://movida.bebanjo.net/api/schedulings/23816"
<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>
  <scheduling-type>archive</scheduling-type>
  <rights-status>cleared</rights-status>
  <publication-status>valid</publication-status>
  <tags>Drama,Action</tags>
  <external-id>C5080530001</external-id>
  <automatic-asset-selection type="boolean">false</automatic-asset-selection>
  <link href="https://movida.bebanjo.net/api/schedulings/23816" rel="self"/>
  <link href="https://movida.bebanjo.net/api/title_groups/190" rel="title_group"/>
  <link href="https://movida.bebanjo.net/api/titles/613" rel="title"/>
  <link href="https://movida.bebanjo.net/api/assets/1231" rel="asset"/>
  <link href="https://movida.bebanjo.net/api/schedulings/23816/conflicts" rel="conflicts"/>
  <link href="https://movida.bebanjo.net/api/platforms/1" rel="platform"/>
  <link href="https://movida.bebanjo.net/api/schedulings/23816/publications" rel="publications"/>
  <link href="https://movida.bebanjo.net/api/schedulings/23816/workflow" rel="workflow">
  <link href="https://movida.bebanjo.net/api/schedulings/23816/metadata" rel="metadata">
</scheduling>

Scheduling publications

In case your company is publishing titles to certain platforms using Bebanjo”s Metadata SDK (not to confuse with Metadata product), your schedulings will carry information regarding the publication status, which values can be:

  • invalid: In case the scheduling is not ready to be published in the platform, due to validation errors in its metadata. Trying to publish a scheduling in this status will cause an error as described in Movida-Resource:-Publication

  • calculating: In the odd case that the publication status of the scheduling is being calculated. Publishing is an asynchronous process and this is a transient status.

  • valid: In case the scheduling is ready to be published.

  • queued: The asynchronous job that publishes a Scheduling has been queued for processing; when processed the status will move to either valid (if the publication fails), sent, or published.

  • on_hold: In the case where a Publication for a Scheduling was requested but publication for the Outlet is temporarily disabled. The Scheduling will be automatically published when publication for the Outlet is re-enabled.

  • sent: In the case the final platform is configured to notify back the ingest of the publication, this is the state that will have the scheduling while no notification from the platform has been received.

  • failed: This state shows a problem with the publication in the final platform.

  • published: In the case the scheduling has been successfully published and no changes are pending to be republished. In the case the final platform is configured to notify back the ingest of the publication, this state means that the platform has notified that the publication has been successful.

And link to its publications. Please refer to publication for details:

<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>
  ...
  <publication-status>valid</publication-status>
  ...
  <link href="https://movida.bebanjo.net/api/schedulings/23816/publications" rel="publications"></link>
</scheduling>

Note: When the metadata of a published scheduling changes, the publication status will be one of valid or invalid. This is to indicate that there are changes that haven”t been published. If you need to know if a given scheduling has ever been published, you should check the publications link.

Scheduling workflow

In case your company is using BeBanjo’s Sequence product, in each scheduling you’ll find a link to the workflow of the scheduling:

<scheduling>
  ...
  <link href="https://movida.bebanjo.net/api/schedulings/23816/workflow" rel="workflow">
</scheduling>

Please refer to workflow for more details about that link.

Creating a scheduling

As our introduction to REST APIs page suggests, you can create a scheduling using a POST request to the scheduling link of a title resource:

cat create_scheduling.xml
<scheduling>
   <put-up>2014-06-17T06:00:00Z</put-up>
   <take-down>2015-11-01T06:00:00Z</take-down>
   <external-id>C5080530001</external-id>
   <link href="https://movida.bebanjo.net/api/platforms/1" rel="platform"></link>
</scheduling>

Note: if you are creating the scheduling in an episode, you need to include a link to the title group:

<scheduling>
   <put-up>2014-06-17T06:00:00Z</put-up>
   <take-down>2015-11-01T06:00:00Z</take-down>
   <external-id>C5080530001</external-id>
   <link href="https://movida.bebanjo.net/api/title_groups/3" rel="title_group"></link>
</scheduling>
$ curl --digest -u robot_user:password -H "Content-Type: application/xml" -X POST -d @create_scheduling.xml "https://movida.bebanjo.net/api/titles/1"

As always Movida will return the full XML of the scheduling just created:

<scheduling>
  <id type="integer">23816</id>
  <put-up type="datetime">2014-06-17T06:00:00Z</put-up>
  <take-down type="datetime">2015-11-01T06:00:00Z</take-down>
  <scheduling-type>archive</scheduling-type>
  <rights-status>cleared</rights-status>
  <publication-status>valid</publication-status>
  <tags>Drama,Action</tags>
  <external-id>C5080530001</external-id>
  <automatic-asset-selection type="boolean">false</automatic-asset-selection>
  <link href="https://movida.bebanjo.net/api/schedulings/23816" rel="self"/>
  <link href="https://movida.bebanjo.net/api/titles/1" rel="title"/>
  <link href="https://movida.bebanjo.net/api/assets/1231" rel="asset"/>
  <link href="https://movida.bebanjo.net/api/schedulings/23816/conflicts" rel="conflicts"/>
  <link href="https://movida.bebanjo.net/api/platforms/1" rel="platform"/>
  <link href="https://movida.bebanjo.net/api/schedulings/23816/publications" rel="publications"/>
  <link href="https://movida.bebanjo.net/api/schedulings/23816/workflow" rel="workflow">
  <link href="https://movida.bebanjo.net/api/schedulings/23816/metadata" rel="metadata">
</scheduling>

Updating a scheduling

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

cat scheduling_update.xml
<scheduling>
  <put-up>2014-06-17T06:00:00Z</put-up>
  <take-down>2015-11-01T06:00:00Z</take-down>
  <external-id>C5080530001</external-id>
  <link href="https://movida.bebanjo.net/api/titles/613" rel="title"></link>
  <link href="https://movida.bebanjo.net/api/platforms/1" rel="platform"></link>
</scheduling>
$ curl --digest -u robot_user:password -H "Content-Type: application/xml" -X PUT -d @scheduling_update.xml "https://movida.bebanjo.net/api/scheduling/23816"

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

<scheduling>
  <id type="integer">23816</id>
  <put-up type="datetime">2014-06-17T06:00:00Z</put-up>
  <take-down type="datetime">2015-11-01T06:00:00Z</take-down>
  <scheduling-type>archive</scheduling-type>
  <rights-status>cleared</rights-status>
  <publication-status>valid</publication-status>
  <tags>Drama,Action</tags>
  <external-id>C5080530001</external-id>
  <link href="https://movida.bebanjo.net/api/schedulings/23816" rel="self"/>
  <link href="https://movida.bebanjo.net/api/title_groups/190" rel="title_group"/>
  <link href="https://movida.bebanjo.net/api/titles/613" rel="title"/>
  <link href="https://movida.bebanjo.net/api/assets/1231" rel="asset"/>
  <link href="https://movida.bebanjo.net/api/schedulings/23816/conflicts" rel="conflicts"/>
  <link href="https://movida.bebanjo.net/api/platforms/1" rel="platform"/>
  <link href="https://movida.bebanjo.net/api/schedulings/23816/publications" rel="publications"/>
  <link href="https://movida.bebanjo.net/api/schedulings/23816/workflow" rel="workflow">
  <link href="https://movida.bebanjo.net/api/schedulings/23816/metadata" rel="metadata">
</scheduling>

Note: if external-id is nil, it can be updated.

Updating the asset of a scheduling

The automatic-asset-selection tag in any scheduling indicates whether the asset of the current scheduling is automatically selected (i.e. the linear asset for catch-up schedulings, and the latest asset for archive schedulings), or whether the asset of the current scheduling is locked to one in particular, and won’t be changed automatically.

In order to update the asset of a scheduling, you’ll have to send a PUT request with a payload that includes both the automatic-asset-selection tag set to false and the asset link pointing to the Asset that you want to set. Note that only if the automatic-asset-selection is present in the payload and set to false, the asset will be updated. In any other case, Movida will ignore the contents of the asset link and make no changes.

Deleting a scheduling

The following example shows how to destroy a particular scheduling. Only a DELETE HTTP request to its URL is required:

$ curl -u robot_user:password --digest -H "Content-Type: application/xml" -X DELETE "https://movida.bebanjo.net/api/schedulings/1"

The DELETE request doesn’t return anything, as that target platform is now gone.

When a scheduling is deleted, if it had a workflow associated, this will be also deleted.

Some accounts will show two assets links.

<scheduling>
  <id type="integer">9005222</id>
  <put-up type="datetime">2014-01-20T06:50:00+00:00</put-up>
  <take-down type="datetime">2015-01-20T06:50:00+00:00</take-down>
  ...
  <link rel="self" href="https://movida.bebanjo.net/api/schedulings/900577"/>
  <link rel="asset" href="https://movida.bebanjo.net/api/assets/240571"/>
  <link rel="assets" href="https://movida.bebanjo.net/api/schedulings/900577/assets"/>
  ...
</scheduling>

For historical reasons, the rel="assets" is a deprecated resource that should not be use anymore. If you are new integrator and you only see the rel="asset" you can ignore this. In case you see both links you must use rel="asset".

Last updated May 05th, 2017.