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

Linear scheduling

Note: that only Movida accounts configured for catch-up will expose linear schedulings in the API.

A linear scheduling is an entry of the schedule of a linear channel. It represents a program broadcasted in a TV network in a specific time slot. The term Program can be used as a synonym of linear scheduling and it will in this documentation.

This is how a linear scheduling looks like in the API:

<?xml version="1.0" encoding="UTF-8"?>
<linear-scheduling>
  <id type="integer">1234</id>
  <begins-at type="datetime">2010-10-30T10:30:00Z</begins-at>
  <ends-at type="datetime">2010-10-30T11:30:00Z</ends-at>
  <external-id>A12345</external-id>  
  <link rel="self" href="https://movida.bebanjo.net/api/linear_schedulings/1234"/>
  <link rel="title" href="https://movida.bebanjo.net/api/titles/123"/>
  <link rel="asset" href="https://movida.bebanjo.net/api/assets/234"/>
  <link rel="linear_channel" href="https://movida.bebanjo.net/api/linear_channels/3"/>
</linear-scheduling>

Get the list of all the linear schedulings of a channel

Linear schedulings are accessed from the linear channel they are related to through the link identified as rel="linear_schedulings":

<?xml version="1.0" encoding="UTF-8"?>
<linear-channel>
  <id type="integer">3</id>
  <name>BBC 1</name>
  <external-id>BBC1</external-id>
  <link rel="self" href="https://movida.bebanjo.net/api/linear_channels/3"/>
  <link rel="linear_schedulings" href="https://movida.bebanjo.net/api/linear_channels/3/linear_schedulings"/>  
</linear-channel>

Following that link, we can fetch the Channel’s linear schedulings.

$ curl --digest -u robot_user:password https://movida.bebanjo.net/api/linear_channels/3/linear_schedulings
<?xml version="1.0" encoding="UTF-8"?>
<linear-schedulings>
  <total-entries>4304</total-entries>
  <link rel="next" href="https://movida.bebanjo.net/api/linear_channels/3/linear_schedulings?page=1"/>
  <link rel="prev" href="https://movida.bebanjo.net/api/linear_channels/3/linear_schedulings?page=3"/>
  <linear-scheduling>
    <id type="integer">1234</id>
    <begins-at type="datetime">2010-10-30T10:30:00Z</begins-at>
    <ends-at type="datetime">2010-10-30T11:30:00Z</ends-at>
    <external-id>BBC123456</external-id>  
    <link rel="self" href="https://movida.bebanjo.net/api/linear_schedulings/1234"/>
    <link rel="title" href="https://movida.bebanjo.net/api/titles/123"/>
    <link rel="asset" href="https://movida.bebanjo.net/api/assets/234"/>
    <link rel="linear_channel" href="https://movida.bebanjo.net/api/linear_channels/3"/>
  </linear-scheduling>
  <linear-scheduling>
    <id type="integer">1235</id>
    <begins-at type="datetime">2010-10-30T11:30:00Z</begins-at>
    <ends-at type="datetime">2010-10-30T12:30:00Z</ends-at>
    <external-id>BBC2222222</external-id>  
    <link rel="self" href="https://movida.bebanjo.net/api/linear_schedulings/1235"/>
    <link rel="title" href="https://movida.bebanjo.net/api/titles/233"/>
    <link rel="asset" href="https://movida.bebanjo.net/api/assets/745"/>
    <link rel="linear_channel" href="https://movida.bebanjo.net/api/linear_channels/3"/>
  </linear-scheduling>
  <!-- ... -->
<linear-schedulings>

The list of linear schedulings of the Channel will be returned sorted by begins-at date.

Note that this is a paginated resource. By default, only 50 linear_schedulings 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.

Valid attributes

You can filter the list of linear schedulings returned using the following attributes:

  • from: It will return only linear schedulings ending after the given date. The value has to be a valid ISO 8601 datetime (e.g. 2010-10-10T10:30:20Z). The Timezone is optional and when omitted the default timezone of the account will be used. The Time is also optional and when omitted 00:00:00 will be used.

  • to: It will return only linear schedulings starting before the given date. The value has to be a valid ISO 8601 datetime (e.g. 2010-10-10T10:30:20Z). The Timezone is optional and when omitted the default timezone of the account will be used. The Time is also optional and when omitted 23:59:59 will be used.

  • external_id: It will return only the linear scheduling with the given External ID (if any).

  • per_page: Number of elements returned in each page. The maximum value allowed is 200 and the default is 50.

The three first attributes can be combined and, when so, only the linear schedulings satisfying all the filters will be returned.

Get a single linear scheduling given its URL

The self link of a linear scheduling contains a URL that will allow us to fetch that individual linear scheduling:

$ curl --digest -u robot_user:password https://movida.bebanjo.net/api/linear_scheduling/1234
<?xml version="1.0" encoding="UTF-8"?>
<linear-scheduling>
  <id type="integer">1234</id>
  <begins-at type="datetime">2010-10-30T10:30:00Z</begins-at>
  <ends-at type="datetime">2010-10-30T11:30:00Z</ends-at>
  <external-id>BBC123456</external-id>  
  <link rel="self" href="https://movida.bebanjo.net/api/linear_schedulings/1234"/>
  <link rel="title" href="https://movida.bebanjo.net/api/titles/123"/>
  <link rel="asset" href="https://movida.bebanjo.net/api/assets/234"/>
  <link rel="linear_channel" href="https://movida.bebanjo.net/api/linear_channels/3"/>
</linear-scheduling>

Create a new linear scheduling for a Channel

To create a linear scheduling, you just need to POST the proper XML representation of a linear scheduling (similar to the ones you get when fetching) to the URL that you can find in the link rel="linear_schedulings" of the linear channel you want to add the linear scheduling to.

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

$ cat payload.xml
<?xml version="1.0" encoding="UTF-8"?>
<linear-scheduling>
  <begins-at type="datetime">2010-10-30T10:30:00Z</begins-at>
  <ends-at type="datetime">2010-10-30T11:30:00Z</ends-at>
  <external-id>BBC123456</external-id>  
  <link rel="title" href="https://movida.bebanjo.net/api/titles/123"/>
  <link rel="asset" href="https://movida.bebanjo.net/api/assets/234"/>
</linear-scheduling>
$ curl --digest -u robot_user:password -H "Content-Type: application/xml" -X POST -d @payload.xml "https://movida.bebanjo.net/api/linear_channels/3/linear_schedulings"

Movida will return the full XML of the linear scheduling just created:

<?xml version="1.0" encoding="UTF-8"?>
<linear-scheduling>
  <id type="integer">1234</id>
  <begins-at type="datetime">2010-10-30T10:30:00Z</begins-at>
  <ends-at type="datetime">2010-10-30T11:30:00Z</ends-at>
  <external-id>BBC123456</external-id>  
  <link rel="self" href="https://movida.bebanjo.net/api/linear_schedulings/1234"/>
  <link rel="title" href="https://movida.bebanjo.net/api/titles/123"/>
  <link rel="asset" href="https://movida.bebanjo.net/api/assets/234"/>
  <link rel="linear_channel" href="https://movida.bebanjo.net/api/linear_channels/3"/>
</linear-scheduling>

Please, see in a section below a few remarks to bear in mind when creating a linear scheduling.

Updating a linear scheduling

You can update an existing linear scheduling sending a PUT request to the URL of the linear scheduling (that you can get from its link rel="self"). You only need to include those attributes of the linear scheduling that you wish to update:

$ cat payload.xml
<?xml version="1.0" encoding="UTF-8"?>
<linear-scheduling>
  <begins-at type="datetime">2010-10-30T11:30:00Z</begins-at>
  <ends-at type="datetime">2010-10-30T12:30:00Z</ends-at>
</linear-scheduling>
$ curl --digest -u robot_user:password -H "Content-Type: application/xml" -X PUT -d @payload.xml "https://movida.bebanjo.net/api/linear_schedulings/1234"

Movida will return the full XML of the linear scheduling just updated:

<?xml version="1.0" encoding="UTF-8"?>
<linear-scheduling>
  <id type="integer">1234</id>
  <begins-at type="datetime">2010-10-30T11:30:00Z</begins-at>
  <ends-at type="datetime">2010-10-30T12:30:00Z</ends-at>
  <external-id>BBC123456</external-id>  
  <link rel="self" href="https://movida.bebanjo.net/api/linear_schedulings/1234"/>
  <link rel="title" href="https://movida.bebanjo.net/api/titles/123"/>
  <link rel="asset" href="https://movida.bebanjo.net/api/assets/234"/>
  <link rel="linear_channel" href="https://movida.bebanjo.net/api/linear_channels/3"/>
</linear-scheduling>

Please, see in a section below a few remarks to bear in mind when updating a linear scheduling.

Deleting a linear scheduling

You can also delete a linear scheduling using a DELETE request to the linear scheduling URL:

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

Please, see in a section below a few remarks to bear in mind when deleting a linear scheduling.

Remarks when creating, updating and deleting a linear scheduling

  • The begins-at and ends-at of a linear scheduling must never overlap with any other existing linear scheduling in the same Channel. When a creation or an update of a linear scheduling would violate this constrain, a validation error will be returned.

  • If the asset link is given when POSTing or PUTing a linear scheduling, then there’s no need to specify the title link as this will be set automatically to the title of the asset.

  • After creating, updating or deleting a linear scheduling, Movida will automatically reapply whatever Catch-up Rights and Rules might affect to the Title of the linear scheduling. That means that the VOD Schedule is always kept consistent with the changes in the Linear Schedule according to the Rights and Rules recorded in the current account.

  • As a consequence of the previous point, deleting a Linear Scheduling will cause any related entry in the VOD Schedules to be deleted too. However, the deletion of any VOD Scheduling (along with its metadata, publications, Sequence workflows, etc.) will only be effective 1 hour after the related Linear Scheduling is deleted. During that time, if a new Linear Scheduling is created for the same title, instead of deleting the VOD Scheduling, Movida will associate it to the new Linear Scheduling.

    This behaviour makes possible to update Linear Schedules by deleting and recreating their entries in a safe manner: Any affected VOD Scheduling and its related data (metadata, Sequence workflows, etc.) won’t be lost as long as the deletion and recreation of each Linear Scheduling occur within 1 hour.

Last updated May 05th, 2017.