Your app may have access to more than one household tied to an authorization token. Send a GET
command to the household
namespace endpoint to get a list of household IDs for which your app has access. See Authorize for details.
The getHouseholds
command requests information on the households that can be acted upon, based upon the access token used when calling this API. There are no parameters for this command.
If successful, Sonos responds with an array of household objects.
Endpoint
GET
1 |
/households |
household object
Represents a Sonos household. This object includes the following fields:
Name | Type | Description |
---|---|---|
id |
String | Identifies a Sonos household. |
name |
String | A user-displayable name of the Sonos household (not yet implemented). |
Sample request
Here’s a sample request for a list of households:
1 2 3 4 |
GET /control/api/v1/households HTTP/1.1 Host: api.ws.sonos.com Content-Type: application/json Authorization: Bearer {token} |
Sample response
Here’s a sample response:
1 2 3 4 5 6 7 8 9 10 |
{ "households": [ { "id": "Sonos_HHID-4321" }, { "id": "Sonos_HHID-1234" } ] } |