Note that uploaded files that have been referenced in at least
one message are automatically deleted once the last message
containing a link to them is deleted (whether directly or via
a message retention policy).
Uploaded files that are never used in a message are
automatically deleted a few weeks after being uploaded.
#!/usr/bin/env python3importzulip# Pass the path to your zuliprc file here.client=zulip.Client(config_file="~/zuliprc")# Delete the attachment given the attachment's ID.url="attachments/"+str(attachment_id)result=client.call_endpoint(url=url,method="DELETE",)print(result)
Changes: As of Zulip 7.0 (feature level 167), if any
parameters sent in the request are not supported by this
endpoint, a successful JSON response will include an
ignored_parameters_unsupported array.
A typical successful JSON response may look like:
{"msg":"","result":"success"}
A typical failed JSON response for when the attachment_id is invalid