Ticket Metrics Endpoint Return Object | Community
Skip to main content

Ticket Metrics Endpoint Return Object

  • October 5, 2021
  • 3 replies
  • 0 views

Hi,

In the ticket metrics endpoint docs under Show Ticket Metrics

https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_metrics/#show-ticket-metrics

it suggests that when we call the https://{subdomain}.zendesk.com/api/v2/ticket_metrics/{ticket_metric_id} endpoint, we should get back a list of objects under the ticket_metric key:

response -> {"ticket_metric": [{...}]}

When I hit that endpoint, I actually get back a single object under the ticket_metric key:

response -> {"ticket_metric": {...}}

I'm wondering if there was just a typo in the docs and a single object is always returned under the ticket_metric key, or if it's possible for the value under that key to be either a list or an object.

note: the docs listed two endpoints in the same section:

GET /api/v2/ticket_metrics/{ticket_metric_id}
GET /api/v2/tickets/{ticket_id}/metrics

I hit both endpoints and in both cases got back a single object rather than a list of objects.

3 replies

  • October 8, 2021

Hi Jacob,

Thanks for reaching out! Taking a further look it may just be a typo in our doc and those array brackets shouldn't be there. From my end, both endpoints returns the ticket_metric key with a top level object as the value with a few nested objects inside it. I'll share this with our team to get that doc updated. Nice call out!

Don't hesitate to let us know if there's any other way we can assist.

Best,

Erica - Dev Support Engineer


CJ99
  • March 2, 2022

I hit the exact same issue today. The documentation lists two endpoints, GET /api/v2/ticket_metrics/{ticket_metric_id}
GET /api/v2/tickets/{ticket_id}/metrics
But there are the same endpoint.  The documentation also states that there is a "ticket metric id" that "Returns a specific metric". But that's not actually possible due to what's outlined in this post. 


CJ99
  • March 8, 2022

I've been told by support that this feature as described in the documentation, was never a thing, and the documentation will be updated to remove all references to being able to pull a ticket_metric_id. Disappointing.