How to solve missing scope error?

I am sending a request to get list of contacts: {{baseUrl}}/crm/v3/objects/contacts?hapikey=xxx

but got this error:

This app hasn’t been granted all required scopes to make this call

I have added all scopes to my app in hubspot console. Why still get this error?

Hello @JZhao

Have you set up OAuth for this app to connect to a portal?

Which hapikey are you using? From your developer account or from the portal?

I would highly recommend walking through the OAuth process if you are connecting an app. Otherwise, you will need the hapikey from the portal.

My api key is “xxc” which I can get from the hubspot website. It doesn’t seem to relate to any app. It is shown in the top right of the app list page, there is a button “Get Hubspot API Key”. If I use this api key, how can I set the scope when I call hupspot API?

With regards to oauth, I have read this doc https://developers.hubspot.com/docs/api/workin.g-with-oauth but I am not going to use the redirect URL. What I need is to authorise my backend to use hubspot rest API to manage contacts and companies or any other objects. So there is nothing to be installed from users perspective. Based on that, do I need to setup oauth. If yes, what should I do.

Hi @JZhao

It really depends on if you plan making this app available to others to use on a marketplace or if you plan on using it just for your own portal. If you are doing it only for yourself, you dont even need to create a developer account. You can set up your backend on any hosting service that can run your code language and use the portal API key. If you plan on making this available as an app that is used on more than one portal, this is when you need to use the developer account, create an app and use OAuth.

Hi,

what does “app” mean? I am planning to create some card or extention. Do I need to use developer account? There will be mutiple portal in my account. Do I need to create develop account for each portal account?

Hello @JZhao

An app will live within the developer account. You can connect one app to many portals

Here is a link to get started with a developer account!

Good luck!