APIs & Integrations

AAwachi
Member

API Key not working

I just made a new private app, replaced my old API key with the new Access Token and It's just not working and Is not connecting my site with hubspot. Is the API URL still https://api.hubapi.com ? Or did i need to do anything more then just make a private app? 

0 Upvotes
4 Replies 4
PAtlan
Contributor

API Key not working

It took me a while to understand, but the Access Token does not behave like an API Key. It behaves like an OAuth token. For example, if you try out one of the examples in the API documentation, you need to check OAuth instead of API (actually I just checked, and they've added a third option: Private App Access token ;-))

 

If you're like me and very unclear on authentication protocols, I'd suggest looking at the API Doc and/or trying to set up tests via Postman. It's great to understand what's going on.

Jaycee_Lewis
Community Manager
Community Manager

API Key not working

Hey, @AAwachi 👋 One question — how are you including your Private App key for authorization? Private App keys are not included in the request URL. You'll need to include it in the request header. Here is more information:

If you are including your Private App as a bearer token in the Authorization http header, can you share an example request and response, please? Along with the specific endpoint you are using. 

 

Thank you! — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

AAwachi
Member

API Key not working

I just added it here 

AAwachi_1-1667289963589.png

 

The old API key worked when I had it placed in the Access Key section but know when I am using private apps and paste the new access key in it's just not connecting, is the code need to be different?

0 Upvotes
jparakkalli
Member | Platinum Partner
Member | Platinum Partner

API Key not working

Same issue for me also. i am calling from Asp.net core  Skarp.HubSpotClient library like this

...

_hubspotContactClient = new HubSpotContactClient("token");

_hubspotContactClient.GetByIdAsync<MyModelClass>(12345);

...

 

0 Upvotes