Class RemoveTracksFromPlaylistRequest.Builder

    • Constructor Detail

      • Builder

        public Builder​(java.lang.String accessToken)
        Create a new 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.

        Parameters:
        accessToken - Required. A valid access token from the Spotify Accounts service.
        See Also:
        Spotify: Using Scopes
    • Method Detail

      • tracks

        public RemoveTracksFromPlaylistRequest.Builder tracks​(com.google.gson.JsonArray tracks)
        The track URIs setter.

        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] }]

        Parameters:
        tracks - Required. An array of objects containing Spotify URIs of the tracks to remove. A maximum of 100 objects can be sent at once
        Returns:
        A RemoveTracksFromPlaylistRequest.Builder.
        See Also:
        Spotify: URIs & IDs
      • snapshotId

        public RemoveTracksFromPlaylistRequest.Builder snapshotId​(java.lang.String snapshotId)
        The playlist snapshot ID setter.

        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.

        Parameters:
        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.
        Returns:
        A RemoveTracksFromPlaylistRequest.Builder.
        See Also:
        Spotify: Version Control and Snapshots