Bulk Download Folders and Files
/documents/api/1.2/folders/{folderId}/_download
Requests a bulk download of the specified globally unique identifiers (GUIDs) of the files under the specified folder.
Request
- application/json
- application/xml
-
folderId: string
Globally unique identifier (GUID) for the folder. If the referenced folder is the user's home folder, the value for
folderId
isself
. This files in the zip must all be children of this folder.
object
-
idList:
string
(Required) A comma seperated list of globally unique identifiers (GUIDs)to be copied into the zip. The list can contain file and folder GUIDs that are children of the
folderId
. Theself
folder is not allowed.
{
"idList":"D890E0ADF2EB12AAD28D14372E82C5967A21F51BF794,FE27E70CA140E819250B4D365F48D86BC9097E77B3EE,DC9AEA3E7F3AA1C07FCE4E46B7AC2B4F52F010D5A813"
}
Response
- application/json
- application/xml
200 Response
The response body contains information about the zip build job.
object
-
errorCode(optional):
string
An error code of zero (0) indicates no errors.
-
id(optional):
string
The prefixed GUID of the parent folder for the zip job.
-
idList(optional):
string
The list of file and folder prefixed GUIDs attempted to be copied into the zip file.
-
Location(optional):
string
The URL to access the status for this job.
-
parentID(optional):
string
The GUID of the parent folder for the zip job.
-
type(optional):
string
Item type
folder
.
{
"Location":"OCEHost/documents/api/1.2/folders/FE7DA518D17AA5E46E282D9A1B02AE3398E71823807D/_download/EF45E5E0A9F169D61CA387968719F5AA1614798736483",
"errorCode":0,
"id":"fFolderGUID:FE7DA518D17AA5E46E282D9A1B02AE3398E71823807D",
"idList":"fFileGUID:D890E0ADF2EB12AAD28D14372E82C5967A21F51BF794,fFolderGUID:FE27E70CA140E819250B4D365F48D86BC9097E77B3EE,fFileGUID:DC9AEA3E7F3AA1C07FCE4E46B7AC2B4F52F010D5A813",
"parentID":"FE7DA518D17AA5E46E282D9A1B02AE3398E71823807D,",
"type":"folder"
}
400 Response
The request is invalid as described by the error returned.
403 Response
Forbidden if the user does not have read permission.
404 Response
Folder ID is not found.
Examples
The following example requests that a zip be built with 2 files from the same directory:
POST .../folders/FE7DA518D17AA5E46E282D9A1B02AE3398E71823807D/_download
Request Header
None.
Request Body
{ "idList" : "DE27E70CA140E819250B4D365F48D86BC9097E77B3EE,DC9AEA3E7F3AA1C07FCE4E46B7AC2B4F52F010D5A813" }
HTTP Status Code
HTTP_STATUS = 200
JSON Response
{ "Location": "[OCEHost]/folders/FE7DA518D17AA5E46E282D9A1B02AE3398E71823807D/_download/49D903D85D6FF82655A27207DFCC9A421614896992662", "errorCode": "0", "id": "fFolderGUID:FE7DA518D17AA5E46E282D9A1B02AE3398E71823807D", "idList": "fFileGUID:DE27E70CA140E819250B4D365F48D86BC9097E77B3EE,fFileGUID:DC9AEA3E7F3AA1C07FCE4E46B7AC2B4F52F010D5A813", "parentID": "FE7DA518D17AA5E46E282D9A1B02AE3398E71823807D", "type": "folder" }
Example 2
The following example requests that a zip be built with 2 files and a directory from the same directory:
POST .../folders/FE7DA518D17AA5E46E282D9A1B02AE3398E71823807D/_download
Request Header
None.
Request Body
{ "idList" : "DE27E70CA140E819250B4D365F48D86BC9097E77B3EE,DC9AEA3E7F3AA1C07FCE4E46B7AC2B4F52F010D5A813,F4FB21E87B4014D99CCB8ACE09AA4CDC8253E338458C,FC7638FA224D9F5C8BB2285822063E7DD029B1209216" }
HTTP Status Code
HTTP_STATUS = 200
JSON Response
{ "Location": "[OCEHost]/documents/api/1.2/folders/FE7DA518D17AA5E46E282D9A1B02AE3398E71823807D/_download/22E6510E14B33436B6A40C85E00ABA3A1614897397141", "errorCode": "0", "id": "fFolderGUID:FE7DA518D17AA5E46E282D9A1B02AE3398E71823807D", "idList": "fFileGUID:DE27E70CA140E819250B4D365F48D86BC9097E77B3EE,fFileGUID:DC9AEA3E7F3AA1C07FCE4E46B7AC2B4F52F010D5A813,fFolderGUID:F4FB21E87B4014D99CCB8ACE09AA4CDC8253E338458C", "parentID": "FE7DA518D17AA5E46E282D9A1B02AE3398E71823807D", "type": "folder" }
Example 3
The following example requests that a zip be built with 2 files and a directory from the same directory and a directory from another location :
POST .../folders/FE7DA518D17AA5E46E282D9A1B02AE3398E71823807D/_download
Request Header
None.
Request Body
{ "idList" : "DE27E70CA140E819250B4D365F48D86BC9097E77B3EE,DC9AEA3E7F3AA1C07FCE4E46B7AC2B4F52F010D5A813,F4FB21E87B4014D99CCB8ACE09AA4CDC8253E338458C,FC7638FA224D9F5C8BB2285822063E7DD029B1209216" }
HTTP Status Code
HTTP_STATUS = 400
JSON Response
{ "errorCode": "-96", "errorKey": "!csBulkdownloadUnableToInitJob!csCloudBulkDownloadRequestItemsNotInParentFolder", "errorMessage": "Unable to start bulk download of files. One or more of the Ids are not located in the parent folder.", "errorType": "folder", "id": "fFolderGUID:FE7DA518D17AA5E46E282D9A1B02AE3398E71823807D", "idList": "fFileGUID:DE27E70CA140E819250B4D365F48D86BC9097E77B3EE,fFileGUID:DC9AEA3E7F3AA1C07FCE4E46B7AC2B4F52F010D5A813,fFolderGUID:F4FB21E87B4014D99CCB8ACE09AA4CDC8253E338458C,fFolderGUID:FC7638FA224D9F5C8BB2285822063E7DD029B1209216", "parentID": "FE7DA518D17AA5E46E282D9A1B02AE3398E71823807D", "title": "Unable to start bulk download of files. One or more of the Ids are not located in the parent folder.", "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html" }
Example 4
The following example requests that a zip be built with 3 files and a directory from the same directory, but a file is owned by another user:
POST .../folders/FE7DA518D17AA5E46E282D9A1B02AE3398E71823807D/_download
Request Header
None.
Request Body
{ "idList" : "DB01ED18668EF8ACDCFD169CB26F76D7CB5DA8E4FDDB,DE27E70CA140E819250B4D365F48D86BC9097E77B3EE,DC9AEA3E7F3AA1C07FCE4E46B7AC2B4F52F010D5A813,F4FB21E87B4014D99CCB8ACE09AA4CDC8253E338458C" }
HTTP Status Code
HTTP_STATUS = 403
JSON Response
{ "errorCode": "-20", "errorKey": "!csBulkdownloadUnableToInitJob!csCloudItemInsufficientPrivileges,ssvrint.cecsadmina,fFileGUID:DB01ED18668EF8ACDCFD169CB26F76D7CB5DA8E4FDDB,DOCS_BULK_BUILD_ZIP", "errorMessage": "Unable to start bulk download of files. User 'ssvrint.cecsadmina' has insufficient privilege to access fFileGUID:DB01ED18668EF8ACDCFD169CB26F76D7CB5DA8E4FDDB with service DOCS_BULK_BUILD_ZIP.", "errorType": "folder", "id": "fFolderGUID:FE7DA518D17AA5E46E282D9A1B02AE3398E71823807D", "idList": "fFileGUID:DB01ED18668EF8ACDCFD169CB26F76D7CB5DA8E4FDDB,fFileGUID:DE27E70CA140E819250B4D365F48D86BC9097E77B3EE,fFileGUID:DC9AEA3E7F3AA1C07FCE4E46B7AC2B4F52F010D5A813", "parentID": "FE7DA518D17AA5E46E282D9A1B02AE3398E71823807D", "title": "Unable to start bulk download of files. User 'ssvrint.cecsadmina' has insufficient privilege to access fFileGUID:DB01ED18668EF8ACDCFD169CB26F76D7CB5DA8E4FDDB with service DOCS_BULK_BUILD_ZIP.", "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html" }