Resource: Episodes

Topics:

Actions

  • - (Object) index(method = GET, url = '/rest/v1/episodes')

Url:

  • [GET] /rest/v1/episodes
  • [GET] /rest/v1/volumes/:id/episodes (episodes linked to a specific volume)
  • [GET] /rest/v1/seasons/:id/episodes (episodes linked to a specific season)
Note:

This action does not require a cookie session. If there is no cookie session then the device id parameter is required.

Note:

The url volumes/:id/episodes and seasons/:id/episodes requires that the volume/season you are requesting episodes for is active, if inactive you will receive a record not found error.

Note:

By default this request will only return episodes with a active value of true, you need to explicitly request inactive episodes in the url to receive them.

Returns all episodes on the service

Arguments:

  • (String) device

    (optional, required if no cookie session) the id of the service device

  • (Any) include_inactive

    (optional) the value of this can be anything, the presence of this param will signal that you wish inactive and active episodes

  • (Date) available

    (optional) displays content which will be playable on a particular date, date should be in ISO8601 format

  • (String) order

    (optional) specify order in which content is asc/desc

  • (Number) limit

    (optional) limit number of results to return

  • (String) sort

    (optional, required when using begin_date or end_date) can be promotion/popularity/available/expires or views, when sorting by available or expires this will result in only records with a value in the requested field being returned, eg, sort=available will only return records with a date in the available field, all other records will not be returned

  • (Date) begin_date

    (optional) is used to allow filtering content on either available or expires fields therefore you must use the sort param with this with a value of available or expires, date should be in ISO8601 format

  • (Date) end_date

    (optional) is used to allow filtering content on either available or expires fields therefore you must use the sort param with this with a value of available or expires, date should be in ISO8601 format

  • (String) sku

    (optional) filter results based on matching sku

Example Request:

Requesting all active episodes on the service
https://service_name.synctv.com/rest/v1/episodes?device=urn:synctv:devices:web:11223344

Requesting all active and inactive episodes on the service
https://service_name.synctv.com/rest/v1/episodes/?device=urn:synctv:devices:web:11223344&include_inactive=true

Example Response:

<scbp>
  <episodes>
    <episode>
      <id>100</id>
      <name>Episode Name Here</name>
      <active>true</active>
      <description>Episode Description</description>
      <number>1</number>
      <sku></sku>
      <advisory>TV-G</advisory>
      <available></available>
      <expires></expires>
      <duration>1327</duration>
      <audio_langs>eng</audio_langs>
      <resume></resume>
      <last_viewed></last_viewed>
      <category>
        <name>Children</name>
      </category>
      <volume>
        <number>1</number>
      </volume>
      <show>
        <name>Adventures of Sonic the Hedgehog</name>
        <target_age_min>8</target_age_min>
        <target_age_max>14</target_age_max>
        <target_gender>male</target_gender>
      </show>
      <channel>
        <name>Zone 11</name>
      </channel>
      <tags>
        <tag>one</tag>
        <tag>three</tag>
        <tag>five</tag>
      </tags>
      <previews>
        <preview>
          <audio_langs>eng</audio_langs>
        </preview>
      </previews>
      <contributors>
        <contributor>
          <name>Some Actor</name>
          <role>Actor</role>
        </contributor>
        <contributor>
          <name>Some Actor 2</name>
          <role>Actor</role>
        </contributor>
      </contributors>
      <images>
        <image>
          <format>show_icon_lg</format>
          <url></url>
        </image>
        <image>
          <format>show_icon_poster</format>
          <url></url>
        </image>
        <image>
          <format>show_icon_poster_sm</format>
          <url></url>
        </image>
      </images>
      <links>
        <metadata>/rest/v1/episodes/100</metadata>
        <formats>/rest/v1/episodes/100/formats</formats>
        <media>/rest/v1/episodes/100/media</media>
        <ad_map>/rest/v1/episodes/100/ad_map</ad_map>
        <manifest>/rest/v1/episodes/100/manifest.m3u8</manifest>
        <smooth_manifest></smooth_manifest>
        <preview_formats></preview_formats>
        <preview_media></preview_media>
        <preview_manifest></preview_manifest>
      </links>
    </episode>
  </episodes>
</scbp>
  • - (Object) show(method = GET, url = '/rest/v1/episodes/:id')

Url:

  • [GET] /rest/v1/episodes/:id
Note:

This action does not require a cookie session. If there is no cookie session then the device id parameter is required.

Note:

This url will not return a episode set to inactive, if you wish to access inactive episodes you will need to use the "/rest/v1/episodes" url with the include_inactive param, please see the documentation for that url for more details.

Returns details of a specific episode

Arguments:

  • (String) device

    (optional, required if no cookie session) the id of the service device

Example Request:

https://service_name.synctv.com/rest/v1/episodes/100?device=urn:synctv:devices:web:11223344

Example Response:

<scbp>
  <episode>
    <id>100</id>
    <name>Episode Name Here</name>
    <active>true</active>
    <description>Episode Description</description>
    <number>1</number>
    <sku></sku>
    <advisory>TV-G</advisory>
    <available></available>
    <expires></expires>
    <duration>1327</duration>
    <audio_langs>eng</audio_langs>
    <resume></resume>
    <last_viewed></last_viewed>
    <category>
      <name>Children</name>
    </category>
    <volume>
      <number>1</number>
    </volume>
    <show>
      <name>Adventures of Sonic the Hedgehog</name>
      <target_age_min>8</target_age_min>
      <target_age_max>14</target_age_max>
      <target_gender>male</target_gender>
    </show>
    <channel>
      <name>Zone 11</name>
    </channel>
    <tags>
      <tag>one</tag>
      <tag>three</tag>
      <tag>five</tag>
    </tags>
    <previews>
      <preview>
        <audio_langs>eng</audio_langs>
      </preview>
    </previews>
    <contributors>
      <contributor>
        <name>Some Actor</name>
        <role>Actor</role>
      </contributor>
      <contributor>
        <name>Some Actor 2</name>
        <role>Actor</role>
      </contributor>
    </contributors>
    <images>
      <image>
        <format>show_icon_lg</format>
        <url></url>
      </image>
      <image>
        <format>show_icon_poster</format>
        <url></url>
      </image>
      <image>
        <format>show_icon_poster_sm</format>
        <url></url>
      </image>
    </images>
    <links>
      <metadata>/rest/v1/episodes/100</metadata>
      <formats>/rest/v1/episodes/100/formats</formats>
      <media>/rest/v1/episodes/100/media</media>
      <ad_map>/rest/v1/episodes/100/ad_map</ad_map>
      <manifest>/rest/v1/episodes/100/manifest.m3u8</manifest>
      <smooth_manifest></smooth_manifest>
      <preview_formats></preview_formats>
      <preview_media></preview_media>
      <preview_manifest></preview_manifest>
    </links>
  </episode>
</scbp>
  • - (Object) update(method = PUT, url = '/rest/v1/episodes/:id')

Url:

  • [PUT] /rest/v1/episodes/:id
Note:

This request requires admin access.

Updates an episode’s metadata

Arguments:

  • (Boolean) episode[active]

    (optional) sets the episode to active or inactive, accepts only "true" or "false"

  • (String) episode[name]

    (optional) sets the episode name

  • (String) episode[description]

    (optional) sets the episode description

  • (String) episode[sku]

    (optional) sets the episode stock keeping unit, accepts any string

  • (String) episode[number]

    (optional) sets the episode episode number, it must be a valid number and can not be the same as any other episode which is linked to the same volume record

  • (String) episode[advisory]

    (optional) sets the episode advisory rating, accepts any string, max of 10 characters

  • (Integer) episode[duration]

    (optional) sets the move length in seconds

  • (Date) episode[available]

    (optional) sets the date which you wish the film to be playable from, if set the backend will prevent media playback until this date is reached, date should be in ISO8601 format or a blank string if you wish to remove the date

  • (Date) episode[expires]

    (optional) sets the date which you wish the film to not be playable after, if set the backend will prevent media playback after this date is reached, date should be in ISO8601 format or a blank string if you wish to remove the date

Example Request:

Request changing an episode name
https://service_name.synctv.com/rest/v1/episodes/100?episode[name]=new_name

Example Response:

<scbp>
  <episode>
    <advisory nil="true"></advisory>
    <description nil="true"></description>
    <duration type="integer">500</duration>
    <active type="boolean">true</active>
    <expires nil="true"></expires>
    <sku nil="true"></sku>
    <available nil="true"></available>
    <name>My Episode (new)</name>
    <id type="integer">270</id>
    <number type="integer">5</number>
  </episode>
</scbp>