Delete Attachments through API
Hi All,
I am not able to delete attachments through API. When i use Blob.RemoveFromDocument from API it only deleted the contents of file but not the entry of that attachment.
Can anyone help me on this issue.
Regards
Hi Kartik,
Both Blob.Remove and Document.RemoveProperty are, basically, the same. The difference is Blob.Remove has default “xpath” parameter with default value “file:content”. I think you are asking about delete attachments of document, so for that, you need to make your request with the payload with correct params with xpath of file attachment, for example, to delete the first attachment of your-doc-id document:
POST $HOST/nuxeo/site/automation/Blob.Remove
POST $HOST/nuxeo/site/automation/Document.RemoveProperty
With raw-body:
{
"input": "your-doc-id",
"params": {
"xpath": "files/content[0]"
}
}
I hope this helps, VS!
Thanks for the answer. But i am facing problem to delete specific attachment. When i try the way you have explained it is deleting the last attachment of the array. I am not able to send the attachment number which i want to delete. Could you help me on this issue.
regards
Any solution to this?