POST http://yourserver.com/services/remove ?q=<query> &ids=<comma-delimited asset ids> &folderPath=<folder to remove> &async=<true | false> |
What does it do?
Remove one or more assets. This will remove only assets, no folders.
POST requests only
This REST API only accepts POST requests, not GET requests. Also, the POST request needs to include a cross-site request forgery (csrf) token.
The csrf token is a unique code which, by including it in the request, also makes the POST request unique and therefore much more secure.
The csrf token is obtained by first logging in to Elvis Server through a POST request. The response that is received will include the csrf token which can then be used in subsequent POST requests as a http header:
"X-CSRF-TOKEN: <some_csrf_token>"
For more information including examples, see Elvis 6 REST API - Performing a POST request with a csrf token.
Parameters
q |
A query that matches all assets to be removed. Be careful with this and make sure you test your query using a search call to prevent removing assets that you did not want to be removed. Either 'q' or 'ids' or 'folderPath' must be specified. |
ids |
A comma-delimited list of asset ids to be removed. Either 'q' or 'ids' or 'folderPath' must be specified. |
folderPath |
The folderPath of the folder to remove. All assets and subfolders will be removed. Either 'q' or 'ids' or 'folderPath' must be specified. |
async |
When true, the process will run asynchronous in the background. The call will return immediate with the processId. Optional. By default, the call waits for the process to finish and then returns the processedCount. |
Return value
The operation returns a JSON object with the following properties:
processedCount | Number of assets that were processed by the operation. |
errorCount | Number of errors that occurred. |
If called with async=true, the operation returns a JSON object with the following properties:
processId | Unique id of the process that was started. |
If the operation fails, a JSON error object is returned.
Example
Remove by ids
remove http://demo.elvisdam.com/services/remove ?ids=5LMAQTW9qfhANn7f6JJVpl,E8MJ7tLJaUM8cY2eeWYxEu |
Remove by query
The following removes all assets imported more than one year ago.
removehttp://demo.elvisdam.com/services/remove ?q=assetCreated:[* TO NOW-1YEAR] |
Remove a complete folder
The following removes a complete folder, including subfolders and all contained assets.
removehttp://demo.elvisdam.com/services/remove ?folderPath=/Demo Zone/Images |
Document history
- 27 July 2017: Added section 'Post requests only'.
Comments
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 here.
2 comments
typo in parameters, should be ids (plural), example is correct
Thanks Owen, that is updated now.
Best regards,
Maarten van Kleinwee
Senior Technical Writer, WoodWing Software
Please sign in to leave a comment.