Admin APIs
At its core, SyncTV is an API driven service. The APIs themselves are easy enough for developers to understand, but understanding the ecosystem is a little trickier. We've created the following tutorials to help you get your head around it.

Topics:

  • Schedules

This document describes the API for creating, reading, updating and deleting schedules.

Note:
Each call to the SyncTV V2 API described in this section requires an MD5 hash signature.
See the Authorization (User) API for details on generating the MD5 hash signature.
Actions

Url:

  • [GET] /api/v2/schedules.[xml|json]

Returns a list of all schedules.

Required Arguments:
  • (Integer) access_id
    Access id returned from Authorization (User) client_authorize.
  • (String) signature
    MD5 hash encoded string of query parameters.
Example Request

The following request returns a list of all schedules.
[GET] https://service_name.synctv.com/api/v2/schedules.xml?access_id=1234&signature=674aaff974348eb1a1bdd72dce75053d
Request Field:
  • (Integer) offset — Used for pagination of response data (default: 25 items per response). Specifies the offset of the next block of data to receive.
  • (DateTime) start_time_begin — Filters response to include only items with start_time >= specified timestamp (e.g. start_time_begin=2012-02-15T02:06:56Z).
  • (DateTime) start_time_end — Filters response to include only items with start_time <= specified timestamp (e.g. start_time_end=2012-02-15T02:06:56Z).
  • (DateTime) end_time_begin — Filters response to include only items with end_time >= specified timestamp (e.g. end_time_begin=2012-02-15T02:06:56Z).
  • (DateTime) end_time_end — Filters response to include only items with end_time <= specified timestamp (e.g. end_time_end=2012-02-15T02:06:56Z).
  • (String) named_like — Filters response to include items that contain the specified value in the name field (e.g. named_like=lost).
  • (Integer) duration_of — Filters response include items that contain the specified duration.
Example Response
XML JSON

<response>
  <schedules>
    <schedule>
      <id>1</id>
      <media_id>1</media_id>
      <duration>100</duration>
      <start_time nil="true"/>
      <end_time nil="true"/>
      <created_at>2014-05-01T21:29:20Z</created_at>
      <updated_at>2014-05-01T21:29:20Z</updated_at>
      <program_ids/>
    </schedule>
    <schedule>
      <id>2</id>
      <media_id>2</media_id>
      <duration>100</duration>
      <start_time nil="true"/>
      <end_time nil="true"/>
      <created_at>2014-05-01T21:29:20Z</created_at>
      <updated_at>2014-05-01T21:29:20Z</updated_at>
      <program_ids/>
    </schedule>
    <schedule>
      <id>3</id>
      <media_id>3</media_id>
      <duration>100</duration>
      <start_time nil="true"/>
      <end_time nil="true"/>
      <created_at>2014-05-01T21:29:20Z</created_at>
      <updated_at>2014-05-01T21:29:20Z</updated_at>
      <program_ids/>
    </schedule>
  </schedules>
</response>
Response Fields:
  • (Integer) schedule[id]
    The unique identifier of the schedule.
  • (String) schedule[media_id]
    The channel's media_id associated with this schedule.
  • (String) schedule[duration]
    Duration in seconds of how long the program last.
  • (String) schedule[start_time]
    Timestamp of when the program starts.
  • (String) schedule[end_time]
    Timestamp of when the program ends.
  • (String) schedule[created_at]
    Timestamp of when the schedule was created.
  • (String) schedule[updated_at]
    Timestamp of when the schedule was last updated.

Url:

  • [GET] /api/v2/schedules/:id.[xml|json]

Returns the specified schedule.

Required Arguments:
  • (Integer) access_id
    Access id returned from Authorization (User) client_authorize.
  • (String) signature
    MD5 hash encoded string of query parameters.
Example Request

The following example returns the information for schedule 9.
[GET] https://service_name.synctv.com/api/v2/schedules/9.xml?access_id=1234&signature=674aaff974348eb1a1bdd72dce75053d
Request Field:
  • (DateTime) start_time_begin — Filters response to include only items with start_time >= specified timestamp (e.g. start_time_begin=2012-02-15T02:06:56Z).
  • (DateTime) start_time_end — Filters response to include only items with start_time <= specified timestamp (e.g. start_time_end=2012-02-15T02:06:56Z).
  • (DateTime) end_time_begin — Filters response to include only items with end_time >= specified timestamp (e.g. end_time_begin=2012-02-15T02:06:56Z).
  • (DateTime) end_time_end — Filters response to include only items with end_time <= specified timestamp (e.g. end_time_end=2012-02-15T02:06:56Z).
  • (String) named_like — Filters response to include items that contain the specified value in the name field (e.g. named_like=lost).
  • (Integer) duration_of — Filters response include items that contain the specified duration.
Example Response
XML JSON

<response>
  <schedule>
    <id>9</id>
    <media_id>1</media_id>
    <duration>100</duration>
    <start_time nil="true"/>
    <end_time nil="true"/>
    <created_at>2014-05-01T21:29:21Z</created_at>
    <updated_at>2014-05-01T21:29:21Z</updated_at>
    <program_ids/>
  </schedule>
</response>
Response Fields:
  • (Integer) schedule[id]
    The unique identifier of the schedule.
  • (String) schedule[media_id]
    The channel's media_id associated with this schedule.
  • (String) schedule[duration]
    Duration in seconds of how long the program last.
  • (String) schedule[start_time]
    Timestamp of when the program starts.
  • (String) schedule[end_time]
    Timestamp of when the program ends.
  • (String) schedule[created_at]
    Timestamp of when the schedule was created.
  • (String) schedule[updated_at]
    Timestamp of when the schedule was last updated.
  • (Array) schedule[program_ids]
    Listing of programs for this schedule.