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 Upvotes
3 Replies 3
Jaycee_Lewis
Community Manager
Community Manager

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

 


Join us on March 27th at 12 PM for the Digital Essentials Lab, an interactive session designed to redefine your digital strategy!
Engage with expert Jourdan Guyton to gain actionable insights, participate in live Q&A, and learn strategies to boost your business success.
Don't miss this opportunity to connect and grow—reserve your spot today!


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !
0 Upvotes
Jaycee_Lewis
Community Manager
Community Manager

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


Join us on March 27th at 12 PM for the Digital Essentials Lab, an interactive session designed to redefine your digital strategy!
Engage with expert Jourdan Guyton to gain actionable insights, participate in live Q&A, and learn strategies to boost your business success.
Don't miss this opportunity to connect and grow—reserve your spot today!


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !
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 Upvotes