Question
Can I attach files, such as photos, to a ticket using the Zendesk API?
Answer
Yes, when a file is attached to a ticket, and 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.
To do this
- Use the Upload Files API end point, which returns a token.
- Include the token in a ticket comment by the
uploads
array while creating or updating a ticket. If you don't complete this step, Zendesk will delete the uploaded files and display a404 not found
error when the upload token expires.
Example
{ "ticket": { "comment": { "body": "See screenshot.", "uploads": ["vz7ll9ud8oofowy"] } } }