API Connector - Spotify

Hi,
I am creating an app that allows users to search for a song and get search results from Apple Music, YouTube and Spotify.

But I’ve been having issues with Spotify. I am using API Connector to get results from spotify but since Spotify’s access tokens expire in a hour, I’ve been trying to use refresh token to refresh access token automatically. I couldn’t make it happen…

If anyone here uses API Connector to connect to Spotify, I would really appreciate if you help me.

Thanks!

Anyone?

If you are not trying to see a users personal Spotify data, then you can just use the implication Grant flow described here (scroll down until you find it) https://developer.spotify.com/documentation/general/guides/authorization-guide. Then you don’t need to worry about refresh tokens.

Hope that helps!

Hi, I have been using successfully the Spotify Authentification Code Flow.

I think that using the Bubble API Connector with OAuth2 User-Agent Flow Authentification may handle the refresh token by itself, am I wrong ?

Otherwise, you can create your own Bubble Workflow reproducing the Spotify authentification flow. Every time you launch your app or use the Spotify API you can check if your actual token is expired or not, if yes, regenerate a new token with the refresh token.

You should follow this use case here : Google Calendar API use case
It’s not Spotify but the process is exactly the same.
Let me know if you struggle, I did it few days ago using this guide.