GET request for contacts returns a 403 error

Hi,

I am new to Hubspot Developers. I am trying a very simple GET request using this article for instructions. I have generated an API Key (this article says I don’t need OAuth), and here is my request:

https://api.hubapi.com/contacts/v1/lists/all/contacts/all?hapikey={{redacted}}

(I will change API Key after fixing this issue, so I’m posting it publicly here on purpose so you can see the error).

If you visit that link, you will notice a 403 error, saying:

This hapikey ({{redacted}}) does not have proper permissions! (requires all of [contacts-read])

I checked over and over again, and I cannot figure out where exactly can I enable the neccessery permissions for this API Key. Can someone help?

Hey @Justinas,

Based on the hapikey provided, I was able to confirm that you’re using the developer portal’s API key instead of the portal API key.

The developer API key is used when managing settings related to your HubSpot apps through the API. (Developer API keys)

When looking to authenticate for this endpoint Get all contacts | Contacts API, you’d need to use the portal HubSpot API key. In which you can locate it under settings > integrations > API Key (More details here: Access your HubSpot API key).

Additionally, while I have redacted your dev api key, I’d highly recommend you to regenereate your developer API key since it has been surfaced on the public forum for days. Moving forward, please avoid sharing your API key on the public forums. Thank you!

@WendyGoh, thank you very much for taking the time to reply! Your solution is correct. I was unaware that the portal can have it’s own API key, I believed that this is what developer portal is meant for. Thanks for clearing that up. I have also changed the API key just now.
Thanks again!