Class ReorderPlaylistsTracksRequest
- java.lang.Object
-
- de.sonallux.spotify.api.apis.playlists.ReorderPlaylistsTracksRequest
-
public class ReorderPlaylistsTracksRequest extends Object
Reorder items in a playlist requestRequired OAuth scopes
playlist-modify-public, playlist-modify-privateResponse
On a successful reorder operation, 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, the response body contains an error object, and the existing playlist is unmodified. Trying to set an item when you do not have the user's authorization returns error
403Forbidden.
-
-
Constructor Summary
Constructors Constructor Description ReorderPlaylistsTracksRequest(ApiClient apiClient, String playlistId, int rangeStart, int insertBefore)Reorder items in 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 callReorderPlaylistsTracksRequestrangeLength(int rangeLength)The amount of items to be reordered.ReorderPlaylistsTracksRequestsnapshotId(String snapshotId)The playlist's snapshot ID against which you want to make the changes.
-
-
-
Constructor Detail
-
ReorderPlaylistsTracksRequest
public ReorderPlaylistsTracksRequest(ApiClient apiClient, String playlistId, int rangeStart, int insertBefore)
Reorder items in a playlist request
- Parameters:
apiClient-The API client
playlistId-The Spotify ID for the playlist.
rangeStart-The position of the first item to be reordered.
insertBefore-The position where the items should be inserted.
To reorder the items to the end of the playlist, simply set insert_before to the position after the last item.
Examples:
To reorder the first item to the last position in a playlist with 10 items, set range_start to 0, and insert_before to 10.
To reorder the last item in a playlist with 10 items to the start of the playlist, set range_start to 9, and insert_before to 0.
-
-
Method Detail
-
rangeLength
public ReorderPlaylistsTracksRequest rangeLength(int rangeLength)
The amount of items to be reordered. Defaults to 1 if not set.
The range of items to be reordered begins from the range_start position, and includes the range_length subsequent items.
Example:
To move the items at index 9-10 to the start of the playlist, range_start is set to 9, and range_length is set to 2.
-
snapshotId
public ReorderPlaylistsTracksRequest snapshotId(String snapshotId)
The playlist's snapshot ID against which you want to make the changes.
-
build
public ApiCall<SnapshotId> build()
Build the request into an executable call
-
-