Beginner: Issues with initiating Integration


#1

Hello all!

Full disclosure, I'm an absolute beginner with this and have gathered all I could from the OAuth 2.0 Documentation. I apologize in advance for improper phrasing and incorrect wordage.

I'm working on integrating a client's portal with a senior living specific CRM. I built the app, seemingly successfully authorized it into our client's portal, but I was told it should turn up in the integrations menu and it's nowhere to be found. I received an access token but am unsure what to do with it, especially as it's not turning up in the menu.

Any help would be greatly appreciated.


#2

Hi @Saera,

Can you give me your App ID and the Hub ID of the portal you tried installing the app to? If you successfully completed the OAuth flow, you should be seeing the app appear in the Integrations page.


#3

Ah, that's what I thought. I likely made a mistake somewhere along the way.

App ID: 168594
Hub ID: 2881057


#4

Hi @Saera,

Yea doesn't appear that there's anything installed in that portal except Eventbrite. Can you try going through the OAuth flow again? You said you're getting the code after being sent to your redirect_uri, and then you're successfully using that to get an access token?


#5

I'll go through it again and keep you posted. I'm not sure what code you're referring to, but I am getting an access token.

Whatever the opposite of beginners luck is, I have that. :expressionless:


#6

I tried going through the flow again, and it's becoming painfully apparent I must be missing something in the flow process. I think what I'm getting is actually a refresh token?


#7

Hi @Saera,

So here's the basic flow:

  1. User navigates to your authorization URL
  2. User selects their portal & approves the scopes you're requesting
  3. User is sent to the redirect_uri, and the authorization code is appended as a query parameter
  4. Your app collects the authorization code from that request & makes a request to obtain an access/refresh token
  5. Your app then uses the access token to make requests to the HubSpot API
  6. When the access token expires, your app uses the refresh token to obtain a new access token

Is there a specific step there where things aren't working as expected?


#8

I'm guessing it's happening at some point between step three and four? The refresh code looks like it's coming up in the query string, but I'm not seeing anything about an access token.


#9

Hi @Saera,

Got it, that's actually super helpful. So the code parameter you get isn't actually the refresh token or the access token, it's the authorization code. You need to take that code (and some other details about your app) and make a request to the refresh/access token endpoint (see below). That authorization code is just a temporary code used to get the access/refresh tokens required to make authenticated requests. I've also included an article that does a good job of explaining the full flow, just in case you're interested. The HubSpot auth flow is the Authorization Code Flow (the first entry).