APIs & Integrations

dclaysmith
Member

Is there a way to to include associations with a crm-objects query?

When querying contacts, etc you can add includeAssociations=true.

Is there a way to include associations when querying tickets?
https://api.hubapi.com/crm-objects/v1/objects/tickets/paged

??

3 Replies 3
IsaacTakushi
HubSpot Employee
HubSpot Employee

Is there a way to to include associations with a crm-objects query?

Hi @dclaysmith,

No, the Tickets API won't return association data on its own.

Instead, you'll need to use the CRM Associations API. We will be using more of these "shared APIs" going forward.

For example, if you're using this endpoint and using a ticket ID as the objectId, you would use the definitionId 16 to get associated contacts, 26 for companies, and 28 for deals, per the table in the overview documentation.

Isaac Takushi

Associate Certification Manager
0 Upvotes
Dude_Awesome
Member

Is there a way to to include associations with a crm-objects query?

As @dclaysmith said. It is a shame that a minor detail like this costs 1000s of api calls which could be avoided if the associations could be included in the properties itself instead of as a separate endpoint and that too have to be called for each record.

dclaysmith
Member

Is there a way to to include associations with a crm-objects query?

That's a shame. If you have 1000 tickets and need to find the related contact/org you have to make 1000 times more API calls!