cancel
Showing results for 
Search instead for 
Did you mean: 

Delete Attachments through API

kartik_sn
Confirmed Champ
Confirmed Champ

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
1 ACCEPTED ANSWER

Victor_Sánchez
Confirmed Champ
Confirmed Champ

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!

View answer in original post

4 REPLIES 4

Victor_Sánchez
Confirmed Champ
Confirmed Champ

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!

Hi Victor,

Did you launch your request with another index of "xpath"

Scenario

Getting started

Attention: Blogs & Forums are in READ-ONLY mode from Oct 6-19 as we transition to our new platform. Learn more.

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.