APIs & Integrations

ympertonjd
Mitglied

Get PortalId when creating AccessToken

I'm working with webhooks that work with different clients. And so each client has their own access token. 

Now when I have a client create a Contact, I only get the objectId of the contact that was created, so I need that client's accessToken to retrieve the correct data for that contact. 

But in the webhook I don't know which client created it. 

 

If portalId is the determining factor, how would I know when that client created their access token that they correspond to that portalId?

Thank you.

0 Upvotes
1 Antwort
Mike_Eastwood
Autorität | Gold Partner
Autorität | Gold Partner

Get PortalId when creating AccessToken

Hi @ympertonjd 

 

Somewhere during the OAuth process the HubID is returned in the JSON (can't remember which step sorry).

 

You can get the HubID from the token with the API:

https://developers.hubspot.com/docs/methods/oauth2/get-access-token-information

 

Have fun

Mike