Class GetCurrentUsersRecentlyPlayedTracksRequest
java.lang.Object
se.michaelthelin.spotify.requests.AbstractRequest<PagingCursorbased<PlayHistory>>
se.michaelthelin.spotify.requests.data.AbstractDataRequest<PagingCursorbased<PlayHistory>>
se.michaelthelin.spotify.requests.data.player.GetCurrentUsersRecentlyPlayedTracksRequest
- All Implemented Interfaces:
IRequest<PagingCursorbased<PlayHistory>>
public class GetCurrentUsersRecentlyPlayedTracksRequest
extends AbstractDataRequest<PagingCursorbased<PlayHistory>>
Get tracks from the current user’s recently played tracks.
Returns the most recent 50 tracks played by a user. Note that a track currently playing will not be visible in play history until it has completed. A track must be played for more than 30 seconds to be included in play history.
Any tracks listened to while the user had "Private Session" enabled in their client will not be returned in the list of recently played tracks.
The endpoint uses a bidirectional cursor for paging. Follow the next
field with the before
parameter
to move back in time, or use the after parameter to move forward in time. If you supply no before
or
after
parameter, the endpoint will return the most recently played songs, and the next
link will page back in time.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Builder class for building aGetCurrentUsersRecentlyPlayedTracksRequest
. -
Method Summary
Methods inherited from class se.michaelthelin.spotify.requests.AbstractRequest
bodyParametersToJson, deleteJson, executeAsync, getBody, getBodyParameters, getContentType, getHeaders, getHttpManager, getJson, getUri, initializeBody, postJson, putJson
-
Method Details
-
execute
public PagingCursorbased<PlayHistory> execute() throws IOException, SpotifyWebApiException, org.apache.hc.core5.http.ParseExceptionGet an user's recently played tracks.- Returns:
- An user's recently played tracks.
- Throws:
IOException
- In case of networking issues.SpotifyWebApiException
- The Web API returned an error further specified in this exception's root cause.org.apache.hc.core5.http.ParseException
-