Below is an example remove by query request, remove by folder request and response message.
Note: The wrapping SOAP envelope and authentication header have been omitted to make the samples easier to read. Detailed documentation about each of the elements and their possible values is provided in the WSDL.
Remove content by query request body
<e:removeRequest xmlns:e="http://www.elvisdam.com/xmlns/elvis/webservice/1.0"
xmlns:q="http://www.elvisdam.com/xmlns/elvis/query/1.0">
<!--
Query specifying the assets to be removed. This will remove only assets, no folders.
-->
<e:query>
<q:queryStringQuery>assetCreated:[* TO NOW-1YEAR]</q:queryStringQuery>
</e:query>
</e:removeRequest>
Remove content by folder request body
<e:removeRequest xmlns:e="http://www.elvisdam.com/xmlns/elvis/webservice/1.0"
xmlns:q="http://www.elvisdam.com/xmlns/elvis/query/1.0">
<!--
Elvis folderPath of folder to remove, all assets within the folder will also be removed.
-->
<e:folder>/Demo Zone/Video/News</e:folder>
</e:removeRequest>
Response
When async is not specified, the response will wait until the operation to complete. In this case the response indicates the number of items processed and the number of items that failed. The reason why it failed can be found in the server logs, in most cases the item was checked out.
<e:bulkOperationResponse
xmlns:e="http://www.elvisdam.com/xmlns/elvis/webservice/1.0"
processId="Bn4-TNn24ex9mrR2iJkNUc">
<e:processedCount>61</e:processedCount>
<e:errorCount>10</e:errorCount>
</e:bulkOperationResponse>
Async
Since the operation might run for a while when removing large folders, it can be started asynchronous and will run as a separate process on the Elvis server.
<e:removeRequest async="true">
...
</e:removeRequest>
In this case the operation immediately returns after the process has started and only returns the process id, not the outcome of the operation.
<e:bulkOperationResponse
xmlns:e="http://www.elvisdam.com/xmlns/elvis/webservice/1.0"
processId="AAS9EZVtKGCBBz7UMQ_lCM"/>
You can make separate requests to retrieve details about the current status of the process.
<e:processStatusRequest
xmlns:e="http://www.elvisdam.com/xmlns/elvis/webservice/1.0"
processId="AAS9EZVtKGCBBz7UMQ_lCM"/>
Which returns the following information.
<e:processStatusResponse
xmlns:e="http://www.elvisdam.com/xmlns/elvis/webservice/1.0"
processId="AAS9EZVtKGCBBz7UMQ_lCM">
<e:name>RemoveByQuery</e:name>
<e:load>NORMAL</e:load>
<e:user>webservice</e:user>
<e:state>RUNNING</e:state>
<e:startTime>1321959554369</e:startTime>
<e:progress>43</e:progress>
<e:total>61</e:total>
<e:errorCount>5</e:errorCount>
</e:processStatusResponse>
Or when the process was completed with errors.
<e:processStatusResponse
xmlns:e="http://www.elvisdam.com/xmlns/elvis/webservice/1.0"
processId="AAS9EZVtKGCBBz7UMQ_lCM">
<e:name>RemoveByQuery</e:name>
<e:load>NORMAL</e:load>
<e:user>webservice</e:user>
<e:state>COMPLETED_WITH_ERRORS</e:state>
<e:startTime>1321959554369</e:startTime>
<e:endTime>1321959554395</e:endTime>
<e:progress>61</e:progress>
<e:total>61</e:total>
<e:errorCount>10</e:errorCount>
</e:processStatusResponse>
Comment
Do you have corrections or additional information about this article? Leave a comment! Do you have a question about what is described in this article? Please contact Support.
0 comments
Please sign in to leave a comment.