Insufficient Scopes

Hello, we make a call to the the Get analytics data for specific objects using the

event-completions

object and

total

for the time_period, we get a forbidden error saying “Insufficient scopes: requires event-analytics-api-access”. I do not see that scope in the list of scopes in the Oauth 2.0 docs. Why did this suddenly start failing?

Hi @Wes4 , Can you provide your App ID and the HubID of the account you’re making requests to? Happy to take a closer look here - I don’t think there were any scope changes on our end recently. Per the docs, you should be requesting the business-intelligence scope:

Sure, our AppID is 63251, and the HubID I am currently using is 127518. I have tried it with multiple HubIDs and they all fail.

The request looks like this:

https://api.hubapi.com/analytics/v2/reports/event-completions/total?start=20181231&end=20190301&limit=300&offset=0

The access token definitely includes the business-intelligence scope.

Hi @Wes4 , when checking that HubID (127518), I’m not seeing your APP “Deftly Test” (which is what app ID 63251 is called - Developers | HubSpot) installed in your Integrations page, I just see the “Deftly” app. Did you mean to send over a different App ID?

If I go to the actual Deftly App, then go to the Monitoring section here: Developers | HubSpot, I can grab an access token from the failed requests to the Analytics API:

I can then use the access token in this endpoint: Accounts Dashboard | HubSpot. I can see that you do indeed have the business-intelligence scope here:

That said, the source Account for that error (127518) is not an Enterprise Account. To access Events, you must be a Marketing, Sales or Service Enterprise customer as per the “Applies To” section at the top of this doc : https://knowledge.hubspot.com/articles/kcs_article/events/create-clicked-element-events. Since this account has a Marketing Professional subscription, this request failing is expected behavior

Ohhh okay that makes sense. Sorry, this was for a client and I was misinformed on what type of subscription they had.

No prob @Wes4
16x16_smiley-happy.png.png