Class RemoveTracksPlaylistRequest
- java.lang.Object
-
- de.sonallux.spotify.api.apis.playlists.RemoveTracksPlaylistRequest
-
public class RemoveTracksPlaylistRequest extends Object
Remove Items from a Playlist requestRequired OAuth scopes
playlist-modify-public, playlist-modify-privateNotes
Frequently Asked Questions:
-
Is it possible to delete a playlist? No, it isn't. The reason there is no endpoint for this is explained in our Working With Playlists Guide in the section Following and Unfollowing a Playlist.
-
Can I use
X-HTTP-Method-Overrideor similar to send a DELETE request overriding the HTTP verb? Not at the moment, the delete operation needs to be specified through a DELETE request.
Response
On success, the response body contains a
snapshot_idin JSON format and the HTTP status code in the response header is200OK. Thesnapshot_idcan be used to identify your playlist version in future requests.On error, the header status code is an error code and the response body contains an error object. Trying to remove an item when you do not have the user's authorization returns error
403Forbidden. Attempting to use several different ways to remove items returns400Bad Request. Other client errors returning400Bad Request include specifying invalid positions. -
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ApiCall<SnapshotId>build()Build the request into an executable callRemoveTracksPlaylistRequestsnapshotId(String snapshotId)The playlist's snapshot ID against which you want to make the changes.
-
-
-
Constructor Detail
-
RemoveTracksPlaylistRequest
public RemoveTracksPlaylistRequest(ApiClient apiClient, String playlistId, List<Map<String,Object>> tracks)
Remove Items from a Playlist request
- Parameters:
apiClient-The API client
playlistId-The Spotify ID
tracks-An array of objects containing Spotify URIs of the tracks or episodes to remove. For example:
{ "tracks": [{ "uri": "spotify:track:4iV5W9uYEdYUVa79Axb7Rh" },{ "uri": "spotify:track:1301WleyT98MSxVHPZCA6M" }] }. A maximum of 100 objects can be sent at once.
-
-
Method Detail
-
snapshotId
public RemoveTracksPlaylistRequest snapshotId(String snapshotId)
The playlist's snapshot ID against which you want to make the changes. The API will validate that the specified items exist and in the specified positions and make the changes, even if more recent changes have been made to the playlist.
-
build
public ApiCall<SnapshotId> build()
Build the request into an executable call
-
-