The following documentation is automatically generated. Please do not edit this file, but rather the original, inline with Net::Async::Spotify::API::Generated::Player at lib/Net/Async/Spotify/API/Generated/Player.pm (on the system that originally ran this). If you do edit this file, and don't want your changes to be removed, make sure you change the first line.
NAME
Net::Async::Spotify::API::Generated::Player - Package representing Spotify Player API
DESCRIPTION
Autogenerated module. Based on https://developer.spotify.com/documentation/web-api/reference/#reference-index Check crawl-api-doc.pl
for more information.
METHODS
add_to_queue
add_to_queue - Add an item to queue
Add an item to the end of the user’s current playback queue.
with Request details being:
header
- Authorization
-
Type: string | Required: required A valid access token from the Spotify Accounts service: see the Web API Authorization Guide for details.The access token must have been issued on behalf of a user.The access token must have the user-modify-playback-state scope authorized in order to control playback
query_parameter
- device_id
-
Type: string | Required: optional The id of the device this command is targeting. If not supplied, the user’s currently active device is the target.
- uri
-
Type: string | Required: required The uri of the item to add to the queue. Must be a track or an episode uri.
and Response Objects being:
A completed request will return a 204 NO CONTENT response code, and then issue the command to the player. Due to the asynchronous nature of the issuance of the command, you should use the Get Information About The User’s Current Playback endpoint to check that your issued command was handled correctly by the player.If the device is not found, the request will return 404 NOT FOUND response code.If the user making the request is non-premium, a 403 FORBIDDEN response code will be returned.Try in our Web Console
get_a_users_available_devices
get_a_users_available_devices - Get a User's Available Devices
Get information about a user’s available devices.
with Request details being:
header
- Authorization
-
Type: string | Required: required A valid access token from the Spotify Accounts service: see the Web API Authorization Guide for details. The access token must have been issued on behalf of a user. The access token must have the user-read-playback-state scope authorized in order to read information.
and Response Objects being:
- device object
A successful request will return a 200 OK response code with a json payload that contains the device objects (see below). When no available devices are found, the request will return a 200 OK response with an empty devices list.Try in our Web Console
get_information_about_the_users_current_playback
get_information_about_the_users_current_playback - Get Information About The User's Current Playback
Get information about the user’s current playback state, including track or episode, progress, and active device.
with Request details being:
header
- Authorization
-
Type: string | Required: required A valid access token from the Spotify Accounts service: see the Web API Authorization Guide for details.
query_parameter
- additional_types
-
Type: string | Required: optional 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
- market
-
Type: string | Required: optional An ISO 3166-1 alpha-2 country code or the string from_token. Provide this parameter if you want to apply Track Relinking.
and Response Objects being:
A successful request will return a 200 OK response code with a json payload that contains information about the current playback. 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.Try in our Web Console
get_recently_played
get_recently_played - Get Current User's Recently Played Tracks
Get tracks from the current user’s recently played tracks. Note: Currently doesn’t support podcast episodes.
with Request details being:
header
- Authorization
-
Type: string | Required: required A valid access token from the Spotify Accounts service: see the Web API Authorization Guide for details. The access token must have been issued on behalf of a user.
query_parameter
- after
-
Type: integer | Required: optional A Unix timestamp in milliseconds. Returns all items after (but not including) this cursor position. If after is specified, before must not be specified.
- before
-
Type: integer | Required: optional A Unix timestamp in milliseconds. Returns all items before (but not including) this cursor position. If before is specified, after must not be specified.
- limit
-
Type: integer | Required: optional The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50.
and Response Objects being:
- history object
On success, the HTTP status code in the response header is 200 OK 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 CONTENT with an empty payload.Try in our Web Console
get_the_users_currently_playing_track
get_the_users_currently_playing_track - Get the User's Currently Playing Track
Get the object currently being played on the user’s Spotify account.
with Request details being:
header
- Authorization
-
Type: string | Required: required A valid access token from the Spotify Accounts service: see the Web API Authorization Guide for details. The access token must have been issued on behalf of a user. The access token must have the user-read-currently-playing and/or user-read-playback-state scope authorized in order to read information.
query_parameter
- additional_types
-
Type: string | Required: optional 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.
- market
-
Type: string | Required: required An ISO 3166-1 alpha-2 country code or the string from_token. Provide this parameter if you want to apply Track Relinking.
and Response Objects being:
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.Try in our Web Console
pause_a_users_playback
pause_a_users_playback - Pause a User's Playback
Pause playback on the user’s account.
with Request details being:
header
- Authorization
-
Type: string | Required: required A valid access token from the Spotify Accounts service: see the Web API Authorization Guide for details.The access token must have been issued on behalf of a user.
query_parameter
- device_id
-
Type: string | Required: optional The id of the device this command is targeting. If not supplied, the user’s currently active device is the target.
and Response Objects being:
A completed request will return a 204 NO CONTENT response code, and then issue the command to the player. Due to the asynchronous nature of the issuance of the command, you should use the Get Information About The User’s Current Playback endpoint to check that your issued command was handled correctly by the player.If the device is not found, the request will return 404 NOT FOUND response code.If the user making the request is non-premium, a 403 FORBIDDEN response code will be returned.Try in our Web Console
seek_to_position_in_currently_playing_track
seek_to_position_in_currently_playing_track - Seek To Position In Currently Playing Track
Seeks to the given position in the user’s currently playing track.
with Request details being:
header
- Authorization
-
Type: string | Required: required A valid access token from the Spotify Accounts service: see the Web API Authorization Guide for details.The access token must have been issued on behalf of a user.The access token must have the user-modify-playback-state scope authorized in order to control playback
query_parameter
- device_id
-
Type: string | Required: optional The id of the device this command is targeting. If not supplied, the user’s currently active device is the target.
- position_ms
-
Type: integer | Required: required The position in milliseconds to seek to. Must be a positive number. Passing in a position that is greater than the length of the track will cause the player to start playing the next song.
and Response Objects being:
A completed request will return a 204 NO CONTENT response code, and then issue the command to the player. Due to the asynchronous nature of the issuance of the command, you should use the Get Information About The User’s Current Playback endpoint to check that your issued command was handled correctly by the player.If the device is not found, the request will return 404 NOT FOUND response code.If the user making the request is non-premium, a 403 FORBIDDEN response code will be returned.Try in our Web Console
set_repeat_mode_on_users_playback
set_repeat_mode_on_users_playback - Set Repeat Mode On User’s Playback
Set the repeat mode for the user’s playback. Options are repeat-track, repeat-context, and off.
with Request details being:
header
- Authorization
-
Type: string | Required: required A valid access token from the Spotify Accounts service: see the Web API Authorization Guide for details.The access token must have been issued on behalf of a user.The access token must have the user-modify-playback-state scope authorized in order to control playback.
query_parameter
- device_id
-
Type: string | Required: optional The id of the device this command is targeting. If not supplied, the user’s currently active device is the target.
- state
-
Type: string | Required: required track, context or off. track will repeat the current track. context will repeat the current context. off will turn repeat off.
and Response Objects being:
A completed request will return a 204 NO CONTENT response code, and then issue the command to the player. Due to the asynchronous nature of the issuance of the command, you should use the Get Information About The User’s Current Playback endpoint to check that your issued command was handled correctly by the player.If the device is not found, the request will return 404 NOT FOUND response code.If the user making the request is non-premium, a 403 FORBIDDEN response code will be returned.Try in our Web Console
set_volume_for_users_playback
set_volume_for_users_playback - Set Volume For User's Playback
Set the volume for the user’s current playback device.
with Request details being:
header
- Authorization
-
Type: string | Required: required A valid access token from the Spotify Accounts service: see the Web API Authorization Guide for details.The access token must have been issued on behalf of a user.The access token must have the user-modify-playback-state scope authorized in order to control playback.
query_parameter
- device_id
-
Type: string | Required: optional The id of the device this command is targeting. If not supplied, the user’s currently active device is the target.
- volume_percent
-
Type: integer | Required: required The volume to set. Must be a value from 0 to 100 inclusive.
and Response Objects being:
A completed request will return a 204 NO CONTENT response code, and then issue the command to the player. Due to the asynchronous nature of the issuance of the command, you should use the Get Information About The User’s Current Playback endpoint to check that your issued command was handled correctly by the player.If the device is not found, the request will return 404 NOT FOUND response code.If the user making the request is non-premium, a 403 FORBIDDEN response code will be returned.Try in our Web Console
skip_users_playback_to_next_track
skip_users_playback_to_next_track - Skip User’s Playback To Next Track
Skips to next track in the user’s queue.
with Request details being:
header
- Authorization
-
Type: string | Required: required A valid access token from the Spotify Accounts service: see the Web API Authorization Guide for details.The access token must have been issued on behalf of a user.The access token must have the user-modify-playback-state scope authorized in order to control playback.
query_parameter
- device_id
-
Type: string | Required: optional The id of the device this command is targeting. If not supplied, the user’s currently active device is the target.
and Response Objects being:
A completed request will return a 204 NO CONTENT response code, and then issue the command to the player. Due to the asynchronous nature of the issuance of the command, you should use the Get Information About The User’s Current Playback endpoint to check that your issued command was handled correctly by the player.If the device is not found, the request will return 404 NOT FOUND response code.If the user making the request is non-premium, a 403 FORBIDDEN response code will be returned.Try in our Web Console
skip_users_playback_to_previous_track
skip_users_playback_to_previous_track - Skip User’s Playback To Previous Track
Skips to previous track in the user’s queue.
with Request details being:
header
- Authorization
-
Type: string | Required: required A valid access token from the Spotify Accounts service: see the Web API Authorization Guide for details.The access token must have been issued on behalf of a user.The access token must have the user-modify-playback-state scope authorized in order to control playback.
query_parameter
- device_id
-
Type: string | Required: optional The id of the device this command is targeting. If not supplied, the user’s currently active device is the target.
and Response Objects being:
A completed request will return a 204 NO CONTENT response code, and then issue the command to the player. Due to the asynchronous nature of the issuance of the command, you should use the Get Information About The User’s Current Playback endpoint to check that your issued command was handled correctly by the player.If the device is not found, the request will return 404 NOT FOUND response code.If the user making the request is non-premium, a 403 FORBIDDEN response code will be returned.Try in our Web Console
start_a_users_playback
start_a_users_playback - Start/Resume a User's Playback
Start a new context or resume current playback on the user’s active device.
with Request details being:
header
- Authorization
-
Type: string | Required: required A valid access token from the Spotify Accounts service: see the Web API Authorization Guide for details.The access token must have been issued on behalf of a user.The access token must have the user-modify-playback-state scope authorized in order to control playback.
json_body_parameter
- context_uri
-
Type: string | Required: optional string
- offset
-
Type: object | Required: optional object
- position_ms
-
Type: integer | Required: optional integer
- uris
-
Type: array[string] | Required: optional Array of URIs
query_parameter
- device_id
-
Type: string | Required: optional The id of the device this command is targeting. If not supplied, the user’s currently active device is the target.
and Response Objects being:
A completed request will return a 204 NO CONTENT response code, and then issue the command to the player. Due to the asynchronous nature of the issuance of the command, you should use the Get Information About The User’s Current Playback endpoint to check that your issued command was handled correctly by the player.If the device is not found, the request will return 404 NOT FOUND response code.If the user making the request is non-premium, a 403 FORBIDDEN response code will be returned.Try in our Web Console
toggle_shuffle_for_users_playback
toggle_shuffle_for_users_playback - Toggle Shuffle For User’s Playback
Toggle shuffle on or off for user’s playback.
with Request details being:
header
- Authorization
-
Type: string | Required: required A valid access token from the Spotify Accounts service: see the Web API Authorization Guide for details.The access token must have been issued on behalf of a user.The access token must have the user-modify-playback-state scope authorized in order to control playback.
query_parameter
- device_id
-
Type: string | Required: optional The id of the device this command is targeting. If not supplied, the user’s currently active device is the target.
- state
-
Type: boolean | Required: required true : Shuffle user’s playback. false : Do not shuffle user’s playback.
and Response Objects being:
A completed request will return a 204 NO CONTENT response code, and then issue the command to the player. Due to the asynchronous nature of the issuance of the command, you should use the Get Information About The User’s Current Playback endpoint to check that your issued command was handled correctly by the player.If the device is not found, the request will return 404 NOT FOUND response code.If the user making the request is non-premium, a 403 FORBIDDEN response code will be returned.Try in our Web Console
transfer_a_users_playback
transfer_a_users_playback - Transfer a User's Playback
Transfer playback to a new device and determine if it should start playing.
with Request details being:
header
- Authorization
-
Type: string | Required: required A valid access token from the Spotify Accounts service: see the Web API Authorization Guide for details.The access token must have been issued on behalf of a user.The access token must have the user-modify-playback-state scope authorized in order to control playback.
json_body_parameter
- device_ids
-
Type: array[string] | Required: required A JSON array containing the ID of the device on which playback should be started/transferred.For example:{device_ids:["74ASZWbe4lXaubB36ztrGX"]}Note: Although an array is accepted, only a single device_id is currently supported. Supplying more than one will return 400 Bad Request
- play
-
Type: boolean | Required: optional true: ensure playback happens on new device.false or not provided: keep the current playback state.
and Response Objects being:
A completed request will return a 204 NO CONTENT response code, and then issue the command to the player. Due to the asynchronous nature of the issuance of the command, you should use the Get Information About The User’s Current Playback endpoint to check that your issued command was handled correctly by the player.If the device is not found, the request will return 404 NOT FOUND response code.If the user making the request is non-premium, a 403 FORBIDDEN response code will be returned.Try in our Web Console