We are trying to reach https://api.hubapi.com/crm/v3/objects/leads?limit=1 and getting One or more of the following scopes are required.",“context”:{“requiredGranularScopes”:[“crm.objects.leads.read”] , but we do have this scope.
Request:
curl “https://api.hubapi.com/crm/v3/objects/leads?limit=1” \
-H “Authorization: Bearer $ACCESS_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”:“aee8f1fe-41c9-4744-a42e-87c7fdf8e09b”,“errors”:\[{“message”:"One or more of the following scopes are required.”,“context”:{“requiredGranularScopes”:[“crm.objects.leads.read”]}}],“links”:{“scopes”:“https://developers.hubspot.com/scopes"},“category”:"MISSING\_SCOPES”}%
Confirming we have the scopes:
curl -sS “https://api.hubapi.com/oauth/v1/access-tokens/$ACCESS_TOKEN” | jq ‘{hub_id, app_id, user, scopes}’
{
“token”: “Redacted”,
“user”: “Redacted”,
“hub_domain”: “Redacted”,
“scopes”: [
“oauth”,
“crm.lists.read”,
“crm.objects.contacts.read”,
“crm.objects.marketing_events.read”,
“crm.schemas.custom.read”,
“crm.objects.custom.read”,
“crm.schemas.contacts.read”,
“crm.objects.companies.read”,
“crm.objects.deals.read”,
“crm.schemas.companies.read”,
“crm.schemas.deals.read”,
“crm.objects.quotes.read”,
“crm.objects.invoices.read”,
“crm.schemas.invoices.read”,
“crm.objects.carts.read”,
“crm.pipelines.orders.read”,
“crm.schemas.orders.read”,
“crm.objects.orders.read”,
“crm.objects.leads.read”
],
“signed_access_token”: {
“expiresAt”: Redacted,
“scopes”: Redacted,
“hubId”: Redacted,
“userId”: Redacted,
“appId”: Redacted,
“signature”: Redacted,
“scopeToScopeGroupPks”: Redacted,
“newSignature”: Redacted,
“hublet”: “na1”,
“trialScopes”: “”,
“trialScopeToScopeGroupPks”: “”,
“isUserLevel”: false,
“installingUserId”: 0,
“isServiceAccount”: false,
“isPrivateDistribution”: false
},
“token_type”: “access”,
“user_id”: redacted,
“app_id”: 3725241,
“hub_id”: 20523459,
“expires_in”: 1725,
“is_private_distribution”: false
}