Recent searches


No recent searches

Cannot get Comment by id



Posted Nov 22, 2021

Why is there no endpoint to get a comment by its ID like the other resources?
i.e. api/v2/comments/{commend_id} is not a valid endpoint
If the ID is not global, why can I not at least specify like so:
api/v2/tickets/{ticket_id}/comments/{commend_id} or with a parameter?


1

3

3 comments

image avatar

Eric Nelson

Zendesk Developer Advocacy

Hey Pavel,

Though I'm not sure of the reasoning historically on why we don't have this. I'd be interested in hearing your use case, and why utilizing other other endpoints such as list comments doesn't work for you. Based on that feedback, I can chat with product and provide your feedback.

Thanks!

0


Just waking this up a bit to agree with the original poster here, and provide some context on our use case. We have a tool to process new comments posted on a ticket and synchronize them with other data. We use a Webhook to be notified of new comments, and the Webhook provides the comment ID. However, since we can't look up the comment by ID, we have to scan all comments in the ticket to find the right one. The templates used for the Webhook payload don't provide all the same information as the API, and if it were possible to look up a comment by ID, they wouldn't have to since we could pull the full comment metadata from the API.

Since Comments are just Audit events, and you _can_ find an audit event by ID, perhaps it would be easier to just provide a placeholder (https://support.zendesk.com/hc/en-us/articles/4408886858138-Zendesk-Support-placeholders-reference) for a comment's Audit ID? Then no new API is needed.

0


I'm somewhat surprised that `api/v2/tickets/{ticket_id}/comments/{commend_id}` can't be utilized to retrieve a specific comment. This poses a challenge for an App where I specifically need to access the text value, which unfortunately isn't accessible from the app client.
The alternative of fetching all comments could be cumbersome, involving pagination and subsequent API calls, which is less than ideal.

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post