Creating Folders

You can use the createFolders call to create multiple folders.

Sample URL

https://hostname:port/context/rest/v2/documents/createFolders

Method

POST

Parameters

An array of JSON objects of the folders to be created. Each object has the following fields:
Parameter Description
name Required.

The relative path of the new folder. If there are more than one folders, they will all be created.

parentId Optional.

The document ID of the parent folder. The default value is the root folder.

parentPath Optional.

The full path of the parent folder. If the parentId parameter is present, the parentPath parameter will be ignored. The default value is the root folder.

comments Optional.

Comments on the folder.

confidential Optional.

The acceptable values are true and false.

Example 1:

Paramters=[{"name":"Z","parentId"="142O00000001"}, {"name":"C","parentId"="140F00000001"}]. Folder Z and C will be created. The response code is 200. The response body is [ {"code":"200","id":"141M000007EE","latestVersion":0,"parentId":" 142O00000001","dateModified":0,"users":"O:admin:A","createdBy":"admin","shareId":" 142O00000001","name":"Z","type":"D","size":0}, {"code":"200","id":"141M000007F0","latestVersion":0,"parentId":" 140F00000001","dateModified":0,"users":"O:admin:A","createdBy":"admin","shareId":" 140F00000001","name":"C","type":"D","size":0} ]

Example 2:

Paramters=[{"name":"X/Y/Z","parentId"="141M000007EE"}]. Folder X already exists. Folders Y Z and C will be created. The response code is 409. The response body is [ {"code":"409","id":"141M000007EE","latestVersion":0,"parentId":"141M000007EE","dateModified":0,"users":"O:admin:A","createdBy":"admin","shareId":" 141M000007EE","name":"X","type":"D","size":0}, {"code":"200","id":" 142O00000001","latestVersion":0,"parentId":" 141M000007EE","dateModified":0,"users":"O:admin:A","createdBy":"admin","shareId":" 141M000007EE","name":"Y","type":"D","size":0}, {"code":"200","id":"141M000007EE","latestVersion":0,"parentId":" 142O00000001 ","dateModified":0,"users":"O:admin:A","createdBy":"admin","shareId":" 141M000007EE ","name":"Z","type":"D","size":0},]

Response

HTTP Status Code Description
200 All folders are created successfully.
409 One or more folders already exist.