Class SetVolumeForUsersPlaybackRequest


  • public class SetVolumeForUsersPlaybackRequest
    extends Object
    Set Volume For User's Playback request

    Required OAuth scopes

    user-modify-playback-state

    Response

    A completed request will return a 204 NO CONTENT response code, and then issue the command to the player. Due to the asynchronous nature of the issuance of the command, you should use the Get Information About The User's Current Playback endpoint to check that your issued command was handled correctly by the player.

    If the device is not found, the request will return 404 NOT FOUND response code.

    If the user making the request is non-premium, a 403 FORBIDDEN response code will be returned.

    • Constructor Detail

      • SetVolumeForUsersPlaybackRequest

        public SetVolumeForUsersPlaybackRequest​(ApiClient apiClient,
                                                int volumePercent)

        Set Volume For User's Playback request

        Parameters:
        apiClient -

        The API client

        volumePercent -

        The volume to set. Must be a value from 0 to 100 inclusive.

    • Method Detail

      • deviceId

        public SetVolumeForUsersPlaybackRequest deviceId​(String deviceId)

        The id of the device this command is targeting. If not supplied, the user's currently active device is the target.

      • build

        public ApiCall<Void> build()
        Build the request into an executable call