playerVolume

setRelativeVolume

Use the setRelativeVolume command to increase or decrease volume and set the player's mute state.

Returns an empty body with a success value of true if successful. The player generates a playerVolume event if the volume was changed. Additionally, if setRelativeVolume includes a volumeDelta and the player has a fixed player volume state that is true, the command will fail, the mute state is left unchanged, and you will receive an ERROR_COMMAND_FAILED globalError. This is because players with fixed volumes cannot be changed. A setRelativeVolume that only sets muted succeeds on such a player.

post/players/{playerId}/playerVolume/relative

Request

  • Base URL
    https://api.ws.sonos.com/control/api/v1
  • URL
    https://api.ws.sonos.com/control/api/v1/players/{playerId}/playerVolume/relative
  • Auth
    OAuth 2 and HTTP bearer and API key in header X-Sonos-Api-Key
    Authorization code: https://api.sonos.com/login/v3/oauth
    Token URL: https://api.sonos.com/login/v3/oauth/access scopes: playback-control-all

Request body

volumeDeltainteger nullable

(Optional) Between -100 and 100 to indicate the amount to increase or decrease the volume for the player. If your app submits a number outside of this range, you will receive an ERROR_INVALID_PARAMETER error. The player adds this value to the current volume and keeps the result in the range of 0 to 100.

mutedboolean nullable

(Optional) True to mute the player or false to unmute the player. If not specified, the existing mute state is maintained.

Response

See the x-muse-error-codes extension for a list of muse errors that generate this response

Ok required

This object represents an empty (default) success. The platform returns an empty object ({}).

Changes

No recorded changes to this operation across all 1 revision of this API.