Class AddTracksToPlaylistRequest

java.lang.Object
de.sonallux.spotify.api.apis.playlists.AddTracksToPlaylistRequest

public class AddTracksToPlaylistRequest extends Object

Add Items to Playlist request

Required OAuth scopes

playlist-modify-public, playlist-modify-private

Response

A snapshot ID for the playlist

  • Constructor Details

    • AddTracksToPlaylistRequest

      public AddTracksToPlaylistRequest(ApiClient apiClient, String playlistId, List<String> uris)
      Add Items to Playlist request
      Parameters:
      apiClient -

      The API client

      playlistId -

      The Spotify ID of the playlist.

      uris -

      A JSON array of the Spotify URIs to add. For example: {"uris": ["spotify:track:4iV5W9uYEdYUVa79Axb7Rh","spotify:track:1301WleyT98MSxVHPZCA6M", "spotify:episode:512ojhOuo1ktJprKbVcKyQ"]}
      A maximum of 100 items can be added in one request. Note: if the uris parameter is present in the query string, any URIs listed here in the body will be ignored.

  • Method Details

    • position

      public AddTracksToPlaylistRequest position(int position)
      Parameters:
      position -

      The position to insert the items, a zero-based index. For example, to insert the items in the first position: position=0 ; to insert the items in the third position: position=2. If omitted, the items will be appended to the playlist. Items are added in the order they appear in the uris array. For example: {"uris": ["spotify:track:4iV5W9uYEdYUVa79Axb7Rh","spotify:track:1301WleyT98MSxVHPZCA6M"], "position": 3}

      Returns:
      this request
    • build

      public ApiCall<PlaylistSnapshotId> build()
      Build the request into an executable api call
      Returns:
      an executable api call