Class TransferUsersPlaybackRequest
- java.lang.Object
-
- de.sonallux.spotify.api.apis.player.TransferUsersPlaybackRequest
-
public class TransferUsersPlaybackRequest extends Object
Transfer a User's Playback requestRequired OAuth scopes
user-modify-playback-stateResponse
A completed request will return a
204 NO CONTENTresponse 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 FOUNDresponse code.If the user making the request is non-premium, a
403 FORBIDDENresponse code will be returned.
-
-
Constructor Summary
Constructors Constructor Description TransferUsersPlaybackRequest(ApiClient apiClient, List<String> deviceIds)Transfer a User's Playback request
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ApiCall<Void>build()Build the request into an executable callTransferUsersPlaybackRequestplay(boolean play)true : ensure playback happens on new device.
false or not provided: keep the current playback state.
-
-
-
Constructor Detail
-
TransferUsersPlaybackRequest
public TransferUsersPlaybackRequest(ApiClient apiClient, List<String> deviceIds)
Transfer a User's Playback request
- Parameters:
apiClient-The API client
deviceIds-A JSON array containing the ID of the device on which playback should be started/transferred.
For example:{device_ids:["74ASZWbe4lXaubB36ztrGX"]}
Note: Although an array is accepted, only a single device_id is currently supported. Supplying more than one will return400 Bad Request
-
-
Method Detail
-
play
public TransferUsersPlaybackRequest play(boolean play)
true : ensure playback happens on new device.
false or not provided: keep the current playback state.
-
-