APIs & Integrations

thulani
Member

Request fails with required scopes when scopes appear to be set

SOLVE

I have a couple of requests that fail in an environment that makes use of OAUTH with the message that the appl has not been granted all required scopes to make the call. The requests of course succeed when a PAT is used in a developer environment. This is happening in the sandbox account (Starter CRM Suite)

 

One specific request that is failing is the fetching of owners using the crm/v3/owners api. I am experiencing the same with updating deal if the change includes a pipeline/stage change and with creating custom object records. Using the first example of the owners, the documentation states that I need the crm.objects.owners.read scope which I can confirm is set for the application.

 

thulani_0-1683916898689.png

 

Please kindly assist.

 

See a complete sample of my request with OAUTH from Postman and the error details:

 

 

 

curl --location 'https://api.hubapi.com/crm/v3/owners/339425621' \
--header 'Authorization: Bearer token'

 

 

 

 

 

{
    "status": "error",
    "message": "This app hasn't been granted all required scopes to make this call. Read more about required scopes here: https://developers.hubspot.com/scopes.",
    "correlationId": "d7894a07-2658-4211-b64b-b80960dc570f",
    "errors": [
        {
            "message": "One or more of the following scopes are required.",
            "context": {
                "requiredGranularScopes": [
                    "crm.objects.owners.read"
                ]
            }
        }
    ],
    "links": {
        "scopes": "https://developers.hubspot.com/scopes"
    },
    "category": "MISSING_SCOPES"
}

 

 

 

0 Upvotes
1 Accepted solution
JBeatty
Solution
Guide | Diamond Partner
Guide | Diamond Partner

Request fails with required scopes when scopes appear to be set

SOLVE

Hi @thulani,

 

One thing that I can think of that would cause this is if the app was installed previously with different scopes, and you could have changed the scope afater installation but that does not modify the scope of the token you already have. I would attempt to re install the app and see if the problem persists.

 

Best,

✔️ Was I able to help answer your question? Help the community by marking it as a solution.

Joshua Beatty
Software Developer with Pearagon

Still have questions? Let's Talk

View solution in original post

0 Upvotes
5 Replies 5
JBeatty
Solution
Guide | Diamond Partner
Guide | Diamond Partner

Request fails with required scopes when scopes appear to be set

SOLVE

Hi @thulani,

 

One thing that I can think of that would cause this is if the app was installed previously with different scopes, and you could have changed the scope afater installation but that does not modify the scope of the token you already have. I would attempt to re install the app and see if the problem persists.

 

Best,

✔️ Was I able to help answer your question? Help the community by marking it as a solution.

Joshua Beatty
Software Developer with Pearagon

Still have questions? Let's Talk

0 Upvotes
APal25
Member

Request fails with required scopes when scopes appear to be set

SOLVE

Hello.
I had a similar problem with the HubSpot module in Make. If you select All fields in the View method, it gives an error.
If you choose a compact one, everything works. The problem is that I need All Fields to work...
Can you suggest what the problem might be?

Thank you!
Знімок екрана 2023-07-24 о 21.05.37.pngЗнімок екрана 2023-07-24 о 21.05.18.png

 

 

NBox
Member

Request fails with required scopes when scopes appear to be set

SOLVE

the same situation.

did you resolve this problem?

0 Upvotes
thulani
Member

Request fails with required scopes when scopes appear to be set

SOLVE

Hi

 

Yes, the issue was that when scopes change after and application is installed, it needs to be reinstalled. This actually makes sense considering there is a consent page showing what an application has access to during installation, so scopes cannot just be changed without reconsent.

 

I also marked the correct response as an answer and put down a comment to also confirm this.

0 Upvotes
thulani
Member

Request fails with required scopes when scopes appear to be set

SOLVE

Thanks for the assistance. Indeed we just needed to reinstall the application

0 Upvotes