Playlists

A playlist consists of a list of movies. Playlists can be organized, and can be asset-based or label-based. Playlists are generally very lightweight and fast.

Each playlist has a unique ID.
Note: Playlist names must also be unique.

Create a Playlist

[POST] /v2/playlists 
{
     "name": "Test Movie Playlist",
     "type": "movie"
} 
   

Replace a Playlist

You can replace an existing playlist with any new content you specify in your API request. Your new playlist maintains the old playlist's playlist_id.
[PUT] /v2/playlists/playlist_id
{
     "name": "new name",
     "type": "movie",
     "items": [
        "M0YWNmODqougN5VrA1FIk02F3CH7Mq_d",
        "81YWNmODqT-3NfNatUGgJq9_XAR6blq8"
     ]
}
   

Modify a Playlist

You can modify the parameters of any playlist.
Note: Modifying a playlist's type deletes all associated items.
[PATCH] /v2/playlists/playlist_id
{
     "name": "new name"
}

Delete a Playlist

[DELETE] /v2/playlists/playlist_id
   

View All Playlists

[GET] /v2/playlists

View a Specific Playlist

[GET] /v2/playlists/playlist_id

Route Attributes

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

Route Attribute Description
playlist_id

The ID of the playlist. To get a list of playlists, perform a GET against the /playlists route.

Type: String

Example: /playlists/86e224258a0441fbb19c8af7f8733d0f

Properties

The following table describes all parameters that can be expressed when accessing the URL of the playlist.

Property Description Required?
created_at

The date when the playlist was created.

Type: String

Example: "2013-01-25T00:14:40Z"

No
items

The contents in the playlist.

Type: Array of Strings

Default: none

Valid values:
  • If the type is movie, a list of the embed codes in this playlist.
  • If the type is label_and or label_or, a list of the label ids in this playlist.

Example:"items": [ "M0YWNmODqougN5VrA1FIk02F3CH7Mq_d", "81YWNmODqT-3NfNatUGgJq9_XAR6blq8" ]

No
limit

Maximum number of items to show when viewing the playlist.

Type: String

Valid values: The maximum valid value is 64.

Example: "10"

No
name

A name for the playlist.

Note: Playlist names must also be unique.

Type: String

Example: "Test Movie Playlist"

No
provider_id

A unique identifier of a content provider.

Type: String

Example: "27645"

No
sort_by

Determines how the playlists are sorted.

Type: String

Default:
  • If the playlist type="movie", the default value is "custom".
  • For all other playlist types, the default value is "date_desc".

Valid values: null | random | date | custom | date_desc | name | name_desc

Note: The custom value is only valid for movie-based playlists.

Example: "random"

No
type

The type of content the playlist contains.

Type: String

Valid values: movie | label_and | label_or

Default: none

Example: "movie"

Yes
updated_at

The date when the playlist was last updated.

Type: String

Example: "2013-01-25T00:14:40Z"

No

Output Values

The following table describes output values that are associated with a playlist.

Value Description
created_at

The date when the playlist was created.

Type: String

Example: "2013-01-25T00:14:40Z"

provider_id

A unique identifier of a content provider.

Type: String

Example: "27645"

updated_at

The date when the playlist was last updated.

Type: String

Example: "2013-01-25T00:14:40Z"

Examples

This example creates a playlist called "Test Movie Playlist".

[POST] /v2/playlists
{
     "name": "Test Movie Playlist",
     "type": "movie"
}
    

Backlot returns a response similar to the following:

{
     "name": "Test Movie Playlist",
     "items": [  ],
     "sort_by": "custom",
     "updated_at": "2013-07-10T18:24:32Z",
     "provider_id": "61670",
     "created_at": "2013-07-10T18:24:32Z",
     "type": "movie",
     "id": "625622dfd22c47e9b7dcd0e8d1843638",
     "limit": null
}
    
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.

This example shows all of your playlists.

[GET] /v2/playlists
          

Backlot returns a response similar to the following:

{
     "items": [   {
        "sort_by": "custom",
        "limit": null,
        "type": "movie",
        "id": "625622dfd22c47e9b7dcd0e8d1843638",
        "created_at": "2013-07-10T18:24:32Z",
        "name": "Modified New Movie Playlist",
        "updated_at": "2013-07-10T18:35:17Z",
        "provider_id": "61670"
     }  ]
}
          
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.

This example retrieves a specific playlist (id=625622dfd22c47e9b7dcd0e8d1843638).

[GET] /v2/playlists/625622dfd22c47e9b7dcd0e8d1843638
          

Backlot returns a response similar to the following:

{
     "sort_by": "custom",
     "limit": null,
     "type": "movie",
     "id": "625622dfd22c47e9b7dcd0e8d1843638",
     "items": [  ],
     "created_at": "2013-07-10T18:24:32Z",
     "name": "Modified New Movie Playlist",
     "updated_at": "2013-07-10T18:35:17Z",
     "provider_id": "61670"
}
          
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.

This example replaces the playlist with the playlist_id of 625622dfd22c47e9b7dcd0e8d1843638 with a new playlist, "New Movie Playlist", which contains two movies.

[PUT] /v2/playlists/625622dfd22c47e9b7dcd0e8d1843638
{
     "name": "New Movie Playlist"
     "type": "movie"
     "items": ["M0YWNmODqougN5VrA1FIk02F3CH7Mq_d", "81YWNmODqT-3NfNatUGgJq9_XAR6blq8"]
}    
          

Backlot returns a response similar to the following:

{
     "name": "New Movie Playlist",
     "items": [  ],
     "sort_by": "custom",
     "updated_at": "2013-07-10T18:30:36Z",
     "provider_id": "61670",
     "created_at": "2013-07-10T18:24:32Z",
     "type": "movie",
     "id": "625622dfd22c47e9b7dcd0e8d1843638",
     "limit": null
}
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.

This example modifies the name of a playlist (id=625622dfd22c47e9b7dcd0e8d1843638).

[PATCH] v2/playlists/625622dfd22c47e9b7dcd0e8d1843638
{
     "name": "Modified New Movie Playlist"
}
          

Backlot returns a response similar to the following:

 {
     "sort_by": "custom",
     "limit": null,
     "type": "movie",
     "id": "625622dfd22c47e9b7dcd0e8d1843638",
     "items": [  ],
     "created_at": "2013-07-10T18:24:32Z",
     "name": "Modified New Movie Playlist",
     "updated_at": "2013-07-10T18:35:17Z",
     "provider_id": "61670"
}
          
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.

This example deletes a playlist (id=625622dfd22c47e9b7dcd0e8d1843638).

[DELETE] /v2/playlists/625622dfd22c47e9b7dcd0e8d1843638
          

Backlot returns a 200 response.

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?