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...
Plan
Premium
Country
Australia
Device
Desktop, Windows 10, Chrome
My Question or Issue
Hi, I'm making a react web app using Axios for fetch requests. My app already correctly sets a token and receives data from API endpoints such as 'https://api.spotify.com/v1/me/playlists'. All endpoints are working except PUT request endpoints. HOWEVER, if I use the developer console for PUT requests, they will work correctly, even using the token I get from my app.
The error: status: 401, message: "No token provided"
Example code request:
Solved! Go to Solution.
Hey thanks for the replies, i finally found a solution online. (alvaron, your solution had the same issue 'no token provided')
The problem is with Axios requests, for whatever reason the headers are not being sent in put/post requests but does with get, unless you structure the request differently.
To fix the issue I had to change how the request was written for put/post requests, see below:
Forgot to mention i have my scopes set up correctly:
There was once a weird issue we had with PUT Requests as they were blocked by the company Firewall.
Otherwise please provide the whole snippet with the token generation etc, maybe you have some quirks with your PUT endpoints you are not seeing eg. moved out of scope.
Hey, I think the problem is that you are sending the headers as body data. To solve this, you need to pass the headers as follows:
Hey thanks for the replies, i finally found a solution online. (alvaron, your solution had the same issue 'no token provided')
The problem is with Axios requests, for whatever reason the headers are not being sent in put/post requests but does with get, unless you structure the request differently.
To fix the issue I had to change how the request was written for put/post requests, see below:
This just saved my life- was searching for this error for like 10 hours. This is so dumb but thanks sm for the fix!
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…