B2B Integration


#1

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


#2

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.