Announcements

Help Wizard

Step 1

NEXT STEP

405 Method Not Allowed on PUT /v1/me/player Despite Correct Scopes

405 Method Not Allowed on PUT /v1/me/player Despite Correct Scopes

Hello, I am developing a web app using the Web Playback SDK and the Authorization Code with PKCE flow. I am able to successfully complete the entire authentication process. I am requesting the following scopes: `streaming`, `user-read-private`, and `user-modify-playback-state`. After logging in with a Premium account, I successfully get an access token and a device_id from the Web Playback SDK 'ready' event. My goal is to start playback on this new device. To do this, I am trying to make the device active by sending a `PUT` request to `developer.spotify.com` with the following body: `{ "device_ids": ["YOUR_DEVICE_ID"], "play": true }` However, the API consistently returns a `405 Method Not Allowed` error. I have confirmed this with a direct cURL command, which also gets a 405 response, and the response headers say `Allow: GET, HEAD`. The documentation states this endpoint accepts PUT. Can you please tell me why I would be receiving a 405 error? Am I missing a different scope or using the wrong process to make the SDK's player active? Thank you.

Reply
1 Reply

Hi @welcomenigel 

Thanks you for posting in the Spotify Community!

 

I understand you are trying to send a PUT request to `developer.spotify.com`.

This does not work, because the API endpoint is `https://api.spotify.com/v1/me/player/play`

You can read the full documentation on this page.

 

Cheers!

XimzendSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

Suggested posts

Let's introduce ourselves!

Hey there you, ย  Yeah, you!ย 😁 ย  Welcome - we're glad you joined the Spotify Community! ย  While you here, let's have a fun game and getโ€ฆ

ModeratorStaff / Moderator/ 4 years ago  in Social & Random