playlistCreate method

Future<Map<String, dynamic>> playlistCreate(
  1. String playlistId,
  2. Map postBody
)
inherited

playlistCreate -> /v1/playlist/{playlist_id}

Creates a playlist with the specified details underneath the specified playlist or playlist folder. An 400 error will be returned if the specified playlist group is not actually a playlist group (i.e. it is a regular playlist).

PARAMETERS

playlistId (required) : The ID of the playlist, either UUID, name, or index, in order of interpretation and search priority. A path can also be specified to identify playlists within folders. UUID and name matches are searched through the entire playlist tree. Because UUIDs are unique a path is not necessary. A name path is not necessary unless there are multiple playlists with the same name in different folders. A partial path of names can be used as well. Indices only index into the immediate children at each level of the tree so an index path is requred to access playlists within folders if only using indices. A mix of UUIDs, names, and indices can be used for the path if desired.

  • Example (by_uuid): 3C39C433-5C18-4F51-B357-55BB870227C4
  • Example (by_name): Playlist Name
  • Example (by_name_with_path): Folder1/Folder2/Playlist Name
  • Example (by_index): 3
  • Example (by_index_path): 2/0/1
  • Example (by_mixed_path): 3C39C433-5C18-4F51-B357-55BB870227C4/Folder Name/0

postBody (required) : This is the data that must be sent with this request.

Example (playlist):

{
  "name": "Sunday Service",
  "type": "playlist"
}

Example (group):

{
  "name": "Evening Services",
  "type": "group"
}

RESPONSE 200:

The request was processed successfully.

content-type: application/json

schema:

{
  "oneOf": [
    {
      "type": "object",
      "required": [
        "id",
        "type",
        "playlists"
      ]
    },
    {
      "type": "object",
      "required": [
        "id",
        "type"
      ]
    }
  ]
}

RESPONSE 400:

The request was not valid.

content-type: ``

Implementation

Future<Map<String, dynamic>> playlistCreate(String playlistId, Map postBody) async {
  String url = '/v1/playlist/$playlistId';

  return await call('post', url, httpAccept: 'application/json');
}