Open rockfather opened 7 years ago
NOTE that calling the endpoint with a context
such as a playlist or album works as expected
@rockfather Could you leave an example of how using a context_uri works in that case? As I can't seem to get it working when sending the json data.
The following works for me using a playlist context
PUT https://api.spotify.com/v1/me/player/play -->> {"context_uri":"spotify:user:spotifyhwp:playlist:5XpO873pTWez7aV6RuOsW1","offset":{"position":0}},
giving a 204 response (as expected)
I'm doing it in the json format, I was wondering how would I need to arrange it in this format? As using the same context and offset still just play the current song and don't change it.
request({
method: 'PUT',
uri: 'https://api.spotify.com/v1/me/player/play',
headers:{
Authorization: 'Bearer ' + access_token
},
data:{
"context_uri": "spotify:user:spotifyhwp:playlist:5XpO873pTWez7aV6RuOsW1",
"offset": {
"position": 0
}
}
}, function (error, response, body) {
console.log(response);
});
Sorry to be so specific, I've been trying to figure out why my json doesn't send the context_uri properly for a month now. Should data be called something else for spotify to receive the context uri?
If you are getting a 204 response, then the syntax and format of the request is correct. The symptoms you describe (play existing song) are the same as I was observing when using this command with list of URIs rather than context. Suspect this is the same (or closely related bug) to this ticket that you are seeing
Issue found on July 19th 2017.
Endpoint(s):
PUT /v1/me/player/play{uris}
Steps to reproduce:
play
endpoint with list of URIsExpected behavior:
Playlist on client and device update to reflect newly supplied tracks
Actual behavior:
ERROR: Metadata error -1400
play
being called)NOTE that this worked as expected on same speaker using same speaker code up until (at least) 8 June 2017
Further Info
Test trace taken from speaker (Linn DS) showing eSDK operation after WEB API request
19/07/17,13:25:34.660,spotify,comms,[PUT https://api.spotify.com/v1/me/player/play] -->> {"uris": ["spotify:track:0h4fRpHrxBeR3XWHmcolaU", "spotify:track:2nWjhmRImt6LScZIPQMBnM", "spotify:track:2nTsKOXIVGDf2iPeVQO2Gm", "spotify:track:5c5a2Ptu8eyIpljhQHjIqk", "spotify:track:28i3xcfokLUIi3KXP7CxBN"]} 19/07/17,13:25:34.759,spotify,comms,[PUT https://api.spotify.com/v1/me/player/play] <<-- (204) 19/07/17,13:25:34.786,Spotify::CallbackDebugMessage aMessage: Got Spirc Type 20 19/07/17,13:25:34.795,Spotify::CallbackDebugMessage aMessage: ESDK: Notifying kSpPlaybackNotifyBecameActive 19/07/17,13:25:34.795,Spotify::CallbackPlaybackNotify aEvent: 9; activeDevice: 0 19/07/17,13:25:34.795,SourceSpotify::NotifyBecameActive iSdkPlayState: 1 19/07/17,13:25:34.795,Spotify::CallbackDebugMessage aMessage: ESDK: Notifying kSpPlaybackNotifyPlay 19/07/17,13:25:34.795,Spotify::CallbackPlaybackNotify aEvent: 0; activeDevice: 1 19/07/17,13:25:34.796,Pipeline state change: buffering 19/07/17,13:25:34.796,SourceSpotify::NotifyPlay iSdkPlayState: 1 19/07/17,13:25:34.796,Spotify::CallbackDebugMessage aMessage: stop_audio_out reset_decoder 19/07/17,13:25:34.796,Spotify::CallbackDebugMessage aMessage: stop_audio_out send_end_track 19/07/17,13:25:34.796,Spotify::CallbackDebugMessage aMessage: ESDK: Notifying kSpPlaybackEventAudioFlush 19/07/17,13:25:34.796,Spotify::CallbackPlaybackNotify aEvent: 12; activeDevice: 1 19/07/17,13:25:34.796,Spotify::CallbackDebugMessage aMessage: stop_audio_out reset_decoder 19/07/17,13:25:34.796,Spotify::CallbackDebugMessage aMessage: stop_audio_out send_end_track 19/07/17,13:25:34.796,Spotify::CallbackDebugMessage aMessage: ESDK: Notifying kS 19/07/17,13:25:34.796,Spotify::CallbackDebugMessage aMessage: ESDK: Notifying kSpPlaybackEventAudioFlush 19/07/17,13:25:34.796,Spotify::CallbackPlaybackNotify aEvent: 12; activeDevice: 1 19/07/17,13:25:34.796,Spotify::CallbackDebugMessage aMessage: WARNING: Notify rejected; waiting for resolve,, 19/07/17,13:25:34.848,Spotify::CallbackDebugMessage aMessage: WARNING: Notify rejected; waiting for resolve,, 19/07/17,13:25:34.848,Spotify::CallbackDebugMessage aMessage: WARNING: Notify rejected; waiting for resolve,, 19/07/17,13:25:34.848,Spotify::CallbackDebugMessage aMessage: WARNING: Notify rejected; waiting for resolve,, 19/07/17,13:25:34.848,Spotify::CallbackDebugMessage aMessage: WARNING: Notify rejected; waiting for resolve,, 19/07/17,13:25:34.901,Spotify::CallbackDebugMessage aMessage: WARNING: Notify rejected; waiting for resolve,, 19/07/17,13:25:34.901,Spotify::CallbackDebugMessage aMessage: WARNING: Notify rejected; waiting for resolve,, 19/07/17,13:25:34.901,Spotify::CallbackDebugMessage aMessage: ERROR: Metadata error -1400 19/07/17,13:25:34.901,Spotify::CallbackDebugMessage aMessage: WARNING: Notify rejected; waiting for resolve,, 19/07/17,13:25:34.901,Spotify::CallbackDebugMessage aMessage: Error retrieving metadata; permanent failure. (-1400) 19/07/17,13:25:34.901,Spotify::CallbackDebugMessage aMessage: WARNING: Continuing with stale metadata.,, 19/07/17,13:25:34.901,Spotify::CallbackDebugMessage aMessage: TL got last_abs_index 0
Possibly duplicate of #602 #598