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

A token problem

A token problem

 

Plan

Premium

Country

Colombia

Device

Huawei Matebook D14

Operating System

Windows 11

 

My Question or Issue

In my code I get an error regarding the tokens or so I understand.
The error it shows me is the following:
HTTP Error for POST to https://api.spotify.com/v1/users/0cxaozs3a5z8m26vwzzc80wb9/playlists with Params: {} returned 403 due to Insufficient client scope
Traceback (most recent call last):
File "C:\Users\Cgalv\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\spotipy\client.py", line 269, in _internal_call
response.raise_for_status()
File "C:\Users\Cgalv\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\requests\models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://api.spotify.com/v1/users/0cxaozs3a5z8m26vwzzc80wb9/playlists

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\Users\Cgalv\OneDrive\Desktop\Project\spotify2.py", line 23, in <module>
playlist = sp.user_playlist_create(user=sp.me()["id"], name=playlist_name, public=False)
File "C:\Users\Cgalv\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\spotipy\client.py", line 816, in user_playlist_create
return self._post("users/%s/playlists" % (user,), payload=data)
File "C:\Users\Cgalv\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\spotipy\client.py", line 326, in _post
return self._internal_call("POST", url, payload, kwargs)
File "C:\Users\Cgalv\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\spotipy\client.py", line 291, in _internal_call
raise SpotifyException(
spotipy.exceptions.SpotifyException: http status: 403, code:-1 - https://api.spotify.com/v1/users/0cxaozs3a5z8m26vwzzc80wb9/playlists:
Insufficient client scope, reason: None

I have no idea why this is happening, so i hope you can help me guys

 

Reply
1 Reply

Can you please post your code, so I can check it?

The problem can be that you are trying to use Client Credentials when Authorization is required, or/and not using the required Playlist scopes (click link for all of them).

XimzendRising 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