Skip to content

Movida Resource: Linear Channel

Paco Guzmán edited this page Aug 27, 2014 · 17 revisions

Introduction

A Linear Channel is a standard channel on a TV network which displays programming sequentially in a non-interactive fashion (i.e. the customer cannot decide what to see when, as opposed to in a VOD Platform). Examples of Linear Channels would be BBC 1, LaSexta or National Geographic.

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

This is how a Linear Channel looks through the API:

<?xml version="1.0" encoding="UTF-8"?>
<linear-channel>
  <id type="integer">3</id>
  <name>Channel 5</name>
  <external-id>C5</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>

GET a list of all linear channels in the current account

Linear channels are linked from the root of the API, through the link identified with the rel="linear_channels" attribute:

<?xml version="1.0" encoding="UTF-8"?>
<movida>
  <!-- ... -->
  <link rel="linear_channels" href="https://movida.example.com/api/linear_channels">
</movida>

Following that link, we can fetch the list of linear channels in the current account.

$ curl --digest -u robot_user:password http://movida.example.com/api/linear_channels
<?xml version="1.0" encoding="UTF-8"?>
<linear-channels>
  <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>
  <linear-channel>
    <id type="integer">4</id>
    <name>BBC 2</name>
    <external-id>BBC2</external-id>
    <link rel="self" href="https://movida.example.com/api/linear_channels/4"/>
    <link rel="linear_schedulings" href="https://movida.example.com/api/linear_channels/4/linear_schedulings"/>  
  </linear-channel>
</linear-channels>

Accepted Parameters

external_id – You can filter the list of channels by passing in an external_id. This attribute can be used to store the ID of that specific channel in an external system.

$ curl --digest -u robot_user http://movida.example.com/api/linear_channels?external_id=BBC2
<?xml version="1.0" encoding="UTF-8"?>
<linear-channels>
  <linear-channel>
    <id type="integer">4</id>
    <name>BBC 2</name>
    <external-id>BBC2</external-id>
    <link rel="self" href="https://movida.example.com/api/linear_channels/4"/>
    <link rel="linear_schedulings" href="https://movida.example.com/api/linear_channels/4/linear_schedulings"/>  
  </linear-channel>
</linear-channels>

GET a single Linear Channel given its URL

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

$ curl --digest -u robot_user:password https://movida.example.com/api/linear_channels/4
<?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>
Clone this wiki locally