How do I redact attachments on closed tickets with the API?
Question
How can I redact attachments on closed tickets with the API?
Answer
Use the Redact Ticket Comment endpoint to redact attachments on closed tickets. Include the external_attachment_urls property in the request body.
To redact attachments from closed tickets
- Use the List Audits for a Ticket endpoint for the closed ticket ID to get:
- comment ID
- content URL
-
Call
PUT "https://{yoursubdomain}.zendesk.com/api/v2/comment_redactions/{ticket_comment_id}from Postman or curl.
Replace{yoursubdomain}with your account subdomain and{ticket_comment_id}with the comment ID from step 1.
Include the content URL from step 1 in theexternal_attachment_urlsarray. In Postman, use this format:{ "external_attachment_urls": ["content_url"], "ticket_id": {ticket_id} }where
external_attachment_urlsis an array of attachment URLs for the comment you redact.
Example:
The attachment is redacted after a successful API call:
For more information, see Redacting ticket content. As a workaround, you can also set an attachment expiration time for your ticket attachments to allow end users access for a specific timeframe.