Using playlists

Playlists are collection of videos.
It allows you to get all video data with a unique call.
Children data are always up to date : when you update a video, you needn't update the playlist.

Creating a Playlist

Add a new playlist
On POST (or PUT) you set the videoId, like a foreign key in a relational db

curl -X PUT\
     '<<SBX_SERVER>>/playlists' \
     -H 'accept: application/json' \
     -H 'x-api-key: <<SBX_DEMO_KEY>>' \
     -d '{
  "name": "My playlist",
  "description": "Some description",
  "children": [
    "dVVJMHRsaHkxcXhOR0UwSw=="
  ]
}'

Getting a Playlist

Get a single playlist
On GET you will have the entire video (children) datas

curl -X GET\
     '<<SBX_SERVER>>/playlists/{id}' \
     -H 'accept: application/json' \
     -H 'x-api-key: <<SBX_DEMO_KEY>>'

Sample response :

{
  "listId": "ABlRLUdn668AYmuU",
  "ctime": 1699001629,
  "mtime": 1699287531,
  "name": "My playlist",
  "description": "Some description",
  "children": [
    {
      "id": "dVVJMHRsaHkxcXhOR0UwSw==",
      "title": "Video title",
      "description": "Video description",
      "tags": [
        "myvideotag"
      ],
      "duration": 2,
      "status": "AVAILABLE",
      "ctime": 1699287511,
      "mtime": 1699287016,
      "assets": {
        "thumbnail": "https://.../image/v1/mediadb-product-filetype-dev/1011205/COVER.jpg",
        "player": "https://.../dVVJMHRsaHkxcXhOR0UwSw==/player",
        "stream": "https://.../dVVJMHRsaHkxcXhOR0UwSw==/stream",
        "iframe": "<iframe width=\"100%\" height=\"100%\" frameborder=\"0\" style=\"border: 0\"\n src=\"//.../dVVJMHRsaHkxcXhOR0UwSw==/player\" allow=\"encrypted-media\" allowfullscreen></iframe>"
      },
      "public": true,
      "links":[]
    }
  ]
}