Class GetUsersCurrentlyPlayingTrackRequest


  • public class GetUsersCurrentlyPlayingTrackRequest
    extends Object
    Get the User's Currently Playing Track request

    Required OAuth scopes

    user-read-currently-playing, user-read-playback-state

    Response

    A successful request will return a 200 OK response code with a json payload that contains information about the currently playing track or episode and its context (see below). The information returned is for the last known state, which means an inactive device could be returned if it was the last one to execute playback.

    When no available devices are found, the request will return a 200 OK response but with no data populated.

    When no track is currently playing, the request will return a 204 NO CONTENT response with no payload.

    If private session is enabled the response will be a 204 NO CONTENT with an empty payload.

    • Constructor Detail

      • GetUsersCurrentlyPlayingTrackRequest

        public GetUsersCurrentlyPlayingTrackRequest​(ApiClient apiClient,
                                                    String market)

        Get the User's Currently Playing Track request

        Parameters:
        apiClient -

        The API client

        market -

        An ISO 3166-1 alpha-2 country code or the string from_token. Provide this parameter if you want to apply Track Relinking.

    • Method Detail

      • additionalTypes

        public GetUsersCurrentlyPlayingTrackRequest additionalTypes​(String additionalTypes)

        A comma-separated list of item types that your client supports besides the default track type. Valid types are: track and episode. An unsupported type in the response is expected to be represented as null value in the item field. Note : This parameter was introduced to allow existing clients to maintain their current behaviour and might be deprecated in the future. In addition to providing this parameter, make sure that your client properly handles cases of new types in the future by checking against the currently_playing_type field.