APIs & Integrations

javi-tt
Member

Oauth2 authentication API

Hi,

We're starting a new integration with your system where we want to use the Oauth2.0. In our case, the connection will be through API calls.

How can we handle the Oauth2.0 authentication? We followed the steps defined at https://developers.hubspot.com/docs/methods/oauth2/initiate-oauth-integration

but we're not able to make it work.

App id = 145974
HUB id = 2978896

We have all the scopes checked. We pass all the scopes in the URL :
https://app.hubspot.com/oauth/authorize?scope=contacts+content+reports+social+automation+timeline+fo...

But still we dont manage to get the code from the url.

Uh oh!
Insufficient scopes were provided. Please contact the integrator.

Does that make sense? There's a way to retrieve the token without the 'obtain the code' part?

Best regards

0 Upvotes
1 Reply 1
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Oauth2 authentication API

Hi @javi-tt,

The issue is likely that you have all the scopes in the developer portal UI checked off. You should only check the scopes that are absolutely required for the integration to work, and you should leave the 'Add action forms' scope unchecked since that feature has been sunset.

Additionally, you should make sure that you're only including scopes that you need and have access to in your authorization URL. I can see that the transactional-email scope is included in the example URL you listed; if your portal doesn't have access to the transactional email add on, you won't be able to authorize the integration.

0 Upvotes