Skip to content

Movida Resource: Linear Scheduling

Luismi Cavalle edited this page Nov 7, 2013 · 16 revisions

Introduction

A Linear Scheduling is an entry of the schedule of a Linear Channel. It represent a program broadcasted in a TV network in a specific time slot. The term Program will be used as a synonym of Linear Scheduling in this documentation.

Note that only Movida accounts configured for catch-up will expose Linear Schedulings in the API.

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.example.com/api/linear_schedulings/1234"/>
  <link rel="title" href="https://movida.example.com/api/titles/123"/>
  <link rel="asset" href="https://movida.example.com/api/assets/234"/>
  <link rel="linear_channel" href="https://movida.example.com/api/linear_channels/3"/>
</linear-scheduling>

GET a list of all the linear schedulings of a channel

Linear channels 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.example.com/api/linear_channels/3"/>
  <link rel="linear_schedulings" href="https://movida.example.com/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.example.com/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?after=1260"/>
  <link rel="prev" href="https://movida.bebanjo.net/api/linear_channels/3/linear_schedulings?before=1234"/>
  <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.example.com/api/linear_schedulings/1234"/>
    <link rel="title" href="https://movida.example.com/api/titles/123"/>
    <link rel="asset" href="https://movida.example.com/api/assets/234"/>
    <link rel="linear_channel" href="https://movida.example.com/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.example.com/api/linear_schedulings/1235"/>
    <link rel="title" href="https://movida.example.com/api/titles/233"/>
    <link rel="asset" href="https://movida.example.com/api/assets/745"/>
    <link rel="linear_channel" href="https://movida.example.com/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. Only 50 linear_schedulings will be shown in each page. 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.

Accepted Parameters

You can filter the list of Linear Schedulings returned using the following parameters:

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).

These three parameters 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.example.com/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.example.com/api/linear_schedulings/1234"/>
  <link rel="title" href="https://movida.example.com/api/titles/123"/>
  <link rel="asset" href="https://movida.example.com/api/assets/234"/>
  <link rel="linear_channel" href="https://movida.example.com/api/linear_channels/3"/>
</linear-scheduling>
Clone this wiki locally