Unit Settings API
Use the Default Music Station Setting API to manage unit settings for Alexa for Hospitality units such as rooms.
Get the default music station setting
Call GET /v2/units/{unitId}/settings/MusicExperience.defaultStationPreferences
to get the default music station preferences for a given unit.
GET /v2/units/{unitId}/settings/MusicExperience.defaultStationPreferences HTTP/1.1
Host: api.amazonalexa.com
Accept: application/json
Authorization: Bearer {LWA Token}
Request path parameters
Field |
Description |
Type |
Required |
unitId |
The unit ID, in the format "amzn1.alexa.unit.did.{id}" . |
String |
Yes |
Request body
None.
Host: api.amazonalexa.com
X-Amzn-RequestId: {request-id}
Content-Type: application/json
Field |
Description |
Type |
Required |
X-Amzn-RequestId |
Unique identifier for the request. If a problem occurs, Amazon can use this value to troubleshoot the problem. |
String |
Yes |
Response body example
{
"providerId": "I_HEART_RADIO",
"stationId": "4802"
}
Response body parameters
Field |
Description |
Type |
Required |
providerId |
The radio station provider ID. Currently the only supported value is I_HEART_RADIO . |
String |
Yes |
stationId |
The station ID. Supported values are 4802 (American Top 40), 4426 (IHR_CLASSIC_ROCK), 4429 (IHR_HIPHOP), 4422 (IHR_POP), 4418 (IHR_COUNTRY), 7193 (IHR_LATIN), 5953 (IHR_DANCE), 5162 (IHR_GOSPEL), 4242 (IHR_JAZZ), 6377 (IHR_CLASSICAL), 4409 (IHR_MIX), 4717 (IHR_OLDIES), 4447 (IHR_ALTERNATIVE), 7312 (IHR_WYNN_MUSIC). |
String |
Yes |
Error response
HTTP/1.1 {ErrorCode}
{
"type": "{ErrorType}",
"message": "{ErrorMessage}"
}
Error response parameters
Field |
Description |
Type |
Required |
type |
The error type. |
String |
No |
message |
The error message for the error. Note: The error message appears only for debugging/logging purposes. You must not share it with the customer. No business logic should depend on the content of the error message. |
String |
No |
HTTP response codes
Status Code |
Name |
Description |
200 |
OK |
The request succeeded. |
204 |
No content |
The setting exists, but it doesn't have a value. |
401 |
Unauthorized |
The access token is missing, expired, or invalid. |
403 |
Forbidden |
The user doesn't have permission to perform the operation. |
429 |
Too many requests |
The request is throttled. |
Set the default music station setting
Call PUT /v2/units/{unitId}/settings/MusicExperience.defaultStationPreferences
to set the default music station preferences for a given unit.
PUT /v2/units/{unitId}/settings/MusicExperience.defaultStationPreferences HTTP/1.1
Host: api.amazonalexa.com
Accept: application/json
Authorization: Bearer {LWA Token}
Request path parameters
Field |
Description |
Type |
Required |
unitId |
The unit ID, in the format "amzn1.alexa.unit.did.{id}" . |
String |
Yes |
Request body example
{
"providerId": "I_HEART_RADIO",
"stationId": "4802"
}
Request body parameters
Field |
Description |
Type |
Required |
providerId |
The radio station provider ID. Currently the only supported value is I_HEART_RADIO . |
String |
Yes |
stationId |
The station ID. Supported values are 4802 (American Top 40), 4426 (IHR_CLASSIC_ROCK), 4429 (IHR_HIPHOP), 4422 (IHR_POP), 4418 (IHR_COUNTRY), 7193 (IHR_LATIN), 5953 (IHR_DANCE), 5162 (IHR_GOSPEL), 4242 (IHR_JAZZ), 6377 (IHR_CLASSICAL), 4409 (IHR_MIX), 4717 (IHR_OLDIES), 4447 (IHR_ALTERNATIVE), 7312 (IHR_WYNN_MUSIC). |
String |
Yes |
Host: api.amazonalexa.com
X-Amzn-RequestId: {request-id}
Content-Type: application/json
Field |
Description |
Type |
Required |
X-Amzn-RequestId |
Unique identifier for the request. If a problem occurs, Amazon can use this value to troubleshoot the problem. |
String |
Yes |
Response body
None.
Error response
HTTP/1.1 {ErrorCode}
{
"type": "{ErrorType}",
"message": "{ErrorMessage}"
}
Error response parameters
Field |
Description |
Type |
Required |
type |
The error type. |
String |
No |
message |
The error message for the error. Note: The error message appears only for debugging/logging purposes. You must not share it with the customer. No business logic should depend on the content of the error message. |
String |
No |
HTTP response codes
Status Code |
Name |
Description |
204 |
No content |
Setting applied. |
400 |
Bad Request |
The request is malformed or is missing one or more required parameters. |
403 |
Forbidden |
The user doesn't have permission to perform the operation. |
429 |
Too many requests |
The request is throttled. |