APIs & Integrations

TristanBM
Participant

Payments API - Can't retrieve subscriptions due to scope, despite having said scope.

Hi there,

I'm trying to fetch subscriptions via the Payments API, however I can't list subscriptions due to a scoping issue. The necessary scopes are in fact available for the access token that I'm using, however.

GET https://api.hubapi.com/crm/v3/objects/subscriptions
---
-snip-
"message": "One or more of the following scopes are required.",
"context": {
  "requiredGranularScopes": [
      "crm.schemas.subscriptions.read",
      "crm.objects.subscriptions.read"
  ]
}
-snip-

The scopes on the API Key:

GET https://api.hubapi.com/oauth/v1/access-tokens/REDACTED
---
-snip-
"scopes": [
"oauth",
"crm.objects.contacts.read",
"crm.schemas.contacts.read",
"crm.objects.companies.read",
"crm.schemas.companies.read",
"crm.objects.subscriptions.read",
"crm.schemas.subscriptions.read",
"crm.schemas.commercepayments.read",
"crm.objects.commercepayments.read"
],
-snip-

Is this a known issue, or am I doing something wrong here?
Thanks!

0 Votes
3 Réponses
Jaycee_Lewis
Gestionnaire de communauté
Gestionnaire de communauté

Payments API - Can't retrieve subscriptions due to scope, despite having said scope.

Hey, @TristanBM 👋 Can you confirm you have Payments enabled for this portal, please? The dev test portal I used didn't, and I didn't think about it before I made my original post.

My Payments page (not set up)

CleanShot 2024-04-25 at 15.40.07.png

Best,

Jaycee

 

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Votes
Jaycee_Lewis
Gestionnaire de communauté
Gestionnaire de communauté

Payments API - Can't retrieve subscriptions due to scope, despite having said scope.

Hey, @TristanBM 👋 Thanks for flagging this. I get the same error even with a net new Private App containing only the required granular scopes. 

Private App

CleanShot 2024-04-25 at 11.56.09.png

Request

curl --request GET \
  --url 'https://api.hubapi.com/crm/v3/objects/subscriptions?limit=10&archived=false' \
  --header 'authorization: Bearer YOUR_ACCESS_TOKEN'

Response

HTTP 403

{
  "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": "b4f8096c-68f7-4f4b-942d-b8d562cc7737",
  "errors": [
    {
      "message": "One or more of the following scopes are required.",
      "context": {
        "requiredGranularScopes": [
          "crm.schemas.subscriptions.read",
          "crm.objects.subscriptions.read"
        ]
      }
    }
  ],
  "links": {
    "scopes": "https://developers.hubspot.com/scopes"
  },
  "category": "MISSING_SCOPES"
}

 

I reported this to the dev doc team. I'll respond here when I get an update for us.

 

Best,

Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

TristanBM
Participant

Payments API - Can't retrieve subscriptions due to scope, despite having said scope.

Hey Jaycee, appreciate you forwarding it to the team.

I was curious if you had any updates to share? Still seems to be an active issue on my end.

0 Votes