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

can't get Followed Artists - Client credentials authentication not allowed

Solved!

can't get Followed Artists - Client credentials authentication not allowed

 

I am trying to get Followed Artists:
https://developer.spotify.com/documentation/web-api/reference/get-followed

I am requesting Access Token:

 

 

CLIENT_ID=<client_id> &&\
CLIENT_SECRET=<client_secret> &&\
SCOPES=user-follow-read

curl -X POST "https://accounts.spotify.com/api/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials&client_id=${CLIENT_ID}&client_secret=${CLIENT_SECRET}&scope=${SCOPES}"

 

 

with generated Access Token I am trying to get followed artists:

 

 

TOKEN=<token>

curl -X GET \
--url 'https://api.spotify.com/v1/me/following?type=artist&limit=50' \
--header "Authorization: Bearer ${TOKEN}"

 

 

curl returns:

 

 

{
  "error" : {
    "status" : 400,
    "message" : "Client credentials authentication not allowed"
  }
}

 

 

what is wrong here? 

Reply

Accepted Solutions
Marked as solution

You can get your own AT through another flow that is not the Client Credentials flow, listed on here: https://developer.spotify.com/documentation/web-api/concepts/authorization

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.

View solution in original post

3 Replies

"Since [the Client Credentials] flow does not include authorization, only endpoints that do not access user information can be accessed." - https://developer.spotify.com/documentation/web-api/tutorials/client-credentials-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.

you can get Access Token when making request in console (after you logged in):

https://developer.spotify.com/documentation/web-api/reference/get-followed

and use it later on (until TTL) with curl

 

BUT you can't generate your own AT.

Marked as solution

You can get your own AT through another flow that is not the Client Credentials flow, listed on here: https://developer.spotify.com/documentation/web-api/concepts/authorization

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