Class GetRecentlyPlayedRequest
- java.lang.Object
-
- de.sonallux.spotify.api.apis.player.GetRecentlyPlayedRequest
-
public class GetRecentlyPlayedRequest extends Object
Get Current User's Recently Played Tracks requestResponse
On success, the HTTP status code in the response header is
200OK and the response body contains an array of play history objects (wrapped in a cursor-based paging object) in JSON format. The play history items each contain the context the track was played from (e.g. playlist, album), the date and time the track was played, and a track object (simplified). On error, the header status code is an error code and the response body contains an error object.If private session is enabled the response will be a
204 NO CONTENTwith an empty payload.
-
-
Constructor Summary
Constructors Constructor Description GetRecentlyPlayedRequest(ApiClient apiClient)Get Current User's Recently Played Tracks request
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GetRecentlyPlayedRequestafter(int after)A Unix timestamp in milliseconds.GetRecentlyPlayedRequestbefore(int before)A Unix timestamp in milliseconds.ApiCall<CursorPaging<PlayHistory>>build()Build the request into an executable callGetRecentlyPlayedRequestlimit(int limit)The maximum number of items to return.
-
-
-
Constructor Detail
-
GetRecentlyPlayedRequest
public GetRecentlyPlayedRequest(ApiClient apiClient)
Get Current User's Recently Played Tracks request
- Parameters:
apiClient-The API client
-
-
Method Detail
-
limit
public GetRecentlyPlayedRequest limit(int limit)
The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50.
-
after
public GetRecentlyPlayedRequest after(int after)
A Unix timestamp in milliseconds. Returns all items after (but not including) this cursor position. If
afteris specified,beforemust not be specified.
-
before
public GetRecentlyPlayedRequest before(int before)
A Unix timestamp in milliseconds. Returns all items before (but not including) this cursor position. If
beforeis specified,aftermust not be specified.
-
build
public ApiCall<CursorPaging<PlayHistory>> build()
Build the request into an executable call
-
-