Class RemoveTracksPlaylistRequest


  • public class RemoveTracksPlaylistRequest
    extends Object
    Remove Items from a Playlist request

    Required OAuth scopes

    playlist-modify-public, playlist-modify-private

    Notes

    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-Override or 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_id in JSON format and the HTTP status code in the response header is 200 OK. The snapshot_id can 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 403 Forbidden. Attempting to use several different ways to remove items returns 400 Bad Request. Other client errors returning 400 Bad Request include specifying invalid positions.

    • 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