Automate refresh token to gain access token for each API request in Python

I am trying to extract data on inactive/active users for my organization’s Zoom subscription and I’m trying to have this done using Python that will be triggered everyday. I am using the oauth method so the python code will have to generate new access token using the refresh token gotten from the first access token request that made use of the authorization code from the redirect url of the oauth app.

This code should be triggered automatically to get access token ->request for data->store them into SQL database. My problem now is that the refresh token for the oauth renew after every use. Is there any other simpler method to do this? My only thinking now is that after every access token request I need to store the new refresh token in a database and access it again for each new access token request.

Appreciate if anyone can suggest a better way to do this.

Which App Type (OAuth / Chatbot / JWT / Webhook)?

Which Endpoint/s?

Hi, @nazura97,

Thank you for posting in the Developer Forum – great question! You’re correct, you will need to store the latest refresh token in a database and access it for each new access token request. As you noted, the refresh token will become invalidated once a new access token to generate. For this reason, you want to make sure that you are using the latest refresh token to generate a new access token.


1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.