HubSpot timeline API in background with OAuth token

oauth
timeline

#1

Hi,

How can I integrate Timeline API into my project where any action made by user will create a timeline in background job?

I read that it requires OAuth token, but if my website is hosted then how much time OAuth token will be valid?

Does that means I need to login ONLY ONCE to obtain token after that from background I can refresh token?


#3

Hi @yogen,

As outlined in this article, OAuth tokens expire after 6 hours. You can then use the refresh token to get a new access token which will last another 6 hours. It is certainly possible to set up automation to repeatedly refresh your integration's access token every 6 hours. The refresh_token you receive when initiating the OAuth connection does not expire, so you can keep using it to refresh the access_token.

Do you have any other specific questions after reviewing the Timeline API overview documentation? I also found this similar topic relating to authenticating the Timeline API.


#4

@Isaac_Takushi Thanks for quick reply.

What I understood is, After hosting my app, I need to LOGIN Only once to get initial token and refresh token.

After that, I can use refresh_token in background job to get updated token every time without being worried about expiration.


#5

That's correct, @yogen! Once you get the refresh_token, you can use it whenever you need a new access_token. The refresh_token does not expire.


#6