Skip to content
This repository has been archived by the owner on Jul 4, 2020. It is now read-only.

Spotify api error 404: no active device found. How to fix? #1325

Open
marcz2007 opened this issue Aug 18, 2019 · 5 comments
Open

Spotify api error 404: no active device found. How to fix? #1325

marcz2007 opened this issue Aug 18, 2019 · 5 comments

Comments

@marcz2007
Copy link

marcz2007 commented Aug 18, 2019

Issue found on August 1st 2019.

Endpoint(s):

PUT https://api.spotify.com/v1/me/player/play

Scope(s):

  • None (application is not using authentication)

Steps to reproduce:

  1. Create online web app
  2. Don't have been playing anything on Spotify app on the device for a while
  3. Spotify api PUT request from app
  4. Error: no active device
  5. Play something and pause it on Spotify
  6. Spotify api PUT request from app
  7. Successful playing of song

Expected behaviour:

For the device to always be Active.

Actual behaviour:

Inconsistent 404 error.

Body of post:

I have been using the Spotify api and have been receiving this '404 no Active device' error quite a bit. If I play a song on Spotify and pause it after receiving the error, the error goes away and I am able to send the PUT request to PLAY a song on Spotify from my app.

However if the device has been left without playing a track on Spotify then I receive the same error.

How long after using Spotify to play a track does it take until Spotify api deems the Spotify account/device as inactive? Is there a way to set devices as always being active so I don't have this problem?

@0xNF
Copy link

0xNF commented Aug 18, 2019

This has been the behavior of the playback APIs for as long as they've been around. It's really infuriating, and would be nice to see it remedied.

@dkiesow
Copy link

dkiesow commented Oct 3, 2019

Is there any sort of workaround to wake the device via the API? Using the desktop client or mobile app first works but entirely defeats the point of these API calls.

@Prash-JD
Copy link

Can you try this ,
"/v1/me/player/play?device_id=" + deviceID;

deviceID Can Be Active Or Not Active .

@maurotrentini
Copy link

I have the same issue. My windows 10 PC is not detected and the API returns an empty list ;(

@7ellipsis
Copy link

I was having the same issue and a workaround this issue is sending the device id with the play request URL. The problem is when sending request to the API it does not find any active device and hence the error, which is bad because if a device is asking a call then it is active and the API should understand that.
When from another spotify client the current device is selected and song is played, it works because the current device id active status is set true. You can do the same with your request. Just give the device id as the current device it, which will set it to active and will play the song.
https://api.spotify.com/v1/me/player/play?device_id="+this._device_id
Worked for me. Hope this helps.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants