How do I get number of tickets in given pipeline via HubSpot API
Hello, I'm working on a integration of an external web app with HubSpot.
I've managed to create contacts and tickets, and make association between them via the API, so now users of the external app can create support tickets by submitting a form.
Our next goal is to show a widget on the administrative dashboard of the app, with number of open and closed tickets.
I can't find information about this in the API documentation. I thought as a last resort we could use `GET /crm/v3/objects/tickets` or `POST /crm/v3/objects/tickets/search` to fetch all tickets in the pipeline with a cron job to get the numbers on a regular interval, but even this ugly solution is not possible because these endpints have pagination limits so after the number of tickets increases above 100 the results won't be accurate anymore. ("You can only request at most 100 objects in one request.")
How do I get number of tickets in given pipeline via HubSpot API
Here is part of the documentation that should help:
The paging cursor token of the last successfully read resource will be returned as the paging.next.after JSON property of a paged response containing more results.
The response will include something like this with the results.
How do I get number of tickets in given pipeline via HubSpot API
Thanks for the timely feedback, guys, I appreciate it!
Using the webhooks systems as suggested by @dennisedson looks like the most appropriate solution, but after a discussion with the product owner we've decided to drop this feature alltogether as the work required to develop it far outweights the value it is adding to our app.
On a side note, I understand how to use paging on an API, it's just not a good idea to fetch all tickets in the system when all you need is simply two numbers.
How do I get number of tickets in given pipeline via HubSpot API
Um, no I don't need 2 tickets. Maybe I didn't express myslef in a clear manner, but I've just checked what I've written above and I it looks like I've never said that I want to fetch 2 tickets
I need two numbers - number of tickets in the pipeline, and number of resolved tickets. Just the stats, that is, nothing about the actual tickets.
Anyway, thanks for trying to help. We've dropped this feature from the scope, managers will have to live without this information in the dashbaord of our app.
How do I get number of tickets in given pipeline via HubSpot API
hey @martinov, I am wondering if webhooks might be the direction you should be headed. There is a good knowledge base article on webhooks and workflows that might be what you want.