I am hoping to get some guidance on writing to the HubSpot CRM API.
I am using the following to pull data from HubSpot via Azure Data Factory: Client ID Client Secret Access Token Refresh Token
My understanding is the access_token expires every 30 minutes but the refresh_token will continue to refresh this. This connection has been working for 7 days now. Does this refresh token expire? I have seen some places saying that it does not, and seeing it has worked for 7 days I am assuming this will continue to work.
Now when I go to write to the HubSpot API have an issue where my access_token is expired. I would think there is a way to use the refresh_token in the API POST?
Here is an example where I get the expiration response:
Store your access tokens and their expiry date in an external database. Then, before each HubSpot API request (other than OAuth requests), check to see if your existing access token is still valid. If not, use your refresh token to get a new one and update your database accordingly (including new access token expiry date).
I hope this proves useful. Please let me know if you have any follow-up questions.
All the best,
Zach
--
Zach Klein HubSpot Integrations & App Developer Meanjin / Brisbane, Australia
Store your access tokens and their expiry date in an external database. Then, before each HubSpot API request (other than OAuth requests), check to see if your existing access token is still valid. If not, use your refresh token to get a new one and update your database accordingly (including new access token expiry date).
I hope this proves useful. Please let me know if you have any follow-up questions.
All the best,
Zach
--
Zach Klein HubSpot Integrations & App Developer Meanjin / Brisbane, Australia
Thank you for the response! I was actually able to figure this out and forgot I had the post still up. I did exactly what you mention on option 1 and it works great.