Playlist API
This API provides the ability to create, read, update and delete a users own playlists. The service will auto detect who the user is by reading the access token and sub profile token in the request.
📘 Note
If you want to use the service without sub profiles, simply omit the X-Vimond-Subprofile header in the CURLs below. If no sub profile is set, the API will log all actions with the default sub profile.
Create a playlist
Section titled “Create a playlist”Creates a playlist for the specified user and profile.
curl -X POST \"https://{tenant}.playlist.{domain}\/api/v1/playlists" \-H "accept: application/json" \-H "Authorization: Bearer {JWToken}" \-H "X-Vimond-Subprofile: {subprofileToken}" \-H "Content-Type: application/json" \-d '{ "name": "My Playlist", "assetIds": ["56789", "98765"]}'Responses
Section titled “Responses”| Response Code | Description |
|---|---|
| 201 Created | Playlist created |
| 401 Unauthorized | User was unauthorized |
| 422 Unprocessable Entity | Playlist in body was malformed |
Sample response
Section titled “Sample response”{ "data": [ { "id" : "00000000-0000-0000-0000-000000000000", "name" : "Name of the playlist", "assetIds": ["asset1", "asset2", "and so on"], } ]}Read All Playlists
Section titled “Read All Playlists”Fetches all playlists for the user.
curl -X GET \"https://{tenant}.playlist.{domain}\/api/v1/playlists" \-H "accept: application/json" \-H "Authorization: Bearer {JWToken}" \-H "X-Vimond-Subprofile: {subprofileToken}"Responses
Section titled “Responses”| Response Code | Description |
|---|---|
| 200 Ok | Playlists retrieved successfully |
| 401 Unauthorized | User was unauthorized |
Sample response
Section titled “Sample response”{ "data": [ { "id" : "00000000-0000-0000-0000-000000000000", "name" : "Fabrica de la moneda y timbre : camera recording", "assetIds": ["asset1", "asset2", "and so on"], "uri": "URI of the playlist" } ]}Read One Playlist
Section titled “Read One Playlist”Returns the specified playlist
curl -X GET \"https://{tenant}.playlist.{domain}\/api/v1/playlists/{playlistId}" \-H "accept: application/json" \-H "Authorization: Bearer {JWToken}" \-H "X-Vimond-Subprofile: {subprofileToken}"Responses
Section titled “Responses”| Response Code | Description |
|---|---|
| 201 Ok | Playlist retrieved successfully |
| 401 Unauthorized | User was unauthorized |
| 404 Not Found | Playlist not found |
Sample response
Section titled “Sample response”{ "data": [ { "id" : "00000000-0000-0000-0000-000000000000", "name" : "Name of the playlist", "assetIds": ["asset1", "asset2", "and so on"], "uri": "URI of the playlist" } ]}Read a Playlist by Name
Section titled “Read a Playlist by Name”A single playlist can be fetched by appending /name/<playlist_name> to the above request. The response codes and structure are the same.
curl -X GET \"https://{tenant}.playlist.{domain}\/api/v1/playlists/name/{playlistName}" \-H "accept: application/json" \-H "Authorization: Bearer {JWToken}" \-H "X-Vimond-Subprofile: {subprofileToken}"Update
Section titled “Update”Update Name or Content of Playlist
Section titled “Update Name or Content of Playlist”Sends the updated playlist in the body to update name or list of assets.
curl -X PUT \"https://{tenant}.playlist.{domain}\/api/v1/playlists/{playlistId}" \-H "accept: application/json" \-H "Authorization: Bearer {JWToken}" \-H "X-Vimond-Subprofile: {subprofileToken}" \-H "Content-Type: application/json" \-d '{ "name": "My New Playlist", "assetIds": ["56789", "98765"]}'Responses
Section titled “Responses”| Response Code | Description |
|---|---|
| 200 Ok | Playlist updated successfully |
| 401 Unauthorized | User was unauthorized |
| 404 Not Found | Playlist does not exist |
| 422 Unprocessable Entity | Playlist in body was malformed |
Sample response
Section titled “Sample response”{ "data": [ { "id" : "00000000-0000-0000-0000-000000000000", "name" : "Name of the playlist", "assetIds": ["asset1", "asset2", "and so on"], "uri": "URI of the playlist" } ]}Add Asset to Playlist
Section titled “Add Asset to Playlist”Adds the asset specified in the path to the playlist.
curl -X POST \"https://{tenant}.playlist.{domain}/api/v1\/playlists/{playlistId}/assets/{assetId}" \-H "accept: application/json" \-H "Authorization: Bearer {JWToken}" \-H "X-Vimond-Subprofile: {subprofileToken}"Responses
Section titled “Responses”| Response Code | Description |
|---|---|
| 200 Ok | Asset added |
| 401 Unauthorized | User was unauthorized |
| 404 Not Found | Playlist does not exist |
Sample response
Section titled “Sample response”{ "data": [ { "id" : "00000000-0000-0000-0000-000000000000", "name" : "Name of the playlist", "assetIds": ["asset1", "asset2", "and so on"], "uri": "URI of the playlist" } ]}Remove Asset from Playlist
Section titled “Remove Asset from Playlist”Removes the asset specified in the path from the playlist.
curl -X DELETE \"https://{tenant}.playlist.{domain}/api/v1\/playlists/{playlistId}/assets/{assetId}" \-H "accept: application/json" \-H "Authorization: Bearer {JWToken}" \-H "X-Vimond-Subprofile: {subprofileToken}"Responses
Section titled “Responses”| Response Code | Description |
|---|---|
| 200 Ok | Asset removed |
| 401 Unauthorized | User was unauthorized |
| 404 Not Found | Playlist does not exist |
Sample response
Section titled “Sample response”{ "data": [ { "id" : "00000000-0000-0000-0000-000000000000", "name" : "Name of the playlist", "assetIds": ["asset1", "asset2", "and so on"], "uri": "URI of the playlist" } ]}Delete
Section titled “Delete”Delete All Playlists for User Profile
Section titled “Delete All Playlists for User Profile”curl -X DELETE \"https://{tenant}.playlist.{domain}/api/v1\/playlists" \-H "accept: */*" \-H "Authorization: Bearer {JWToken}" \-H "X-Vimond-Subprofile: {subprofileToken}"Responses
Section titled “Responses”| Response Code | Description |
|---|---|
| 204 No Content | Playlists deleted |
| 401 Unauthorized | User was unauthorized |
Delete One Playlist
Section titled “Delete One Playlist”curl -X DELETE \"https://{tenant}.playlist.{domain}\/api/v1/playlists/{playlistId}" \-H "accept: */*" \-H "Authorization: Bearer {JWToken}" \-H "X-Vimond-Subprofile: {subprofileToken}"Responses
Section titled “Responses”| Response Code | Description |
|---|---|
| 204 No Content | Playlist deleted |
| 401 Unauthorized | User was unauthorized |