Passing OAuth Token to further calls?

Hi all,

I’m having an issue with generating tokens via OAuth2. Hoping someone can offer some sage advice!

In short, I’m using API Connector to create a call that I intend to use as an action on my website. The action will delete a calendar event from my portal on livewebinar.com.

To do this, I need to 1)Request token, 2) get events, 3) delete target event. I have set this up in the below screenshots, but I’m running into the issue where I receive 401 (Unauthorized) errors after some time. I suspect this is because I am hard coding my tokens and they are expiring (you can see in the below pics that I have ‘Bearer’ followed by my token).

I want the authentication to happen on the backend (i.e. a user is not supposed to be transported to some login screen in order to generate a token). This is supposed to generate a token based on my own credentials.

Can someone please assist me in setting up my flow so that I don’t get a 401 error? Thanks so much!!

You should use custom or password oauth authentication.
You are right that your issue is refresh token and Bubble will handle it if you use it (normally, Bubble will handle it).

If you don’t want to use this (or Bubble is not abble to handle the refresh token part), you will need to store the refresh token and schedule an API workflow to get a new access_token. (and schedule another time the refresh token flow…)