APIs & Integrations

yoram
Member

B2B Integration

SOLVE

Hi,

I’m new to HubSpot and managed to workout the API - wow :slight_smile: But there is something I don’t get.

To get the access code, you need https://app.hubspot.com/oauth/authorize you are redirected to a page and need to select a GUID (code) for the next call to get the OAuth? So far so good but then this code cannot be reused and the next call https://api.hubapi.com/oauth/v1/token has an expiry on the access token. I can’t see how, having to select and grant permission as a user in a browser, will work with an automated batch process that wants to update hubspot.

What am I doing wrong? Is there another way? Maybe by IP address or permanent token?

Yoram

0 Upvotes
1 Accepted solution
Dadams
Solution
HubSpot Employee
HubSpot Employee

B2B Integration

SOLVE

Hi @yoram

When you use the code to get your first access token, you’ll also get a refresh token. That refresh token can be used to generate a new access token whenever the existing access token expires.

Refresh OAuth 2.0 Access Token

POST /oauth/v1/token

View solution in original post

0 Upvotes
1 Reply 1
Dadams
Solution
HubSpot Employee
HubSpot Employee

B2B Integration

SOLVE

Hi @yoram

When you use the code to get your first access token, you’ll also get a refresh token. That refresh token can be used to generate a new access token whenever the existing access token expires.

Refresh OAuth 2.0 Access Token

POST /oauth/v1/token

0 Upvotes