Hi all,
After finishing OAuth flow, I try to query our customer’s companies with this API (Accounts Dashboard | HubSpot). But it returns a MISSING_SCOPES error even the access-token has the contacts scope that the document requires.
The request looks like
curl --request GET \
--url 'https://api.hubapi.com/crm/v3/objects/companies?limit=10&paginateAssociations=false&archived=false' \
--header 'authorization: Bearer CNDIlKPWLhICAQEYvNySBCDL3fAFKISTDjIZANv8EttwDJ6HhtvvIW-yauQP5Bl1o-D2pDoaAAAAQQAAAAAAAAAAAAAAAAAAAAAAAAAAABBCGQDb_BLbGxKE7P2DRww3OHYzMWqmdFbmwnY'
This is the response
{
"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": "2337d33b-c3bb-41eb-ae53-119c23784d22",
"errors": [
{
"message": "One or more of the following scopes are required.",
"context": {
"requiredScopes": [
"e-commerce",
"contacts",
"crm.objects.custom.read",
"crm.objects.custom.write",
"tickets"
]
}
}
],
"links": {
"scopes": "https://developers.hubspot.com/scopes"
},
"category": "MISSING_SCOPES"
}
I checked the permissions of the Access Token. It already has the `contacts` scope inside.
{"token":"CNDIlKPWLhICAQEYvNySBCDL3fAFKISTDjIZANv8EttwDJ6HhtvvIW-yauQP5Bl1o-D2pDoaAAAAQQAAAAAAAAAAAAAAAAAAAAAAAAAAABBCGQDb_BLbGxKE7P2DRww3OHYzMWqmdFbmwnY","user":"thien@duplexpoint.com","hub_domain":"hubspot-developers-lyfdhd.com","scopes":["contacts","oauth"],"scope_to_scope_group_pks":[25,31,205],"hub_id":8695356,"app_id":231812,"expires_in":19826,"user_id":12332747,"token_type":"access"}