IRequest.Builderpublic static final class RemoveTracksFromPlaylistRequest.Builder extends AbstractDataRequest.Builder<RemoveTracksFromPlaylistRequest.Builder>
RemoveTracksFromPlaylistRequest.| Constructor | Description |
|---|---|
Builder(String accessToken) |
Create a new
RemoveTracksFromPlaylistRequest.Builder. |
| Modifier and Type | Method | Description |
|---|---|---|
RemoveTracksFromPlaylistRequest |
build() |
The request build method.
|
RemoveTracksFromPlaylistRequest.Builder |
playlist_id(String playlist_id) |
The playlist ID setter.
|
RemoveTracksFromPlaylistRequest.Builder |
snapshotId(String snapshotId) |
The playlist snapshot ID setter.
|
RemoveTracksFromPlaylistRequest.Builder |
tracks(com.google.gson.JsonArray tracks) |
The track URIs setter.
|
RemoveTracksFromPlaylistRequest.Builder |
user_id(String user_id) |
Deprecated.
Playlist IDs are unique for themselves. This parameter is thus no longer used.
(https://developer.spotify.com/community/news/2018/06/12/changes-to-playlist-uris/)
|
setBody, setBodyParameter, setContentType, setDefaults, setHeader, setHost, setHttpManager, setPath, setPathParameter, setPort, setQueryParameter, setSchemepublic Builder(String accessToken)
RemoveTracksFromPlaylistRequest.Builder.
Removing tracks from an user's public playlists requires authorization of the playlist-modify-public
scope; removing tracks from an user's private playlist (including collaborative playlists) requires the
playlist-modify-private scope.
accessToken - Required. A valid access token from the Spotify Accounts service.@Deprecated public RemoveTracksFromPlaylistRequest.Builder user_id(String user_id)
user_id - The user's Spotify user ID.RemoveTracksFromPlaylistRequest.Builder.public RemoveTracksFromPlaylistRequest.Builder playlist_id(String playlist_id)
playlist_id - The Spotify ID for the playlist.RemoveTracksFromPlaylistRequest.Builder.public RemoveTracksFromPlaylistRequest.Builder tracks(com.google.gson.JsonArray tracks)
There are several ways to specify which tracks to remove, determined by the request parameters.
Removing all occurrences of specific tracks:
[{ "uri": "spotify:track:4iV5W9uYEdYUVa79Axb7Rh" },
{"uri": "spotify:track:1301WleyT98MSxVHPZCA6M" }]
Removing a specific occurrence of a track:
[{ "uri": "spotify:track:4iV5W9uYEdYUVa79Axb7Rh", "positions": [0,3] },
{ "uri": "spotify:track:1301WleyT98MSxVHPZCA6M", "positions": [7] }]
tracks - Required. An array of objects containing Spotify URIs of the tracks to remove. A maximum of
100 objects can be sent at onceRemoveTracksFromPlaylistRequest.Builder.public RemoveTracksFromPlaylistRequest.Builder snapshotId(String snapshotId)
To guard against errors when concurrent edits happen to the same playlist, we recommend specifying a snapshot ID. The snapshot ID lets us know which version of the playlist you are trying to edit. Concurrent edits by another user will be automatically resolved. If a given track in a given position is not found in the specified snapshot, the entire request will fail an no edits will take place.
snapshotId - Optional. The playlist's snapshot ID against which you want to make the changes. The API will
validate that the specified tracks exist and in the specified positions and make the changes,
even if more recent changes have been made to the playlist.RemoveTracksFromPlaylistRequest.Builder.public RemoveTracksFromPlaylistRequest build()
RemoveTracksFromPlaylistRequest.Copyright © 2019. All rights reserved.