# Playlists store

API call format

POST /broker/playlists                  //Use token autorization    
POST /broker/private/playlists          //Use Api Key
{
  "color": "string",
  "sources": [
    {
      "ads": [
        {
          "start": 0,
          "guid": "string",
          "substitute": 0
        }
      ],
      "guid": "string",
      "type": "string",
      "substitute": 0
    }
  ],
  "imageUrl": "string",
  "name": "string",
  "description": "string",
  "title": "string"
}

Description

This call creates a new playlist.

Precondition

  • Authorization token/Api key is needed.
  • Mandatory elements (should be specified):
    • "sources:guid" - video source guid <source_guid>.
    • "sources:type" - video source type <source_type>.
    • "name" - name of the playlist <playlist_name>.
    • "sources:ads:guid" - advertisement guid <ads_guid> (only if sources:ads section exists).
    • "sources:ads:type" - advertisement type <ads_type> (only if sources:ads section exists).
  • Not mandatory (optional):
    • "sources:ads" - advertisement section.
    • "sources:substitute" - video source substitute (integer).
    • "color" - color code of playlist <playlist_color>.
    • "description" - description of the playlist <playlist_description>.
    • "title" - title of the playlist <playlist_title>.

Postcondition

  • On success response code should be 200
  • On success message for successful creation in JSON format is returned.
  • On failure an error will be returned with the right error code and description.

Example:

[Request] POST https://<base_api_url>/broker/playlists
[Request] POST https://<base_api_url>/broker/private/playlists
{
  "color": "<playlist_color>",
  "sources": [
    {
      "ads": [
        {
          "start": 0,
          "guid": "<ads_guid>",
          "substitute": 0
        }
      ],
      "guid": "<source_guid>",
      "type": "<source_type>",
      "substitute": 0
    }
  ],
  "imageUrl": "string",
  "name": "<playlist_name>",
  "description": "<playlist_description>",
  "title": "<playlist_title>"
}
[Request Headers] {"Content-Type":"application/json","Accept":"application/json","Authorization":"<IdToken>"} //Use token autorization
[Request Headers] {"Content-Type":"application/json","Accept":"application/json","X-Api-Key":"<api_key>"}     //Use Api Key

[Response] 201
[Response Headers] {"Content-Type":["application/json"],"Content-Length":["..."],"Connection":["keep-alive"],"Date":["..... GMT"],"x-amzn-RequestId":["....."],....]}
[Response] 
{
    "status":true,
    "data":"Item was created successfully"
}