APIs & Integrations

trevor1
Member

API returning only objects I own

The API is only returning information that is relevant to objects I own. How do I get it to return all objects (e.g. companies, deals, contacts), owned by anybody in my organization?

I do have visibility to all objects, regardless of who owns them, on the HubSpot Sales dashboard, and can successfully export them into an Excel file.

EXAMPLE 1:
My organization has many deals. While I am not the owner on any of these deals (I’m not a salesperson), I have visibility to all of them within the HubSpot Sales dashboard. However, this query:

https://api.hubapi.com/deals/v1/deal/paged?hapikey=[my-api-key]

returns this data:

{“deals”:[],“hasMore”:false,“offset”:0}

EXAMPLE 2:
My organization has many account owners. However, this query:

https://api.hubapi.com/owners/v2/owners?hapikey=[my-api-key]

returns this data:

[{“portalId”:2653171,“ownerId”:15200201,“type”:“PERSON”,“firstName”:"[my-first-name]",“lastName”:"[my-last-name]",“email”:"[my-email]",“createdAt”:1478551288633,“updatedAt”:1478551288633,“remoteList”:[{“id”:14412375,“portalId”:2653171,“ownerId”:15200201,“remoteId”:“3284054”,“remoteType”:“HUBSPOT”,“active”:true}]}]

Thank you!

0 Upvotes
3 Replies 3
Dadams
HubSpot Employee
HubSpot Employee

API returning only objects I own

Hi @trevor

API keys (hapikeys) have full access to the portal, so the returned data should not be affected by the owner. Can you double check to make sure you have the API key for the portal that you’re logged into? Keys are specific to a portal, so if you’re working with test portals you’ll need the key specific to the test portal you’re looking at.

0 Upvotes
trevor1
Member

API returning only objects I own

Thanks for the quick reply! I just created the app and created a Developer HAPIkey. Is there something else that needs to be done to specify to which portal the app connects?

Also, I created a developer account with the same email address as the address that is used for my organization. Perhaps this isn’t enough to connect the accounts? Is there something an admin needs to do to make me a developer on my organization’s account?

0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

API returning only objects I own

The Developer HAPIkey should only be used to for setup, since otherwise your Developer account won’t have any actual data in it. You’d need to create a test portal, and then get the API key from inside that test portal.

How do I create a test portal?

Test portals can be used to test your integration without affecting your live HubSpot data.


0 Upvotes