Sonos Music API > rateItem

Sonos uses rateItem to rate an item on your service. See Add ratings for details.

If the rating logic is static, you might establish a pre-defined behavior on the Sonos app for each rating. In this case, you can omit the shouldSkip and messageStringId values from the result. However, your service may find the “dynamic” shouldSkip and messageStringId values useful when you need to enforce business rules about when a user can skip a track or not.

Sonos makes this request on your secure (https:) endpoint.

Request parameters

Name Type Description
id string(128) The unique ID of the item to rate.
rating int The rating value for the item.

Response

Name Type Description
shouldSkip boolean (Optional) true if the song should be skipped. false if it should not be skipped.

This can be omitted if the Sonos app already knows what to do when sending this rating. For example, you might never want to skip the song after sending a “positive” rating.

messageStringId string(128) (Optional) An ID specifying a message that the Sonos app should show to the user.

For example, you can use this to offer a reason why Sonos skipped the song. The Sonos app can ignore this message if it has a default string for this rating.

Note that this is not the message itself, but rather an ID used by the Sonos app to look up the actual message string in your strings.xml file. See Strings and Localization for details.