Note: Sonos does not currently support this command. Keep an eye on the blog for details.
The getPlaylist
command in the playlists
namespace retrieves the track information associated with a particular playlist.
Endpoint
POST
1 |
/households/{householdId}/playlists/getPlaylist |
Request parameters
This command requires a householdId
to determine the target of the command. See the Control documentation for details.
See the table below for descriptions of parameters in the body.
Parameter | Type | Value |
---|---|---|
playlistId |
string | The identifier of the playlist. You can find this in the playlistsList object in the getPlaylists response. |
Response
This command returns a PlaylistSummary
object, which contains an array of PlaylistTrack
objects.
In the event of a failure, returns a globalError
.
playlistSummary type
The playlistSummary
object consists of the fields described below.
Parameter | Type | Value |
---|---|---|
id |
string | The identifier of the playlist. |
name |
string | The name of the playlist. |
type |
string | The item type: “playlist”. |
tracks |
array | The individual tracks that make up the playlist. An array of playlistTrack objects. |
playlistTrack type
The playlistTrack
object consists of the fields described below.
Parameter | Type | Value |
---|---|---|
name |
string | The title of the track. |
artist |
string | The artist associated with the track. |
album |
string | The album associated with the track. |
Example
Request
1 2 3 |
{ "playlistId" : "3" } |
Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
{ "id": "3", "name": "Thursday Morning Mix", "type": "playlistSummary", "tracks": [ { "name": "In Between Days", "album": "The Head On the Door (Remastered) [Bonus Version]", "artist": "The Cure" }, { "name": "Just Like Honey", "album": "Psychocandy", "artist": "The Jesus and Mary Chain" }, { "name": "Bastards of Young", "album": "Tim (Expanded Edition)", "artist": "The Replacements" }, { "name": "How Soon Is Now?", "album": "Complete", "artist": "The Smiths" } ] } |