REST API for Trash Can
Base URL for all REST calls for trash can is /intranet/rest/deleted/.
Trash Can works only for authenticated users.
Get list of deleted objects
GET /intranet/rest/deleted
Optional CGI-style parameter is ?obj_types=:comma_separated_list_of_types.
Get the list of objects moved into trash can by current user.
The optional types filter allows you to receive only certain types of deleted objects. As of Claromentis 7.0 the list of objects types that can be deleted into the trash can is:
- document - DMS document
- marker - DMS marker
- document_version - DMS document version
- folder - DMS folder
- pub_page - Publish page
- pub_page_version - Publish page version
- pub_folder - Publish folder
- news - News article
Returns JSON-formatted array in this format:
[
{
"URI": "http://server.name/intranet/rest/deleted/441",
"obj_type": "document",
"obj_type_name": "Document",
"title": "document.doc",
"date_deleted": {
"date_str" : "07-02-2012 10:29",
"timezone" : "Europe/London",
"date" : "20120207102954"
},
"orig_location": "Folder with text documents > Audit manager",
"description": "This is a document description"
},
...
]
entry | type | description |
---|---|---|
URI | string | URI to use to fully delete the trashed object |
obj_type | string | The type of the trashed object used internally by Claromentis |
obj_type_name | string | Human-readable type of the trashed object |
title | string | The name/title of the object. e.g. A filename of a document |
date_deleted | mixed array | The date the object was moved to the trash can |
orig_location | string | The original location of the trashed object |
description | string | A short description of the object |
Completely delete
DELETE /intranet/rest/deleted/:id
Completely delete an object from the trash can.
The URL to call "DELETE" request is as specified in "URI" attribute of the deleted object returned by the get deleted objects request.
On success returns response code 204. On error returns standard error code with an error message explanation in the response body.
Restore
POST /intranet/rest/deleted/:id/restore
Restores the deleted object to its original location. The URL to send the "POST" request to starts with the URI specified in the "URI" attribute of the deleted object returned by the get list of deleted objects request.
On success returns response code 204. On error returns standard error codes with textual explanation in the response body.