So, the concept is that after you get the access token, you get an expiration time, and a refresh token. I use the access token to get the top tracks and artists. But I'm unsure of the process after that. You wait for the 3600 seconds, then you send the POST request with the refresh token. Then what? Do I have to do anything with the new access token? Do I infinitely use the refresh token to get new access tokens? And when I get the new access token, do I have to re-request the top tracks and artists?
Hopefully that's understandable,
Solved! Go to Solution.
I think you have the right idea; if you've already authenticated and you want to make a request, but you realize that your access token is expired, you have to send your refresh token to the refresh endpoint, where you get a new access token and refresh token. After you've done that you can make a request as you normally would.
The key thing to realize is that you should have some code that checks your token's expiration before every request you send.