All URIs are relative to https://localhost/alfresco/api/-default-/public/alfresco/versions/1
| Method | HTTP request | Description |
|---|---|---|
| deleteDeletedNode | DELETE /deleted-nodes/{nodeId} | Permanently delete a deleted node |
| getArchivedNodeRendition | GET /deleted-nodes/{nodeId}/renditions/{renditionId} | Get rendition information for a deleted node |
| getArchivedNodeRenditionContent | GET /deleted-nodes/{nodeId}/renditions/{renditionId}/content | Get rendition content of a deleted node |
| getDeletedNode | GET /deleted-nodes/{nodeId} | Get a deleted node |
| getDeletedNodeContent | GET /deleted-nodes/{nodeId}/content | Get deleted node content |
| listDeletedNodeRenditions | GET /deleted-nodes/{nodeId}/renditions | List renditions for a deleted node |
| listDeletedNodes | GET /deleted-nodes | List deleted nodes |
| requestDirectAccessUrl | POST /deleted-nodes/{nodeId}/request-direct-access-url | Generate a direct access content url for a given deleted node |
| requestRenditionDirectAccessUrl | POST /deleted-nodes/{nodeId}/renditions/{renditionId}/request-direct-access-url | Generate a direct access content url for a given rendition of a deleted node |
| restoreDeletedNode | POST /deleted-nodes/{nodeId}/restore | Restore a deleted node |
Permanently delete a deleted node
this endpoint is available in Alfresco 5.2 and newer versions.
Parameters
| Name | Type | Description |
|---|---|---|
| nodeId | string | The identifier of a node. |
Example
import { AlfrescoApi, TrashcanApi} from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const trashcanApi = new TrashcanApi(alfrescoApi);
trashcanApi.deleteDeletedNode(`<nodeId>`).then(() => {
console.log('API called successfully.');
});Get rendition information for a deleted node
this endpoint is available in Alfresco 5.2 and newer versions.
Parameters
| Name | Type | Description |
|---|---|---|
| nodeId | string | The identifier of a node. |
| renditionId | string | The name of a thumbnail rendition, for example doclib, or pdf. |
Example
import { AlfrescoApi, TrashcanApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const trashcanApi = new TrashcanApi(alfrescoApi);
trashcanApi.getArchivedNodeRendition('node-id', 'rendition-id').then((data) => {
console.log('API called successfully. Returned data: ' + data);
});Return type: RenditionEntry
Get rendition content of a deleted node
this endpoint is available in Alfresco 5.2 and newer versions.
Parameters
| Name | Type | Description |
|---|---|---|
| nodeId | string | The identifier of a node. |
| renditionId | string | The name of a thumbnail rendition, for example doclib, or pdf. |
| attachment | boolean | true (default) enables a web browser to download the file as an attachment. false means a web browser may preview the file in a new tab or window, but not download the file. You can only set this parameter to false if the content type of the file is in the supported list; for example, certain image files and PDF files. If the content type is not supported for preview, then a value of false is ignored, and the attachment will be returned in the response. |
| ifModifiedSince | boolean | Only returns the content if it has been modified since the date provided. Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT. |
| range | string | The Range header indicates the part of a document that the server should return. Single part request supported, for example: bytes=1-10. |
| placeholder | boolean | If true and there is no rendition for this nodeId and renditionId, then the placeholder image for the mime type of this rendition is returned, rather than a 404 response. |
Return type: Blob
Example
import { AlfrescoApi, TrashcanApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const trashcanApi = new TrashcanApi(alfrescoApi);
trashcanApi.getArchivedNodeRenditionContent('node-id', 'rendition-id').then((data) => {
console.log('API called successfully. Returned data: ' + data);
});Get a deleted node
this endpoint is available in Alfresco 5.2 and newer versions.
Parameters
| Name | Type | Description |
|---|---|---|
| nodeId | string | The identifier of a node. |
| include | string | Returns additional information about the node. The following optional fields can be requested: allowableOperations, association, isLink, isFavorite,isLocked, path, permissions, definition |
Return type: DeletedNodeEntry
Example
import { AlfrescoApi, TrashcanApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const trashcanApi = new TrashcanApi(alfrescoApi);
trashcanApi.getDeletedNode('nodeId').then((data) => {
console.log('API called successfully. Returned data: ' + data);
});Get deleted node content
this endpoint is available in Alfresco 5.2 and newer versions.
Parameters
| Name | Type | Description |
|---|---|---|
| nodeId | string | The identifier of a node. |
| attachment | boolean | true (default) enables a web browser to download the file as an attachment. false means a web browser may preview the file in a new tab or window, but not download the file. You can only set this parameter to false if the content type of the file is in the supported list for example, certain image files and PDF files. If the content type is not supported for preview, then a value of false is ignored, and the attachment will be returned in the response. |
| ifModifiedSince | Date | Only returns the content if it has been modified since the date provided. Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT. |
| range | string | The Range header indicates the part of a document that the server should return. Single part request supported, for example: bytes=1-10. |
Return type: Blob
Example
import { AlfrescoApi, TrashcanApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const trashcanApi = new TrashcanApi(alfrescoApi);
trashcanApi.getDeletedNodeContent('nodeId').then((data) => {
console.log('API called successfully. Returned data: ' + data);
});List renditions for a deleted node
this endpoint is available in Alfresco 5.2 and newer versions.
Gets a list of the rendition information for each rendition of the file nodeId, including the rendition id.
Each rendition returned has a status: CREATED means it is available to view or download, NOT_CREATED means the rendition can be requested.
You can use the where parameter to filter the returned renditions by status. For example, the following where
clause will return just the CREATED renditions:
(status='CREATED')
Parameters
| Name | Type | Description |
|---|---|---|
| nodeId | string | The identifier of a node. |
| opts.where | string | A string to restrict the returned objects by using a predicate. |
Return type: RenditionPaging
Example
import { AlfrescoApi, TrashcanApi} from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const trashcanApi = new TrashcanApi(alfrescoApi);
trashcanApi.listDeletedNodeRenditions(`<nodeId>`).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});List deleted nodes
this endpoint is available in Alfresco 5.2 and newer versions.
Gets a list of deleted nodes for the current user.
If the current user is an administrator deleted nodes for all users will be returned.
The list of deleted nodes will be ordered with the most recently deleted node at the top of the list.
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.include | string[] | Returns additional information about the node. The following optional fields can be requested: allowableOperations, aspectNames, association, isLink, isFavorite, isLocked, path, properties, permissions |
Return type: DeletedNodesPaging
Example
import { AlfrescoApi, TrashcanApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const trashcanApi = new TrashcanApi(alfrescoApi);
const opts = {};
trashcanApi.listDeletedNodes(opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});Generate a direct access content url for a given deleted node
this endpoint is available in Alfresco 7.1 and newer versions.
Parameters
| Name | Type | Description |
|---|---|---|
| nodeId | string | The identifier of a node. |
Return type: DirectAccessUrlEntry
Example
import { AlfrescoApi, TrashcanApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const trashcanApi = new TrashcanApi(alfrescoApi);
const nodeId = 'da2e6953-3850-408b-8284-3534dd777417';
trashcanApi.requestDirectAccessUrl(nodeId).then((data) => {
console.log('URL generated successfully: ', data.contentUrl);
});Generate a direct access content url for a given rendition of a deleted node
this endpoint is available in Alfresco 7.1 and newer versions.
Parameters
| Name | Type | Description |
|---|---|---|
| nodeId | string | The identifier of a node. |
| renditionId | string | The identifier of a rendition. |
Return type: DirectAccessUrlEntry
Example
import { AlfrescoApi, TrashcanApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const trashcanApi = new TrashcanApi(alfrescoApi);
const nodeId = 'da2e6953-3850-408b-8284-3534dd777417';
const renditionId = 'avatar';
trashcanApi.requestRenditionDirectAccessUrl(nodeId, renditionId).then((data) => {
console.log('URL generated successfully: ', data.contentUrl);
});Restore a deleted node
this endpoint is available in Alfresco 5.2 and newer versions.
Attempts to restore the deleted node nodeId to its original location or to a new location.
If the node is successfully restored to its former primary parent, then only the primary child association will be restored, including recursively for any primary children. It should be noted that no other secondary child associations or peer associations will be restored, for any of the nodes within the primary parent-child hierarchy of restored nodes, irrespective of whether these associations were to nodes within or outside the restored hierarchy.
Also, any previously shared link will not be restored since it is deleted at the time of delete of each node.
Parameters
| Name | Type | Description |
|---|---|---|
| nodeId | string | The identifier of a node. |
| opts.fields | string | A list of field names. |
| opts.deletedNodeBodyRestore | DeletedNodeBodyRestore | The targetParentId if the node is restored to a new location. |
Return type: NodeEntry
Example
import { AlfrescoApi, TrashcanApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const trashcanApi = new TrashcanApi(alfrescoApi);
const nodeId = '<guid>';
trashcanApi.restoreDeletedNode(nodeId).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});Properties
| Name | Type |
|---|---|
| list | DeletedNodesPagingList |
Properties
| Name | Type |
|---|---|
| pagination | Pagination |
| entries | DeletedNodeEntry[] |
Properties
| Name | Type |
|---|---|
| entry | DeletedNode |
Properties
| Name | Type | Description |
|---|---|---|
| id | string | |
| name | string | The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |. The character . must not be used at the end of the name. |
| nodeType | string | |
| isFolder | boolean | |
| isFile | boolean | |
| isLocked | boolean | |
| modifiedAt | Date | |
| modifiedByUser | UserInfo | |
| createdAt | Date | |
| createdByUser | UserInfo | |
| parentId | string | |
| isLink | boolean | |
| isFavorite | boolean | |
| content | ContentInfo | |
| aspectNames | string[] | |
| properties | any | |
| allowableOperations | string[] | |
| path | PathInfo | |
| permissions | PermissionsInfo | |
| definition | Definition | |
| archivedByUser | UserInfo | |
| archivedAt | Date |
Properties
| Name | Type |
|---|---|
| targetParentId | string |
| assocType | string |