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

I tried to create a simple app but get an error.

I tried to create a simple app but get an error.

I tried to create a simple app based on your basic example code  "I get this error This functionality is restricted to premium users only" even though I have a premium subscription. 

Plan

Premium Family

Country

UK

Device

(iPhone 8, Samsung Galaxy 9, Macbook Pro late 2016)

Operating System

(iOS 10, Android Oreo, Windows 10,etc.)

 

My Question or Issue

I tried to create a simple app but I get the error "This functionality is restricted to premium user" I am a premium user.

Reply
15 Replies

Did you get an Access Token by logging in using an Authorization Code flow? If not, that could be the problem.

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.

Thanks Ximzend Yes all that and just refreshed again this morning with curl -X POST "https://accounts.spotify.com/api/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials&client_id=my_client_id&client_secret=my_secret_id"

I see grant_type=client_credentials. You can't use the Client Credentials flow with this endpoint. Also, you can't authenticate/login with that 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.

Thank you again, I am still struggling to work out why I get the message "restricted to premium users" when I am premium. When I look at that workflow it states "The Client Credentials flow is used in server-to-server authentication", my app runs in the browser. 

I tried that snippet of code and still get error about premium user, maybe it is because am family premium and code looking for premium individual, frustrating  

Does this webapp plays music for you when "In Browser is selected after you choose a genre and press the Generate Playlist button? https://nelson-v2.glitch.me/

Edit: added the link

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.

Believe me, the endpoint you are trying to use requires user authentication, and that isn't supported by the 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.

That https://nelson-v2.glitch.me/ is kool it works great. 

That is for me a confirmation that your problem is not caused by the type of subscription you have, and is caused by the type if Authorization you chose.

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.

I am trying to create an app that will run in the browser what type Authorization is appropriate to use. 

I recommend using 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.

Hi Ximzend I got a good bit further with redirectUri:http://localhost:3000/callback and new flow i get the login access screen thank you. Then it fails with "

This site can’t be reached

localhost refused to connect." and screen2.png attachment

screen2.png
Screenshot from 2023-12-22 11-55-07.png

Same error on Firefox: 

Unable to connect

Firefox can’t establish a connection to the server at localhost:3000.

The site could be temporarily unavailable or too busy. Try again in a few moments.
If you are unable to load any pages, check your computer’s network connection.
If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the web.

 

Did you run it directly in the browser without a local testing server? If that is the case, here is a tutorial on how to set it up: https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Tools_and_setup/set_up_a_local_testi...

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.

Yep I need to read a bit more, to understand how the complete end-to-end flow works. 

Suggested posts

Let's introduce ourselves!

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…

ModeratorStaff / Moderator/ 4 years ago  in Social & Random