Announcements

Help Wizard

Step 1

NEXT STEP

FAQs

Please see below the most popular frequently asked questions.

Loading article...

Loading faqs...

VIEW ALL

Ongoing Issues

Please see below the current ongoing issues which are under investigation.

Loading issue...

Loading ongoing issues...

VIEW ALL

Seeking Assistance: Receiving 401 Error when Creating a Playlist on Spotify

Seeking Assistance: Receiving 401 Error when Creating a Playlist on Spotify

Hello,

 I am reaching out to seek assistance regarding an issue I've been facing while attempting to create a playlist on Spotify. Unfortunately, I keep encountering a persistent 401 error, which indicates an authentication or authorization problem.

Here's a brief description of the issue:

  • Problem: When I try to create a playlist using the Spotify API, I consistently receive a 401 error.
  • Context: I have checked my credentials and verified that they are accurate. Additionally, I have ensured that the required scopes for playlist creation (playlist-modify-private or playlist-modify-public) are included. However, the error persists.
  • Troubleshooting: I have followed the suggested troubleshooting steps, including refreshing the authentication token, reviewing my API keys, verifying permissions, and clearing cache and cookies. Unfortunately, none of these actions have resolved the issue.

I am using Reactjs and axios for my project and would appreciate any guidance or insights from anyone who has experienced a similar problem or has expertise with the Spotify API. If you have any suggestions, workarounds, or advice on how to overcome this 401 error and successfully create playlists on Spotify, your assistance would be highly appreciated.

Thank you in advance for your time!

 

P.S I have attached my code as well. 

 

Best regards, Mondayy

Reply
3 Replies

I don't see a client secret in your code, so did you implantaten the Authorization Code with PKCE Flow?

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.

No I used the Authorization code flow without the PKCE Flow. Do I need to do PKCE Flow?

That's a mistake from my side. I didn't know you didn't have to use the client secret in one case of the Authorization Code flow.

Because I couldn't fix it myself, I asked ChatGPT.

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