APIs & Integrations

Ashish_shr
メンバー

how to access report data with api

I have a developer account  and created the app and generate the access and refresh token with my application but when i try to get the all analytic report with the API i got the error  403 (access token does not have proper permissions ) ..

so here my questions are :-

Q1) should i have a subscription developer (right now i have a developer account without subscription).?

Q2) i have a another account with subscription so should i have to create a new app their and again generate access and refresh token with that account if yes how can i create new app their i sea this option only on developer account ?

 

0 いいね!
7件の返信
WendyGoh
HubSpot Employee
HubSpot Employee

how to access report data with api

Hey @Ashish_shr,

 

Just to clarify, how are you generating the access and refresh token? Did you install your app on a portal?

 

If so, could you share with me the portal ID and app ID/name in question?

 

 

0 いいね!
Ashish_shr
メンバー

how to access report data with api

i am generating the access and refresh token by using this API :- 

https://api.hubapi.com/oauth/v1/token

this is the App ID: 224883 and portal ID: 8151182

0 いいね!
WendyGoh
HubSpot Employee
HubSpot Employee

how to access report data with api

Hey @Ashish_shr,

 

Portal 8151182 is a developer portal:

  • Developer portals are unique in that they only have access to the developer tools. These portals are used for creating/managing apps and test portals. They cannot install integrations, and they are not used for any Marketing/CRM responsibilities.

 

Whereas the production portal is the one in which you install the app on:

  • Production portals are live Marketing/CRM portals; this is the portal that you run your business on. These portals have access to whichever level of Marketing/CRM subscription you pay for, and the corresponding functionality. Production portals do not have access to developer tools.

 

As such, could you share with me the production portal in question and the exact API request url that your team is requesting?

0 いいね!
Ashish_shr
メンバー

how to access report data with api

Hi @WendyGoh ,

 

This is my Portal id - 7184641 and i am trying to hit this API - https://api.hubapi.com/analytics/v2/views?hapikey=demo

 

also i have one question -

Which API key i have to use to hit the API developer portal API key or the Production API key ?

0 いいね!
WendyGoh
HubSpot Employee
HubSpot Employee

how to access report data with api

Hey @Ashish_shr,

 

Thanks for sharing your production portal ID! When looking at portal 7184641 subscription, I note that it is currently on Marketing hub starter and as documented on this endpoint - Get all analytics views,

 

Note: Access to the data from this endpoint will require a Marketing Hub Professional or Enterprise subscription. Please see the overview page for more details.
Hence, this is likely why you're seeing the 403 no access error.
 

Also, to your question, the API key you should use to hit the Get all analytics views is the production API key.

0 いいね!
Ashish_shr
メンバー

how to access report data with api

Hi @WendyGoh ,

Thanks for your help. I have now Marketing Hub Professional susbcription i want to know the exect API for getting any report data.

Can you please provide me the exact API for getting report data and another for getting all report list ?

Also i am trying to hit this API: https://api.hubapi.com/analytics/v2/reports/totals/total?hapikey=demo&start=20180101&end=20180301

 

and getting error 

{"status":"error","message":"Only HubSpot Enterprise customers may use a HAPIkey to access this resource.","correlationId":"253a2e1a-1e87-42da-99eb-54ea6c87d7f1"}

i already have Marketing Hub Professional subscription but still having this issue .

0 いいね!
WendyGoh
HubSpot Employee
HubSpot Employee

how to access report data with api

Hey @Ashish_shr,

 

To clarify further, only accounts with an Enterprise subscription will be able to access the Analytics API using an API key. All accounts will be able to access certain features of the Analytics API using OAuth based on the table below. (More details on this documentation: Analytics API Overview)

 

In this case, if you'd like to get the analytics data breakdowns, you'd need to use an OAuth based authentication. 

 

Hope this helps!

0 いいね!