Type in your question below and we'll check to see what answers we can find...
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.
Hello I have a problem setting up a simple aplication.
The goal of this application is to enable anyone who has an url to my web app to adjust volume of my music playing ( mainly for neighbors , but the project goal is to educate mysef in spotify API and Nuxt.js ).
Im using 3 methods:
1. Getting the token using client_id and client_secret.
2. Getting devices to pre-fill input with current volume.
3. Sending a request to set new volume based on the input.
methods 2 and 3 work as intended if i hardcode tokens that i get from live test
for example : https://developer.spotify.com/console/get-users-available-devices/ and i use get token button. but the problem is that the first metod return an invalid token ( i get an error that username is invalid, I can't see what am I doing wrong. Client id and secret are generated from my spotify App. I belive that I'm really close to finishing this but I'm stuck at this step
Solved! Go to Solution.
You'll need to make a webpage that implements the Authorization code flow (shown here) that lets you log in with your credentials, and prints out an access token and a refresh token. The required scope is user-modify-playback-state. (If everything works, you can remove this page.)
You can store the access token and the refresh token in a file or database on your server. After that, you can make a client side page with volume controls that sends requests to a server-side script that uses those tokens to make a API request to control the volume. (Maybe there is more code required than I described.)
I am not familiar with the Node.js wrapper, but it must ve documented what it does or you should do when the access token expires.
If you get a new access token and/or refresh token, those should replace the old ones stored on your server. (If you don't get a new refresh token, you can reuse the old one.)