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 channel

Note: Only Movida accounts configured for catch-up will expose linear channels in the API.

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 platform). Examples of Linear Channels would be BBC 1, LaSexta or National Geographic.

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>
  <timezone>London</timezone>
  <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>

Valid attributes

  • id (required): Movida internal identifier of the linear channel.

  • external-id (optional): the identifier of the linear channel in the external system. If provided, it has to be unique in the scope of the company.

  • name (required): the name of the linear channel. This name must be unique for your company: so two linear channels cannot have the same name.

  • timezone (optional): the timezone of the linear channel. The linear schedulings of the channel show their datetime attributes begins_at and ends_at using that attribute if present. If not the default timezone of the account will be used

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.bebanjo.net/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 https://movida.bebanjo.net/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>
    <timezone nil="true"/>
    <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>
  <linear-channel>
    <id type="integer">4</id>
    <name>BBC 2</name>
    <external-id>BBC2</external-id>
    <timezone>London</timezone>
    <link rel="self" href="https://movida.bebanjo.net/api/linear_channels/4"/>
    <link rel="linear_schedulings" href="https://movida.bebanjo.net/api/linear_channels/4/linear_schedulings"/>
  </linear-channel>
</linear-channels>

You can also filter the list using the following attribute:

  • external_id: This attribute can be used to store the ID of that specific channel in an external system.
$ curl --digest -u robot_user https://movida.bebanjo.net/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>
    <timezone>London</timezone>
    <link rel="self" href="https://movida.bebanjo.net/api/linear_channels/4"/>
    <link rel="linear_schedulings" href="https://movida.bebanjo.net/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.bebanjo.net/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>
  <timezone nil="true"/>
  <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>

Last updated October 19th, 2018.