Question

How can I redact attachments on closed tickets with the API?

Answer

You can redact attachments on closed tickets using the Redact Ticket Comment endpoint and including the external_attachment_urls property in the request body.  

Captura de pantalla 2024-10-30 a las 10.16.25.png

Note: The Redact Comment Attachment endpoint doesn't apply to closed tickets.

To redact attachments from closed tickets

1.png

  1. Use the List Audits for a Ticket endpoint on the closed ticket id to get the following attachment information (see screenshot below):
    • comment id
    • content URL
  2. 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 obtained from Step 1 above.

    Include the content URL from Step 1 in the html_body. In Postman, the format is:

    {
      "external_attachment_urls": ["content_url"],
      "ticket_id": {ticket_id}
    }

    where external_attachment_urls is an array of attachment URLs belonging to the comment to be redacted.

    Example:

33.png

The attachment will be redacted after a successful API call:

3.png

Note: Ticket redaction works on content in archived or closed tickets for email, API, and webform channels. Ticket redaction does not work on content in archived or closed tickets for messaging and live chat channels. Private attachments are also available in messaging tickets for end users and ticket assignees. These attachments provide a higher level of security and users have limited access to these types of attachments.

For more information, see the article: Redacting ticket content.

Powered by Zendesk