Bulk Download Folders and Files

post

/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

Supported Media Types
Path Parameters
  • Globally unique identifier (GUID) for the folder. If the referenced folder is the user's home folder, the value for folderId is self. This files in the zip must all be children of this folder.

Body ()
The request body defines details of the files to be zipped.
Root Schema : FolderCreateBulkZipBody
Type: object
The request body defines details of what files are copied into the zip.
Show Source
  • (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. The self folder is not allowed.
Example Request (application/json)
{
    "idList":"D890E0ADF2EB12AAD28D14372E82C5967A21F51BF794,FE27E70CA140E819250B4D365F48D86BC9097E77B3EE,DC9AEA3E7F3AA1C07FCE4E46B7AC2B4F52F010D5A813"
}
Back to Top

Response

Supported Media Types

200 Response

The response body contains information about the zip build job.

Body ()
Root Schema : FolderCreateBulkZipResponse
Type: object
The response body includes information about the created zip job.
Show Source
Example Response (application/json)
{
    "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.

Back to Top

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"
}
Back to Top