List Comments

GET {{baseUrl}}/api/v2/tickets/:ticket_id/comments?sort_order=<string>&include_inline_images=<boolean>&include=<string>

Returns the comments added to the ticket.

Each comment may include a content_url for an attachment or a recording_url for a voice comment that points to a file that may be hosted externally. For security reasons, take care not to inadvertently send Zendesk authentication credentials to third parties when attempting to access these files. See Working with url properties.

Pagination

  • Cursor pagination (recommended)
  • Offset pagination

See Pagination.

Returns a maximum of 100 records per page.

Sorting

By default, comments are sorted by creation date in ascending order.

When using cursor pagination, use the following parameter to change the sort order:

NameTypeRequiredComments
sortstringnoPossible values are created_at (ascending order) or -created_at (descending order)

When using offset pagination, use the following parameters to change the sort order:

NameTypeRequiredComments
sort_orderstringnoOne of asc, desc

Allowed For

  • Agents

Request Params

KeyDatatypeRequiredDescription
sort_orderstringOne of asc, desc. Defaults to asc
include_inline_imagesstringDefault is false. When true, inline images are also listed as attachments in the response
includestringAccepts "users". Use this parameter to list email CCs by side-loading users. Example: ?include=users. Note: If the comment source is email, a deleted user will be represented as the CCd email address. If the comment source is anything else, a deleted user will be represented as the user name.

HEADERS

KeyDatatypeRequiredDescription
Acceptstring

RESPONSES

status: OK

{&quot;comments&quot;:[{&quot;attachments&quot;:[{&quot;content_type&quot;:&quot;text/plain&quot;,&quot;content_url&quot;:&quot;https://company.zendesk.com/attachments/crash.log&quot;,&quot;file_name&quot;:&quot;crash.log&quot;,&quot;id&quot;:498483,&quot;size&quot;:2532,&quot;thumbnails&quot;:[]}],&quot;audit_id&quot;:432567,&quot;author_id&quot;:123123,&quot;body&quot;:&quot;Thanks for your help!&quot;,&quot;created_at&quot;:&quot;2009-07-20T22:55:29Z&quot;,&quot;id&quot;:1274,&quot;metadata&quot;:{&quot;system&quot;:{&quot;client&quot;:&quot;Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36&quot;,&quot;ip_address&quot;:&quot;1.1.1.1&quot;,&quot;latitude&quot;:-37.000000000001,&quot;location&quot;:&quot;Melbourne, 07, Australia&quot;,&quot;longitude&quot;:144.0000000000002},&quot;via&quot;:{&quot;channel&quot;:&quot;web&quot;,&quot;source&quot;:{&quot;from&quot;:{},&quot;rel&quot;:&quot;web_widget&quot;,&quot;to&quot;:{}}}},&quot;public&quot;:true,&quot;type&quot;:&quot;Comment&quot;}]}