HubSpot OAUTH2 API Credentials

Hi there, I’ve been trying to set an OAUTH2 API credential to connect with HubSpot.

Why don’t I use the native HubSpot OAuth credential?

  • Because I need scopes that are not included in the native credential. I’ve managed to connect the native one, but it lacks the requests I need. So I figured I’d do it via HTTP requests node.
    I’m trying to create Users in HubSpot via API.

The problem is that I can’t manage to get the URL query parameters right. I’ve tried slicing the authorization URL in every way, didn’t work.
I’ve tried:

  • putting the entire URL at the “Authorization URL”
  • putting the rest of the URL at “Auth URI Query Parameters” field
  • putting just part of the query (like scopes, redirect URL)

Nothing worked. I imagine I’m passing the query parameters wrong. Can you help me get this right, please?

Thank you in advance!!

@Matheus_Jiran Welcome to the community.

OAuth URI Query Parameter should be set to grant_type=authorization_code

Authentication should be set to body.

Also, I think there is a bug with Hubspot OAuth2 and the HTTP Request. It was discussed here. It seems like it will connect, but after the token is expired (every 6 hours?), the HTTP node will not refresh it.

Will try to have a look at it as soon as I can.

Hey @RicardoE105! Thank you!!

I tried setting it up with the grant_type=authorization_code and authentication set to body. But it didn’t connect.

Here is a Gif of what happened. The connection and the callback seem to fail.

By the thread you sent,I notice that we have a problem refreshing the token. So we’ll be following up with the token refreshing issue as well.

Thank you for the quick reply!!