Skip to content

Developers

How can we help you?

← Go back

Linear program

Note: Only Mediagenix On-Demand accounts configured for Planning will expose linear categories in the API.

The linear program resource represents a planned program to be emitted in a given channel.

This is how a Linear program looks through the API:

<?xml version="1.0" encoding="UTF-8"?>
<linear-program>
  <id type="integer">756766</id>
  <name>SpongeBob SquarePants: S07, E16: Buried in Time/Enchanted Tiki Dreams</name>
  <nth nil="true"/>
  <program-group-position type="integer">15</program-group-position>
  <start type="datetime">2022-01-31T06:00:00Z</start>
  <end type="datetime">2022-01-31T07:00:00Z</end>
  <notes nil="true"/>
  <marked-as-problem type="boolean">false</marked-as-problem>
  <tags></tags>
  <option-name nil="true"/>
  <detached type="boolean">false</detached>
  <special-case type="boolean">false</special-case>
  <in-bucket type="boolean">false</in-bucket>
  <created-at type="datetime">2021-07-28T10:56:31Z</created-at>
  <updated-at type="datetime">2021-07-28T10:56:31Z</updated-at>
  <link rel="self" href="https://movida.bebanjo.net/api/linear_programs/756766"/>
  <link rel="channel" href="https://movida.bebanjo.net/api/linear_channels/326"/>
  <link rel="program_group" href="https://movida.bebanjo.net/api/linear_program_groups/15141"/>
  <link rel="category" href="https://movida.bebanjo.net/api/linear_categories/69"/>
  <link rel="title" href="https://movida.bebanjo.net/api/titles/1593516"/>
  <link rel="series" href="https://movida.bebanjo.net/api/title_groups/10024850"/>
</linear-program>
{
  "resource_type": "linear_program",
  "id": 756766,
  "name": "SpongeBob SquarePants: S07, E16: Buried in Time/Enchanted Tiki Dreams",
  "nth": null,
  "program_group_position": 15,
  "start": "2022-01-31T06:00:00Z",
  "end": "2022-01-31T07:00:00Z",
  "notes": null,
  "marked_as_problem": false,
  "tags": "",
  "option_name": null,
  "detached": false,
  "special_case": false,
  "in_bucket": false,
  "created_at": "2021-07-28T10:56:31Z",
  "updated_at": "2021-07-28T10:56:31Z",
  "self_link": "https://movida.bebanjo.net/api/linear_programs/756766",
  "channel_link": "https://movida.bebanjo.net/api/linear_channels/326",
  "program_group_link": "https://movida.bebanjo.net/api/linear_program_groups/15141",
  "category_link": "https://movida.bebanjo.net/api/linear_categories/69",
  "title_link": "https://movida.bebanjo.net/api/titles/1593516",
  "series_link": "https://movida.bebanjo.net/api/title_groups/10024850"
}

Valid attributes

  • id (read only): Mediagenix On-Demand internal identifier of the linear program.

  • name (read only): the name of the linear program.

  • nth (read only, optional): define the linear program number in the linear program group sequence specified. The attribute is only present for episodes not linked to the catalogue.

  • program-group-position (read only, optional): define the position of the episode in the associated program group. It goes from 0 to n-1.

  • start (read only): timestamp representing when the linear program starts.

  • end (read only): timestamp representing when the linear program ends.

  • notes (read only, optional): plain text with notes added to the linear program.

  • marked-as-problem (read only): boolean defining if the linear program was marked as a problem.

  • tags (read only, optional): list of tags assigned to the linear program separated by commas.

  • option-name (read only, optional): the option name where the linear program belongs. It belongs to the Main option when it is empty.

  • detached (read only): boolean defining if the linear program is detached from its program group.

  • special-case (read only): boolean defining if the program is an special case from its program group (still attached to the program group, but with different attributes).

  • in-bucket (read only): boolean defining if the program is in the bucket area.

  • created-at (read only): timestamp representing when the linear program was created.

  • updated-at (read only): timestamp representing when the linear program was updated for the last time.

  • channel: The linear channel the linear program belongs to.

  • program_group: The linear program group the linear program belongs to. This link is only present for episodes.

  • category: The linear category the linear program belongs to. This link is optional and it is only present when a category is associated.

  • title: The catalogue title the linear program belongs to. This link is optional.

  • series: The catalogue series the linear program belongs to. This link is optional.

Get a list of all linear programs in a linear channel for a range of dates

Linear programs are linked from a linear channel resource, through the link identified with the rel="linear_programs" attribute:

Note it is mandatory to filter the list of linear programs using the following parameters:

  • from: It will return only linear programs which start 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 timezone of the channel will be used. When the timezone of the channel is missing, the timezone of the account will be used.

  • to: It will return only linear programs which end 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 timezone of the channel will be used. When the timezone of the channel is missing, the timezone of the account will be used. The Time is also optional and when omitted the end time of the later day part or 23:59:59 will be used. If that day part is after midnight the date will be relative to the next day.

The both attributes can be combined and, when so, only the linear programs satisfying all the filters will be returned.

$ curl --digest -u robot_user:password "https://movida.bebanjo.net/api/linear_channels/497/linear_programs?from=2021-01-01&to=2021-01-15"
$ curl --digest -u robot_user:password -H "Content-Type: application/json" -H "Accept: application/json" "https://movida.bebanjo.net/api/linear_channels/326/linear_programs?from=2021-01-01&to=2021-01-15"

And would yield something like:

<?xml version="1.0" encoding="UTF-8"?>
<linear-programs type="array">
  <link rel="next" href="https://movida.bebanjo.net/api/linear_channels/326/linear_programs?after=eyJ2YWx1ZXMiOnsic3RhcnRzX2F0IjoiMjAyMS0wMS0wNVQwOTowMDowMCswMDowMCIsImlkIjoyNTU5NzB9fQ==&amp;from=2021-01-01&amp;to=2021-01-15"/>
  <linear-program>
    <id type="integer">236779</id>
    <name>Ho Ho Ho</name>
    <nth nil="true"/>
    <program-group-position type="integer">8</program-group-position>
    <start type="datetime">2021-01-01T12:00:00Z</start>
    <end type="datetime">2021-01-01T17:00:00Z</end>
    <notes nil="true"/>
    <marked-as-problem type="boolean">false</marked-as-problem>
    <tags></tags>
    <option-name nil="true"/>
    <detached type="boolean">false</detached>
    <special-case type="boolean">false</special-case>
    <in-bucket type="boolean">false</in-bucket>
    <created-at type="datetime">2020-07-28T11:46:05Z</created-at>
    <updated-at type="datetime">2020-07-28T11:46:05Z</updated-at>
    <link rel="self" href="https://movida.bebanjo.net/api/linear_programs/236779"/>
    <link rel="channel" href="https://movida.bebanjo.net/api/linear_channels/326"/>
    <link rel="program_group" href="https://movida.bebanjo.net/api/linear_program_groups/5022"/>
    <link rel="category" href="https://movida.bebanjo.net/api/linear_categories/104"/>
  </linear-program>
  <linear-program>
    <id type="integer">236780</id>
    <name>Ho Ho Ho</name>
    <nth nil="true"/>
    <program-group-position type="integer">9</program-group-position>
    <start type="datetime">2021-01-02T12:00:00Z</start>
    <end type="datetime">2021-01-02T17:00:00Z</end>
    <notes nil="true"/>
    <marked-as-problem type="boolean">false</marked-as-problem>
    <tags></tags>
    <option-name nil="true"/>
    <detached type="boolean">false</detached>
    <special-case type="boolean">false</special-case>
    <in-bucket type="boolean">false</in-bucket>
    <created-at type="datetime">2020-07-28T11:46:05Z</created-at>
    <updated-at type="datetime">2020-07-28T11:46:05Z</updated-at>
    <link rel="self" href="https://movida.bebanjo.net/api/linear_programs/236780"/>
    <link rel="channel" href="https://movida.bebanjo.net/api/linear_channels/326"/>
    <link rel="program_group" href="https://movida.bebanjo.net/api/linear_program_groups/5022"/>
    <link rel="category" href="https://movida.bebanjo.net/api/linear_categories/104"/>
  </linear-program>
  <!-- ... -->
</linear-programs>
{
  "next_link": "https://movida.bebanjo.net/api/linear_channels/326/linear_programs?after=eyJ2YWx1ZXMiOnsic3RhcnRzX2F0IjoiMjAyMS0wMS0wNVQwOTowMDowMCswMDowMCIsImlkIjoyNTU5NzB9fQ==&from=2021-01-01&to=2021-01-15",
  "entries": [
    {
      "resource_type": "linear_program",
      "id": 236779,
      "name": "Ho Ho Ho",
      "nth": null,
      "program_group_position": 8,
      "start": "2021-01-01T12:00:00Z",
      "end": "2021-01-01T17:00:00Z",
      "notes": null,
      "marked_as_problem": false,
      "tags": "",
      "option_name": null,
      "detached": false,
      "special_case": false,
      "in_bucket": false,
      "created_at": "2020-07-28T11:46:05Z",
      "updated_at": "2020-07-28T11:46:05Z",
      "self_link": "https://movida.bebanjo.net/api/linear_programs/236779",
      "channel_link": "https://movida.bebanjo.net/api/linear_channels/326",
      "program_group_link": "https://movida.bebanjo.net/api/linear_program_groups/5022",
      "category_link": "https://movida.bebanjo.net/api/linear_categories/104"
    },
    {
      "resource_type": "linear_program",
      "id": 236780,
      "name": "Ho Ho Ho",
      "nth": null,
      "program_group_position": 9,
      "start": "2021-01-02T12:00:00Z",
      "end": "2021-01-02T17:00:00Z",
      "notes": null,
      "marked_as_problem": false,
      "tags": "",
      "option_name": null,
      "detached": false,
      "special_case": false,
      "in_bucket": false,
      "created_at": "2020-07-28T11:46:05Z",
      "updated_at": "2020-07-28T11:46:05Z",
      "self_link": "https://movida.bebanjo.net/api/linear_programs/236780",
      "channel_link": "https://movida.bebanjo.net/api/linear_channels/326",
      "program_group_link": "https://movida.bebanjo.net/api/linear_program_groups/5022",
      "category_link": "https://movida.bebanjo.net/api/linear_categories/104"
    },
    // ...
  ]
}

Get a list of all linear programs in a linear program group

Linear programs are linked from a linear program group resource, through the link identified with the rel="linear_programs" attribute:

$ curl --digest -u robot_user:password "https://movida.bebanjo.net/api/linear_program_groups/15141/linear_programs?from=2021-01-01&to=2021-01-15"
$ curl --digest -u robot_user:password -H "Content-Type: application/json" -H "Accept: application/json" "https://movida.bebanjo.net/api/linear_program_groups/15141/linear_programs?from=2021-01-01&to=2021-01-15"

And would yield something like:

<?xml version="1.0" encoding="UTF-8"?>
<linear-programs type="array">
  <link rel="next" href="https://movida.bebanjo.net/api/linear_program_group/15141/linear_programs?after=eyJ2YWx1ZXMiOnsic3RhcnRzX2F0IjoiMjAyMS0wMS0wNVQwOTowMDowMCswMDowMCIsImlkIjoyNTU5NzB9fQ==&amp;from=2021-01-01&amp;to=2021-01-15"/>
  <linear-program>
    <id type="integer">756751</id>
    <name>SpongeBob SquarePants: S07, E01: Tentacle-Vision/I Heart Dancing</name>
    <nth nil="true"/>
    <program-group-position type="integer">0</program-group-position>
    <start type="datetime">2022-01-10T06:00:00Z</start>
    <end type="datetime">2022-01-10T07:00:00Z</end>
    <notes nil="true"/>
    <marked-as-problem type="boolean">false</marked-as-problem>
    <tags></tags>
    <option-name nil="true"/>
    <detached type="boolean">false</detached>
    <special-case type="boolean">false</special-case>
    <in-bucket type="boolean">false</in-bucket>
    <created-at type="datetime">2021-07-28T10:56:31Z</created-at>
    <updated-at type="datetime">2021-07-28T10:56:31Z</updated-at>
    <link rel="self" href="https://movida.bebanjo.net/api/linear_programs/756751"/>
    <link rel="channel" href="https://movida.bebanjo.net/api/linear_channels/326"/>
    <link rel="program_group" href="https://movida.bebanjo.net/api/linear_program_groups/15141"/>
    <link rel="category" href="https://movida.bebanjo.net/api/linear_categories/69"/>
    <link rel="title" href="https://movida.bebanjo.net/api/titles/1593522"/>
    <link rel="series" href="https://movida.bebanjo.net/api/title_groups/10024850"/>
  </linear-program>
  <linear-program>
    <id type="integer">756752</id>
    <name>SpongeBob SquarePants: S07, E02: Growth Spout/Stuck in the Wringer</name>
    <nth nil="true"/>
    <program-group-position type="integer">1</program-group-position>
    <start type="datetime">2022-01-11T06:00:00Z</start>
    <end type="datetime">2022-01-11T07:00:00Z</end>
    <notes nil="true"/>
    <marked-as-problem type="boolean">false</marked-as-problem>
    <tags></tags>
    <option-name nil="true"/>
    <detached type="boolean">false</detached>
    <special-case type="boolean">false</special-case>
    <in-bucket type="boolean">false</in-bucket>
    <created-at type="datetime">2021-07-28T10:56:31Z</created-at>
    <updated-at type="datetime">2021-07-28T10:56:31Z</updated-at>
    <link rel="self" href="https://movida.bebanjo.net/api/linear_programs/756752"/>
    <link rel="channel" href="https://movida.bebanjo.net/api/linear_channels/326"/>
    <link rel="program_group" href="https://movida.bebanjo.net/api/linear_program_groups/15141"/>
    <link rel="category" href="https://movida.bebanjo.net/api/linear_categories/69"/>
    <link rel="title" href="https://movida.bebanjo.net/api/titles/1593513"/>
    <link rel="series" href="https://movida.bebanjo.net/api/title_groups/10024850"/>
  </linear-program>
  <!-- ... -->
</linear-programs>
{
  "next_link": "https://movida.bebanjo.net/api/linear_program_group/15141/linear_programs?after=eyJ2YWx1ZXMiOnsic3RhcnRzX2F0IjoiMjAyMS0wMS0wNVQwOTowMDowMCswMDowMCIsImlkIjoyNTU5NzB9fQ==&from=2021-01-01&to=2021-01-15",
  "entries": [
    {
      "resource_type": "linear_program",
      "id": 756751,
      "name": "SpongeBob SquarePants: S07, E01: Tentacle-Vision/I Heart Dancing",
      "nth": null,
      "program_group_position": 0,
      "start": "2022-01-10T06:00:00Z",
      "end": "2022-01-10T07:00:00Z",
      "notes": null,
      "marked_as_problem": false,
      "tags": "",
      "option_name": null,
      "detached": false,
      "special_case": false,
      "in_bucket": false,
      "created_at": "2021-07-28T10:56:31Z",
      "updated_at": "2021-07-28T10:56:31Z",
      "self_link": "https://movida.bebanjo.net/api/linear_programs/756751",
      "channel_link": "https://movida.bebanjo.net/api/linear_channels/326",
      "program_group_link": "https://movida.bebanjo.net/api/linear_program_groups/15141",
      "category_link": "https://movida.bebanjo.net/api/linear_categories/69",
      "title_link": "https://movida.bebanjo.net/api/titles/1593522",
      "series_link": "https://movida.bebanjo.net/api/title_groups/10024850"
    },
    {
      "resource_type": "linear_program",
      "id": 756752,
      "name": "SpongeBob SquarePants: S07, E02: Growth Spout/Stuck in the Wringer",
      "nth": null,
      "program_group_position": 1,
      "start": "2022-01-11T06:00:00Z",
      "end": "2022-01-11T07:00:00Z",
      "notes": null,
      "marked_as_problem": false,
      "tags": "",
      "option_name": null,
      "detached": false,
      "special_case": false,
      "in_bucket": false,
      "created_at": "2021-07-28T10:56:31Z",
      "updated_at": "2021-07-28T10:56:31Z",
      "self_link": "https://movida.bebanjo.net/api/linear_programs/756752",
      "channel_link": "https://movida.bebanjo.net/api/linear_channels/326",
      "program_group_link": "https://movida.bebanjo.net/api/linear_program_groups/15141",
      "category_link": "https://movida.bebanjo.net/api/linear_categories/69",
      "title_link": "https://movida.bebanjo.net/api/titles/1593513",
      "series_link": "https://movida.bebanjo.net/api/title_groups/10024850"
    },
    // ...
  ]
}