Announcements

Help Wizard

Step 1

NEXT STEP

Device ID Retrieval Not Working

Device ID Retrieval Not Working

I'm trying to get a list of device id's connected to my spotify account but when I run my code to retrieve my device information it does not seem to work. I was able to get my auth token through Curl but not device information. This is the code i'm using 

curl --request GET \
--url https://api.spotify.com/v1/me/player/devices \
--header 'Authorization: Bearer "Access Token" '

I've obviously replaced "access token" with mine but it still doesn't work. Please help, this is the error which I get

{
"error": {
"status": 404,
"message": "Invalid username"
}
}

Reply
1 Reply

You aren't able to use the access token with that endpoint, because the token you'll get with Curl is a token for endpoints that can only be used with Client Credentials.

You'll need to get an access token through the Authorization Code Flow (with the required scopes) if you want to use that endpoint. That's not possible with Curl.

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