Recent searches


No recent searches

How can I get attachment_id



Posted Jun 26, 2023

My app receives request from webhook. When a ticket is updated, in the JSON body, the attachment can only have attachment.name and attachment.url. In this case, I cannot store the attachment.id into my db. 

When I need to delete(redact in zendesk's language because I did not see any delete attachment operation) the attachment, I need to use this API, but where can I get attachment_id? 

PUT /api/v2/tickets/{ticket_id}/comments/{comment_id}/attachments/{attachment_id}/redact


the only solution I can see is 

GET /api/v2/tickets/{ticket_id}/comments

and loop over to match the comment id and then loop over the attachments to match with url(same filename is possible) and get the attachment_id??

Also, when I want to upload an attachment and attach it to an existing ticket comment, can I do that from API?


0

1

1 comment

image avatar

Christopher Kennedy

Zendesk Developer Advocacy

Hi Riley,
 
You're correct - listing the ticket's comments is the cleanest way to retrieve an attachment's ID.  Also, attachments cannot be added to existing ticket comments.  They can only get added to new comments.

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post