How do I schedule getting an auth token and use that token in another API call?

The API I’m accessing is OAuth 2.0 and requires that I get a token every 24 hours, then use that token in another API call to get the info I need. I have the API call setup to get the token working fine use the settings of Use as Data which I assumed saved it somewhere, but I don’t see where to access it. How do I schedule getting this token and store it so I can use it for my other API call?

The JSON returned from the call to get the token also contains how many seconds the token is good for. So I’m assuming I can build a backend workflow schedule somehow that gets a new token if the current one is expired and replaces it in the DB and then somehow use that entry to make the other call.

I agree, a backend flow might be needed to trigger the api call, save the returned token and its duration, and reschedule.

Some APIs require these temporary tokens and it gets tedious…

Look for Bubble’s backend flows and enable it

You probably should not renew the token if you are not going to use it.

Instead you can check the expiry before making a call and renew the token then.

1 Like

Can someone walk me through creating a backend workflow to generate the token and show me how I access the token after it’s generated? I’ve been messing around with backend workflows for hours and haven’t figured it out.

1 Like