alfresco-js-api
Version:
JavaScript client library for the Alfresco REST API
149 lines (99 loc) • 6.59 kB
Markdown
//localhost/alfresco/api/-default-/public/alfresco/versions/1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**cancelDownload**](DownloadsApi.md
[**createDownload**](DownloadsApi.md
[**getDownload**](DownloadsApi.md
<a name="cancelDownload"></a>
> cancelDownload(downloadId)
Cancel a download
**Note:** this endpoint is available in Alfresco 5.2.1 and newer versions. Cancels the creation of a download request. **Note:** The download node can be deleted using the **DELETE /nodes/{downloadId}** endpoint By default, if the download node is not deleted it will be picked up by a cleaner job which removes download nodes older than a configurable amount of time (default is 1 hour) Information about the existing progress at the time of cancelling can be retrieved by calling the **GET /downloads/{downloadId}** endpoint The cancel operation is done asynchronously.
```javascript
var downloadId = "downloadId_example"; // String | The identifier of a download node.
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
this.alfrescoJsApi.core.downloadsApi.cancelDownload(downloadId, callback);
```
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**downloadId** | **String**| The identifier of a download node. |
null (empty response body)
[ ](../README.md
- **Content-Type**: application/json
- **Accept**: application/json
<a name="createDownload"></a>
> DownloadEntry createDownload(downloadBodyCreate, opts)
Create a new download
**Note:** this endpoint is available in Alfresco 5.2.1 and newer versions. Creates a new download node asynchronously, the content of which will be the zipped content of the **nodeIds** specified in the JSON body like this: `&
```javascript
var downloadBodyCreate = new AlfrescoCoreRestApi.DownloadBodyCreate(); // DownloadBodyCreate | The nodeIds the content of which will be zipped, which zip will be set as the content of our download node.
var opts = {
'fields': ["fields_example"] // [String] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter.
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
this.alfrescoJsApi.core.downloadsApi.createDownload(downloadBodyCreate, opts, callback);
```
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**downloadBodyCreate** | [**DownloadBodyCreate**](DownloadBodyCreate.md)| The nodeIds the content of which will be zipped, which zip will be set as the content of our download node. |
**fields** | [**[String]**](String.md)| A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | [optional]
[**DownloadEntry**](DownloadEntry.md)
[ ](../README.md
- **Content-Type**: application/json
- **Accept**: application/json
<a name="getDownload"></a>
> DownloadEntry getDownload(downloadId, opts)
Get a download
**Note:** this endpoint is available in Alfresco 5.2.1 and newer versions. Retrieve status information for download node **downloadId**
### Example
```javascript
var downloadId = "downloadId_example"; // String | The identifier of a download node.
var opts = {
'fields': ["fields_example"] // [String] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter.
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
this.alfrescoJsApi.core.downloadsApi.getDownload(downloadId, opts, callback);
```
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**downloadId** | **String**| The identifier of a download node. |
**fields** | [**[String]**](String.md)| A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | [optional]
[**DownloadEntry**](DownloadEntry.md)
[ ](../README.md
- **Content-Type**: application/json
- **Accept**: application/json
All URIs are relative to *https: