Beam Help
Get help now

How-to · Zoho DESK

How to retrieve a ticket attachment in Zoho Desk

Fetch a specific file or attachment from a support ticket.

Retrieving a ticket attachment in Zoho Desk via the API requires two identifiers — the ticket ID and the attachment ID — and a straightforward GET request to the attachments endpoint.


Why this matters


When building integrations or automations around Zoho Desk, you often need to programmatically fetch files attached to support tickets — for example, to archive them, forward them to another system, or inspect their contents. Knowing the correct endpoint and the order of operations (list first, then fetch) saves significant debugging time and keeps your integration reliable.


Step-by-step


Step 1. Gather your ticket ID.

Before making any attachment request, confirm the ticketId of the ticket you are working with. This is the unique identifier Zoho Desk assigns to every support ticket and is required in every attachment-related API call.[1]


Step 2. List all attachments on the ticket.

If you do not already know the attachmentId, send a GET request to the list endpoint first:


GET /api/v1/tickets/{ticketId}/attachments

Pass the ticketId as a path parameter. An optional query-parameter dict (p) can be supplied for pagination or filtering.[3] In Python this looks like:


attachments = client.list_ticket_attachments(ticketId="123456")

The response will include each attachment's metadata, including its attachmentId, which you will need in the next step.[3]


Step 3. Retrieve the specific attachment.

Once you have both identifiers, call the single-attachment endpoint:


GET /api/v1/tickets/{ticketId}/attachments/{attachmentId}

Replace {ticketId} and {attachmentId} with the real values. The optional p parameter can carry any additional query options your integration needs.[1] In Python:


attachment = client.get_ticket_attachment(
    ticketId="123456",
    attachmentId="789"
)

The response object contains the attachment details for that specific file.[1]


Step 4. (Optional) Retrieve attachments tied to a transition draft.

If the file you need is associated with a workflow transition rather than the ticket body itself, use a different endpoint that also requires a transitionId:


GET /api/v1/tickets/{ticketId}/transitions/{transitionId}/attachments

Supply all three path parameters — ticketId, transitionId, and optionally p — to retrieve attachments belonging to that transition draft.[4]


Step 5. (Optional) Upload or delete attachments as needed.

For completeness, our team notes that the same /api/v1/tickets/{ticketId}/attachments path supports POST requests to add a new file (with a data payload) and DELETE requests to the /{attachmentId} sub-path to remove an existing one.[6][8] These operations follow the same ID conventions described above.


Common pitfalls


  • Wrong ID order. The path always places ticketId before attachmentId. Swapping them will result in a failed request or a 404 response.[1]
  • Skipping the list step. Attempting to call the single-attachment endpoint without first confirming the correct attachmentId via the list endpoint is a common source of errors. Always list first if you are unsure.[3]
  • Transition attachments vs. ticket attachments. Files attached during a workflow transition draft live under the /transitions/{transitionId}/attachments path, not the standard ticket attachments path. Using the wrong endpoint will return an empty or unexpected result.[4]
  • Confusing upload and retrieval. The POST endpoint at /api/v1/tickets/{ticket_id}/attachments is for uploading new files, not for downloading existing ones. Use GET for retrieval.[7]

What to check


  • Both IDs are present and correct — confirm ticketId and attachmentId are valid before calling the GET endpoint.[1]
  • The attachment scope is right — verify whether the file belongs to the ticket body or a transition draft, and use the appropriate endpoint accordingly.[3][4]
  • Your API credentials have the necessary permissions — ensure the OAuth token or API key your integration uses has read access to Zoho Desk ticket attachments before troubleshooting response errors.[1]

---


*Beam Help is an independent expert support resource for Zoho products and is not official Zoho support. Always cross-reference with Zoho's own documentation for the latest endpoint changes.*

Sources cited

  1. [1] GET /api/v1/tickets/{ticketId}/attachments/{attachmentId}
  2. [2] server.py: build_zoho_links
  3. [3] GET /api/v1/tickets/{ticketId}/attachments
  4. [4] GET /api/v1/tickets/{ticketId}/transitions/{transitionId}/attachments
  5. [5] GET /api/v1/tickets/{ticket_id}/attachments
  6. [6] POST /api/v1/tickets/{ticketId}/attachments
  7. [7] POST /api/v1/tickets/{ticket_id}/attachments
  8. [8] DELETE /api/v1/tickets/{ticketId}/attachments/{attachmentId}
Get Ticket Attachment | Beam Help