Replacing a Playlist

You can replace an existing playlist with any new content you specify in your API request.

Note: The new playlist maintains playlist_id of the old playlist.

To replace a playlist:

1. Perform a GET on the playlists playlists route to view the existing playlist. The following example retrieves an existing playlist from a given playlist_id (in this example, 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":"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.

2. Use PUT with the playlists route to replace the content in an existing playlist with new information. The following example replaces an existing playlist with new content.

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

Backlot returns a response similar to the following:

{  
   "name":"Super New Movie Playlist",
   "updated_at":"2013-07-11T18:24:32Z",
   "limit":"null", 
   "id":"625622dfd22c47e9b7dcd0e8d1843638",
   "items":[  
      "M0YWNmODqougN5VrA1FIk02F3CH7Mq_d",
      "81YWNmODqT-3NfNatUGgJq9_XAR6blq8"
   ],
   "type":"movie",
   "created_at":"2013-07-10T18:24:32Z",
   "provider_id":"12345",
   "sort_by":"custom"
}
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.

해당 내용이 도움 되었습니까?