Overview
This article will cover how to attach files, such as photos, to a ticket using the Zendesk API.
Conditions
When a file is attached to a ticket, if the account requires authentication to download attachments, the attachment's visibility becomes restricted to only users with access to the ticket. Until the attachment is associated with a ticket, any authenticated user can view an attachment using its content_URL
. The attachment's token expires after three days.
Note: If step 2 below is not completed, the uploaded files will be deleted and will appear missing (returning a
404 not found
error) when the upload token expires.Procedure
1. Use our Uploading files API, which returns a token.
2. Include the token in a ticket comment via the uploads
array while creating or updating a ticket.
Example:
{ "ticket": { "comment": { "body": "See screenshot.", "uploads": ["vz7ll9ud8oofowy"] } } }
32 Comments
Hi, is it possible to attach a file that ISN'T uploaded to Zendesk? Say a Google Cloud or Google Drive file?
Hi Trang. Unfortunately, an external reference cannot be made when uploading a file. You have to have the file available directly for the API request to contain its full contents.
Please sign in to leave a comment.