Class AddTracksToPlaylistRequest
- java.lang.Object
-
- de.sonallux.spotify.api.apis.playlists.AddTracksToPlaylistRequest
-
public class AddTracksToPlaylistRequest extends Object
Add Items to a Playlist requestRequired OAuth scopes
playlist-modify-public, playlist-modify-privateResponse
On success, the HTTP status code in the response header is
201Created. The response body contains asnapshot_idin JSON format. 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 add an item when you do not have the user's authorization, or when there are more than 10.000 items in the playlist, returns error403Forbidden.
-
-
Constructor Summary
Constructors Constructor Description AddTracksToPlaylistRequest(ApiClient apiClient, String playlistId, List<String> uris)Add Items to a Playlist request
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ApiCall<SnapshotId>build()Build the request into an executable callAddTracksToPlaylistRequestposition(int position)The position to insert the items, a zero-based index.
-
-
-
Constructor Detail
-
AddTracksToPlaylistRequest
public AddTracksToPlaylistRequest(ApiClient apiClient, String playlistId, List<String> uris)
Add Items to a Playlist request
- Parameters:
apiClient-The API client
playlistId-The Spotify ID for 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 theurisparameter is present in the query string, any URIs listed here in the body will be ignored.
-
-
Method Detail
-
position
public AddTracksToPlaylistRequest position(int 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}
-
build
public ApiCall<SnapshotId> build()
Build the request into an executable call
-
-