Class GetCurrentUsersRecentlyPlayedTracksRequest
- java.lang.Object
-
- com.wrapper.spotify.requests.AbstractRequest
-
- com.wrapper.spotify.requests.data.AbstractDataRequest
-
- com.wrapper.spotify.requests.data.player.GetCurrentUsersRecentlyPlayedTracksRequest
-
- All Implemented Interfaces:
IRequest
public class GetCurrentUsersRecentlyPlayedTracksRequest extends AbstractDataRequest
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
nextfield with thebeforeparameter to move back in time, or use the after parameter to move forward in time. If you supply nobeforeorafterparameter, the endpoint will return the most recently played songs, and thenextlink will page back in time.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGetCurrentUsersRecentlyPlayedTracksRequest.BuilderBuilder class for building aGetCurrentUsersRecentlyPlayedTracksRequest.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PagingCursorbased<PlayHistory>execute()Get an user's recently played tracks.-
Methods inherited from class com.wrapper.spotify.requests.AbstractRequest
bodyParametersToJson, deleteJson, executeAsync, getBody, getBodyParameters, getContentType, getHeaders, getHttpManager, getJson, getUri, initializeBody, postJson, putJson
-
-
-
-
Method Detail
-
execute
public PagingCursorbased<PlayHistory> execute() throws IOException, SpotifyWebApiException
Get 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.
-
-