Ticket metrics incremental | Community
Skip to main content

Ticket metrics incremental

  • September 27, 2022
  • 3 replies
  • 0 views

Michal12

Hello, is there a way to get ticket metrics incrementally in the same data structure as I get from GET /api/v2/ticket_metrics/ (which I believe is not "incremental capable") ?

ticket_metric_events is giving me different data structure

3 replies

Greg29
  • September 27, 2022

Hi Michal! The ticket metrics endpoint does support pagination and the data structure that it returns is the same regardless of whether you use the regular list method or add on the pagination. Pagination should never affect the underlying data that it's returning, it's simply providing a different list of the same data. To use the incremental functionality of this endpoint, simply append `?page[size]=100` to the end of the url, like this: {subdomain}.zendesk.com/api/v2/ticket_metrics?page[size]=100.

I see that you also mentioned ticket metric events, which definitely will be different. The events endpoint will return a chronological list of events on all tickets, whereas ticket metrics will return its results descending via ticket ID and will tell you the current state of the SLAs on the tickets.

Let me know if you have any other questions!


Michal12
  • Author
  • September 27, 2022

Hi Greg! I was looking for something more like {subdomain}.zendesk.com/api/v?/ticket_metrics?start_time={unix_time} . Do I am able to achieve similar incremental result based on time as with GET /api/v2/incremental/tickets/cursor.json?start_time={unix_time} ?

I was expecting something like GET /api/v2/incremental/ticket_metrics/cursor.json?start_time={unix_time} , but that does not seem to exist


Greg29
  • September 28, 2022
My apologies, I'm not sure how I read "pagination" when you were discussing incremental endpoints. You can get this data by side-loading ticket metrics onto the incremental call. It will return all of the same data that you get from /api/v2/ticket_metrics or /api/v2/ticket/{ticket_id}/metrics, however it will be returned in its own object connected to the ticket as opposed to be doing only the metrics data. You can do this with the following call: https://{subdomain}.zendesk.com/api/v2/incremental/tickets/cursor.json?start_time={epochtime}&include=metric_sets
 
Hope that helps, apologies again for the misunderstanding!