Type in your question below and we'll check to see what answers we can find...
Loading article...
Submitting...
If you couldn't find any answers in the previous step then we need to post your question in the community and wait for someone to respond. You'll be notified when that happens.
Simply add some detail to your question and refine the title if needed, choose the relevant category, then post.
Before we can post your question we need you to quickly make an account (or sign in if you already have one).
Don't worry - it's quick and painless! Just click below, and once you're logged in we'll bring you right back here and post your question. We'll remember what you've already typed in so you won't have to do it again.
Please see below the most popular frequently asked questions.
Loading article...
Loading faqs...
Please see below the current ongoing issues which are under investigation.
Loading issue...
Loading ongoing issues...
Hello,
I'm currently on Step 2 (Requesting Access Token) of the Auth Code Flow using PKCE, but I am unable to retrieve the access token.
Problem
I am receiving a 400 Bad Request when sending my POST request to the https://accounts.spotify.com/api/token endpoint.
Code SnippetCode
Everything seems correct when I output to the console, but it seems like I'm missing something.
Please help
Edit:
To make it easier to check my work I will reference the Auth Code Flow documentation here and where that can be found in my code (above).
same issue. did you figure it out?
I have the same problem when trying to refresh my token.
I'm sending a POST-request to endpoint "https://accounts.spotify.com/api/token" and getting 400 "Invalid request". No error message. I just don't get what the problem is.
Payload:
{
"refresh_token": [my refresh token],
"grant_type": "refresh_token",
"client_id": "[my client id]"
}
Headers.
{
"Content-Type": "application/x-www-form-urlencoded"
}
Are you able to fetch the auth_token the first time around? I have the same issue and keep getting invalid code_verifier when it is exactly the same as generated. Happy to pair program if you’d like, 2 pairs of eyes > one
Did you get a successful auth token the first time around using PKCE?
Any news on this? i kinda have the same issue. Everything was working perfectly fine and out of nowhere i always get TIMEDOUT on https://accounts.spotify.com/api/token
I've run into the same issue and wondering if there has been any update?
Just putting this for future devs; I was able to make it work by changing "Content-Type" to "content-type"
Did you solve this problem?
If not, is the line "- headers.Authorization = base64 encoded(<client_id environment variable>:<client_secret environment variable>)" necessary in your headers?
Separately, I'm also having this problem.
Bryan-BC's solution didn't work for me, unfortunately.
Same, Bryan solution didn't work either. Any further clue from someone?
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…