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:
Name | Type | Required | Comments |
---|---|---|---|
sort | string | no | Possible values are created_at(ascending order) or -created_at(descending order) |
When using offset pagination, use the following parameters to change the sort order:
Name | Type | Required | Comments |
---|---|---|---|
sort_order | string | no | One of asc , desc |
Allowed For
- Agents
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
sort_order | string | One of asc , desc . Defaults to asc | |
include_inline_images | string | Default is false. When true, inline images are also listed as attachments in the response | |
include | string | Accepts "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
Key | Datatype | Required | Description |
---|---|---|---|
Accept | string |
RESPONSES
status: OK
{"comments":[{"attachments":[{"content_type":"text/plain","content_url":"https://company.zendesk.com/attachments/crash.log","file_name":"crash.log","id":498483,"size":2532,"thumbnails":[]}],"audit_id":432567,"author_id":123123,"body":"Thanks for your help!","created_at":"2009-07-20T22:55:29Z","id":1274,"metadata":{"system":{"client":"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","ip_address":"1.1.1.1","latitude":-37.000000000001,"location":"Melbourne, 07, Australia","longitude":144.0000000000002},"via":{"channel":"web","source":{"from":{},"rel":"web_widget","to":{}}}},"public":true,"type":"Comment"}]}