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.
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:
- Use our Uploading files API, which returns a token.
- Include the token in a ticket comment by the
uploads
array while creating or updating a ticket.
Example:
{ "ticket": { "comment": { "body": "See screenshot.", "uploads": ["vz7ll9ud8oofowy"] } } }
For more information, see our Developer Documentation.
4 Comments
Hi, is it possible to attache a file from external resource, smth like Google Cloud Bucket, or Azure Blob Storage? Since, I do not have the file on the server I am not able to upload it.
Hi Віктор Борисюк,
Thanks for reaching out!
Unfortunately it's not possible to attach files to a ticket comment directly from an external source. The file must be uploaded via the Attachment API which requires the actual file, which then creates a token that is used to attach the file to the ticket.
An alternative option could be uploading the file as an inline attachment using markdown, depending on the file type.
Feel free to reach out if you have any questions!
Tipene
Tipene Hughes I'm trying to do this exact thing. We have Power Apps forms that create SharePoint lists, in which we then use the Zendesk API to create the ticket in Zendesk. I'm wondering about the best approach to get the attachment into the ticket, or at the very least, a link to the attachment?
I've found this article online, but am having a hard time understanding the 'Attachment' section:
https://4sysops.com/archives/using-the-zendesk-api-with-microsoft-power-automate/
Thanks in advance,
Chris
Hey Chris,
I'm not super familiar with Microsoft Power Apps but from the looks of it, the article is outlining how to utilize the Attachments API along with the Tickets API within the Power Apps UI.
When uploading an image to create a token using the Attachments API, the file must first be converted to binary which appears to be something that can be handled within Power Apps. Once the token has been generated, it's then passed in to the payload sent to the Tickets API to create or update a ticket which again looks like it can be handled within the Power Apps UI.
Sorry I can't give you any specifics on the functionality of Power Apps but by the looks of it, the article is outlining the correct workflow as written in the documentation I linked above.
Please sign in to leave a comment.