spotify / web-api-examples

Basic examples to authenticate and fetch data using the Spotify Web API
Apache License 2.0
1.99k stars 1.67k forks source link

I keep getting Response status: 400 Bad Request when trying to authorize #129

Open Faervan opened 8 months ago

Faervan commented 8 months ago

I read through the docs and looked at the example, yet when I try to get my access_token, I keep getting Response status: 400 Bad Request. What is wrong with my Request?

Request { method: POST, uri: https://accounts.spotify.com/api/token, version: HTTP/1.1, headers: {"authorization": "Basic MyBase64String="}, body: "grant_type=client_credentials" }
Response status: 400 Bad Request
Request { method: POST, uri: https://accounts.spotify.com/api/token, version: HTTP/1.1, headers: {"content-type": "application/x-www-form-urlencoded", "authorization": "Basic MyBase64String="}, body: "grant_type=client_credentials" }
Response status: 400 Bad Request
hoai97nam commented 2 months ago

@Faervan try a node sample code and call by fetch from client side or test on postman. It worked for me