Having to collect all Tickets

tickets

#1

I am trying to use the API to generate reports on Tickets that are unavailable in the HubSpot CRM.
It seems there is no way to filter Tickets by the API so I am having to grab them all and then filter afterwards.

This is taking a long time as there are over 7000 tickets in the system so we have to make 70 subsequent calls to https://api.hubapi.com/crm-objects/v1/objects/tickets/paged. I considered making parallel curl requests however this won't work as we need to do it sequentially in order to get the offset each time.

I considered locally caching tickets but that defeats the point of using Hubspot.

Does anyone know of a way of being able to filter Tickets by Company or date range? Or is there a way I'm missing where I can grab all of the Tickets in parallel to speed things up?

I realise the Tickets functionality is still in beta but would have thought there must be some filtering mechanism being used internally.


#3

Hi @tonygoodchild,

While I can't speak to internal processes, the methods currently available for the Tickets API are consistent with the more mature APIs for companies and deals, neither of which can be filtered or grabbed in parallel.

That said, you should be able to pull tickets associated with a given company through the CRM Associations API.

To get all the ticket IDs associated with a specific company record via this endpoint, the objectId would be a companyId and the definitionId would be 25:

https://api.hubapi.com/crm-associations/v1/associations/:companyId/HUBSPOT_DEFINED/25


#4

Thanks Isaac,
Yes I since also realised that the associations API would help. I was still hoping there would be some filter I could use to reduce down further but will continue to loop through them.