Hello everyone. I'm using Paragon to authenticate to Hubspot, and using their SDK to make my API calls. I'm trying to fetch the deals, but upon running the following code
const res = await paragon.request("hubspot", "/crm/v3/objects/deals", {
method: "GET"
});
I get back the following error:
{
...
"errors": [
{
"message": "One or more of the following scopes are required.",
"context": {
"requiredScopes": ["contacts"]
}
}
],
...
}
But, I thought the contacts scope had been deprecated in favour of crm.objects.contacts.read and crm.objects.contacts.write (which I actually have).
What gives? There is some complications in that Paragon won't allow me to add the missing scope (as they have flagged it as deprecated or so it seems) so I'm trying to figure out what's wrong. Can anyone help?
Hey Jaycee, thanks for replying! Turns out the issue was way easier than expected: the API was just lying straight to my face. The error message as you can see above explicitly states that the missing scope was "contacts". It was not: it was "crm.objects.deals.read". Extremely simple fix, but I believe that somewhere in the Hubspot code there might be an error and that very misleading message gets generated.
It will not be possible to trouble shoot the Paragon side of things. Our best move is to verify the endpoint works while using the minimum required scopes.
My suggestion is to verify you have the granular scopes for deals added. If the issue persists, I'd reach out to Paragon support and inquire why their app is attempting to use a depreciated scope instead of the granular scopes. Here's an article with more details — Contacts scope migration for app partners.
Hey Jaycee, thanks for replying! Turns out the issue was way easier than expected: the API was just lying straight to my face. The error message as you can see above explicitly states that the missing scope was "contacts". It was not: it was "crm.objects.deals.read". Extremely simple fix, but I believe that somewhere in the Hubspot code there might be an error and that very misleading message gets generated.