Track Segments

A track segment is defined as an instance of a Virtual Asset at a scheduled start/end time within a track.

Each track segment is assigned a unique identifier across all track segments in the schedule (not just within a track). Track segments in the same track cannot overlap in time, but track segments in different tracks can. Track segments have the following structure.
Note: The external_id and override_stream_asset_id properties are optional.
{
   "id": "4fc59badbf9a4f26be1df179082c5459",
   "track_id": "4fcb0f981d70459a9693472d6d05d7b7",
   "start_time": "2013-08-13T11:42:14Z",
   "end_time": "2013-05-13T13:49:14Z",
   "status": "online",
   "virtual_asset_id": "9a6519637be3446e920228c36da18315",
   "external_id": "PAC12_447355812",
   "override_stream_asset_id": "0yMTVoMzpqSB_nCyAJwvaAXSePizm6I3"
}

Create a track segment

[POST]/v2/track_segments{
   properties
}

View all track segments

[GET]/v2/track_segments

View one track segment

Users can use either the public ID generated by Ooyala or use the external ID to query for track segments.
[GET]/v2/track_segments/track_segment_id

Include virtual asset information

You can also retrieve virtual asset information, instead of just the virtual asset id, by specifying the query string parameter include=virtual_asset.
[GET]/v2/track_segments?include=virtual_asset

Batch time-window access to track segments

To enable the rendering views of "What's on today" in the style of a schedule, track segments can be accessed in batch for a given time window (e.g. "what are all the track segements that start on Wednesday"). The following query returns all track segments for the 15th of August, 2013.

  • You can specify one or both of from_time and to_time.
  • Values of these parameters must be URI-encoded.
  • The query returns all track segments between from_time and to_time.
[GET]/v2/track_segments?from_time=2013-08-13-00:00:00Z&to_time=2013-08-14-00:00:00Z

Delete a track segment

[DELETE]/v2/track_segments/track_segment_id

Modify a track segment

[PATCH]/v2/track_segments/track_segment_id
 {
 "start_time": "2012-08-13T11:30:00Z"
 }

Route Attributes

The following table describes all attributes that can be expressed through the route.

Route Attribute Description
track_segment_id

The ID of the track. To get a list of tracks, perform a get against the /tracks route.

Type: String

Default: None

Example: 4fc59badbf9a4f26be1df179082c5459

Query String Parameters

The following table describes all parameters that can be expressed through the query string.

Parameter Description Required?
from_time

Start of time period

Type: DateTime

Example: [GET] /v2/track_segments?from_time=2013-08-13-00:00:00Z

No
include=object To include any of the following:
  • virtual_asset
  • virtual_asset.metadata
  • virtual_asset.track_segment_instances
  • virtual_asset.asset_instances

Type: String

Example: [GET] /v2/track_segments?include=virtual_asset

No
to_time

End of time period

Type: String

Example: [GET] /v2/track_segments?to_time=2013-08-14-00:00:00Z

No

Properties

The following table describes all properties that can be associated with a track.

Property Description Required?
end_time

Ending time of track segment

Type: date/time in ISO-8601 Coordinated Universal Time (UTC) format

Example: "2013-08-13T13:30:00Z"

Yes
external_id Identifier for use with external systems

Type: String

Example: "PAC12_447355812"

No
override_stream_asset_id

Identifier of an asset that overrides any asset associated with the track of which this segment is a part.

Type: String

Example: "hvZGZmMzqaWtUHDm4RGuY9O8xsYzGV3x"

No
start_time

Starting time of track segment

Type: date/time in ISO-8601 Coordinated Universal Time (UTC) format

Example: "2013-08-13T11:00:00Z"

Yes
status

Status of the segment

Valid Values: online | offline

Type: String

Example: "online"

Yes
track_segment_id

Identifier of track segment

Type: String

Example: "8ffbfcda77fb40b0af6425ae24752254"

Yes
virtual_asset_id

Identifier of the virtual assets associated with the track segment.

Type: String

Example: "9a6519637be3446e920228c36da18315"

Yes

Examples

This example creates a track segment. The override_stream_asset_id property is optional.

[POST]/v2/track_segments{  
   "track_id":"8ffbfcda77fb40b0af6425ae24752254",
   "start_time":"2013-08-13T11:00:00Z",
   "end_time":"2013-08-13T13:30:00Z",
   "status":"online",
   "virtual_asset_id":"9a6519637be3446e920228c36da18315",
   "override_stream_asset_id”:"hvZGZmMzqaWtUHDm4RGuY9O8xsYzGV3x"
}

Backlot returns a response similar to the following:

{
   "end_time": "2013-08-13T13:30:00Z",
   "broadcast_status": "",
   "created_at": "2013-01-28T21:01:57Z",
   "track_id": "8ffbfcda77fb40b0af6425ae24752254",
   "id": "ecb02d1014bb46fdbcb55cfa87d2c860",
   "updated_at": "2013-01-28T21:01:57Z",
   "virtual_asset_id": "9a6519637be3446e920228c36da18315",
   "status": "online",
   "external_id": "",
   "start_time": "2013-08-13T11:00:00Z"
}
Note:

Try out the code samples using your account credentials in the Ooyala Scratchpad. For information about using the Scratchpad, see Practice Making Requests with the Scratchpad. To launch the scratchpad, go to Ooyala API Scratchpad.

Was this article helpful?