Use the getPlaylists
command in the playlists
namespace to get the list of Sonos playlists for a household. Playlists do not include pinned items (any non-playable containers pinned to My Sonos) or Sonos favorites. See the Save your favorites section in the Sonos user guide for details about My Sonos.
Endpoint
GET
1 |
/households/{householdId}/playlists |
Request parameters
This command requires a householdId
to determine the target of the command. See the Control documentation for details.
Response
Returns a playlistsList
object, which is an array of playlist
objects with a version number.
In the event of a failure, returns a globalError
.
PlaylistsList object
The playlistsList
object consists of the fields described below.
Parameter | Type | Value |
---|---|---|
version |
string | The new version string. Sonos updates this version whenever the Sonos playlists change for the household. Your app can then send a getPlaylists command to receive the new list of playlists. |
playlists |
array | An array of playlist objects. |
Example
Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
{ "version" : "1", "playlists" : [ { "id" : "11", "name" : "Thursday Morning Mix", "type" : "playlist", "trackCount" : 50 }, { "id" : "17", "name" : "My Favorite Tracks", "type" : "playlist", "trackCount" : 17 } ] } |