APIs & Integrations

Not applicable

HubSpot timeline API in background with OAuth token

SOLVE

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?

0 Upvotes
1 Accepted solution
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

HubSpot timeline API in background with OAuth token

SOLVE

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.

Isaac Takushi

Associate Certification Manager

View solution in original post

3 Replies 3
IsaacTakushi
HubSpot Employee
HubSpot Employee

HubSpot timeline API in background with OAuth token

SOLVE

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.

Isaac Takushi

Associate Certification Manager
0 Upvotes
Not applicable

HubSpot timeline API in background with OAuth token

SOLVE

@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.

0 Upvotes
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

HubSpot timeline API in background with OAuth token

SOLVE

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.

Isaac Takushi

Associate Certification Manager