Bulk Create Folders
/documents/api/1.2/folders/{folderId}/_bulkCreate
Requests bulk creation of folders under a single parent folder.
Request
- application/json
- application/xml
-
folderId: string
Globally unique identifier (GUID) for the folder. It is the parent folder for all sub-folders created in this request. If the referenced folder is the user's home folder, the value for
folderId
isself
.
-
links(optional): string
Indicate if links for the created folders should be returned in the response. The value
links=true
will return all available links for each created folder. Any other value or not sendinglinks
will not return links.
-
accessToken(optional): string
Applink access token authorizing the current user to access this folder. This parameter is mandatory if
appLinkID
is used. It can be used as accessToken or AccessToken. -
appLinkID(optional): string
Applink ID authorizing the current user to access this folder. Any time the parameter
appLinkID
is used, a parameteraccessToken
must be provided as well. It can be used as appLinkID or AppLinkID. -
dAccessCode(optional): string
Access code needed to use protected public links. It needs to be sent as part of a Cookie header in the following format:
dAccessCode-<linkID>=<passcodeValue>
-
linkID(optional): string
Public link ID of a public link authorizing the current user to access this folder. It can be used as linkID or LinkID.
object
-
folders:
array folders
Minimum Number of Items:
1
Maximum Number of Items:50
(Required) The list of folders to be created under the same parent. A maximum of 50 folders is allowed per request.
array
1
50
-
Array of:
object FolderBulkCreateBodyArrayItem
The request body defines details of the bulk create folder request. Bold indicates a required value.
object
-
description(optional):
string
Maximum Length:
2000
(Optional) Specify a description for the newly created folder. -
name:
string
Maximum Length:
255
(Required) Specify the name of the newly created folder.
{
"folders":[
{
"name":"folder 1",
"description":"folder 1 description"
},
{
"name":"folder 2",
"description":"folder 2 description"
},
{
"name":"folder 3",
"description":"folder 3 description"
}
]
}
Response
- application/json
- application/xml
200 Response
The response body contains information about the bulk folder creation results.
object
-
errorCode(optional):
string
An error code of zero (0) indicates no errors.
-
items(optional):
array items
The subfolders created in the folder.
array
-
Array of:
object BulkCreateFoldersItemsDefinition
The subfolders created in the folder.
object
-
childFileCount(optional):
string
Number of files contained in the folder.
-
childFolderCount(optional):
string
Number of folders contained in the folder.
-
childItemsCount(optional):
string
Number of files and folders contained in the folder.
-
createdBy(optional):
object User
User information
-
createdTime(optional):
string
Date the folder was created.
-
description(optional):
string
Folder description.
-
id(optional):
string
Globally unique identifier (GUID) for the folder.
-
links(optional):
array links
Links for the folder.
-
modifiedBy(optional):
object User
User information
-
modifiedTime(optional):
string
Date the folder was last modified.
-
name(optional):
string
Folder name.
-
ownedBy(optional):
object User
User information
-
parentID(optional):
string
Globally unique identifier (GUID) for the parent folder. If the parent folder is the user's home folder, the value for
parentID
isself
. -
size(optional):
string
Size of the folder in bytes, including all of the files and folders contained in the folder.
-
type(optional):
string
Item type
folder
.
object
-
displayName(optional):
string
The display name for the user.
-
id(optional):
string
Globally unique identifier (GUID) for the user.
-
loginName(optional):
string
The login name for the user.
-
type(optional):
string
Item type
user
.
array
-
Array of:
object FoldersLinkDetails
Links for a folder.
object
-
href(optional):
string
The URL corresponding to the link type.
-
rel(optional):
string
The type of link, this will be
self
,canonical
,parent
andchild
{
"errorCode":0,
"items":[
{
"id":"F31BB7F92F167752A3AB5EAC47440630DCC4D63610C1",
"type":"folder",
"name":"folder 1",
"description":"folder 1 description",
"parentID":"F1564DFB2D7C7FBE8EE7A38CACF5DA9752E1734D9F36",
"createdTime":"2021-03-11T21:32:45Z",
"modifiedTime":"2021-03-11T21:32:45Z",
"childItemsCount":"0",
"childFolderCount":"0",
"childFileCount":"0",
"size":"0",
"createdBy":{
"displayName":"User AA",
"loginName":"userAALoginName",
"id":"U0EAA20910FAF3052ACB79E4T00000000001",
"type":"user"
},
"modifiedBy":{
"displayName":"User AA",
"loginName":"userAALoginName",
"id":"U0EAA20910FAF3052ACB79E4T00000000001",
"type":"user"
},
"ownedBy":{
"displayName":"User AA",
"loginName":"userAALoginName",
"id":"U0EAA20910FAF3052ACB79E4T00000000001",
"type":"user"
}
},
{
"id":"F29815ADE851DA3F9A07D6EA85BD0AE9B8B03D7D2718",
"type":"folder",
"name":"folder 2",
"description":"folder 2 description",
"parentID":"F1564DFB2D7C7FBE8EE7A38CACF5DA9752E1734D9F36",
"createdTime":"2021-03-11T21:32:45Z",
"modifiedTime":"2021-03-11T21:32:45Z",
"childItemsCount":"0",
"childFolderCount":"0",
"childFileCount":"0",
"size":"0",
"createdBy":{
"displayName":"User AA",
"loginName":"userAALoginName",
"id":"U0EAA20910FAF3052ACB79E4T00000000001",
"type":"user"
},
"modifiedBy":{
"displayName":"User AA",
"loginName":"userAALoginName",
"id":"U0EAA20910FAF3052ACB79E4T00000000001",
"type":"user"
},
"ownedBy":{
"displayName":"User AA",
"loginName":"userAALoginName",
"id":"U0EAA20910FAF3052ACB79E4T00000000001",
"type":"user"
}
},
{
"id":"F1275FD876ED265557E8B6D45C09A67B319C4BA8294A",
"type":"folder",
"name":"folder 3",
"description":"folder 3 description",
"parentID":"F1564DFB2D7C7FBE8EE7A38CACF5DA9752E1734D9F36",
"createdTime":"2021-03-11T21:32:45Z",
"modifiedTime":"2021-03-11T21:32:45Z",
"childItemsCount":"0",
"childFolderCount":"0",
"childFileCount":"0",
"size":"0",
"createdBy":{
"displayName":"User AA",
"loginName":"userAALoginName",
"id":"U0EAA20910FAF3052ACB79E4T00000000001",
"type":"user"
},
"modifiedBy":{
"displayName":"User AA",
"loginName":"userAALoginName",
"id":"U0EAA20910FAF3052ACB79E4T00000000001",
"type":"user"
},
"ownedBy":{
"displayName":"User AA",
"loginName":"userAALoginName",
"id":"U0EAA20910FAF3052ACB79E4T00000000001",
"type":"user"
}
}
]
}
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 creates two sub-folders under one parent folder. This request will also return the links for each created folder.
POST.../folders/FC36AAB4D623FC51477DC6C456897E7E77B1313A2E41/_bulkCreate?links=true
Request Header
None.
Request Body
{ "folders" : [ { "name" : "sub folder 1", "description" : "description for folder 1"}, { "name" : "sub folder 2", "description" : "description for folder 2"} ] }
HTTP Status Code
HTTP_STATUS = 201
JSON Response
{ "errorCode": "0", "items": [ { "id": "F6D00906682BEE445AE023D9A74012C07F07B9C4E3A0", "type": "folder", "name": "sub folder 1", "description": "description for folder 1", "parentID": "F1564DFB2D7C7FBE8EE7A38CACF5DA9752E1734D9F36", "createdTime": "2021-03-15T22:13:43Z", "modifiedTime": "2021-03-15T22:13:43Z", "childItemsCount": "0", "childFolderCount": "0", "childFileCount": "0", "createdBy": { "displayName": "User AA", "id": "UCC2702CD5AED3F95DBB8FD8EBD09207B89C", "loginName": "userAALoginName", "type": "user" }, "modifiedBy": { "displayName": "User AA", "id": "UCC2702CD5AED3F95DBB8FD8EBD09207B89C", "loginName": "userAALoginName", "type": "user" }, "ownedBy": { "displayName": "User AA", "id": "UCC2702CD5AED3F95DBB8FD8EBD09207B89C", "loginName": "userAALoginName", "type": "user" }, "links": [ { "rel": "self", "href": "[OCEHost]/documents/api/1.2/folders/F6D00906682BEE445AE023D9A74012C07F07B9C4E3A0" }, { "rel": "canonical", "href": "[OCEHost]/documents/api/1.2/folders/F6D00906682BEE445AE023D9A74012C07F07B9C4E3A0" }, { "rel": "parent", "href": "[OCEHost]/documents/api/1.2/folders/F1564DFB2D7C7FBE8EE7A38CACF5DA9752E1734D9F36" }, { "rel": "child", "href": "[OCEHost]/documents/api/1.2/folders/F6D00906682BEE445AE023D9A74012C07F07B9C4E3A0/items" } ] }, { "id": "FAC441565BA56476111D864028751E0EF7ECCB1679CF", "type": "folder", "name": "sub folder 2", "description": "description for folder 2", "parentID": "F1564DFB2D7C7FBE8EE7A38CACF5DA9752E1734D9F36", "createdTime": "2021-03-15T22:13:43Z", "modifiedTime": "2021-03-15T22:13:43Z", "childItemsCount": "0", "childFolderCount": "0", "childFileCount": "0", "createdBy": { "displayName": "User AA", "id": "UCC2702CD5AED3F95DBB8FD8EBD09207B89C", "loginName": "userAALoginName", "type": "user" }, "modifiedBy": { "displayName": "User AA", "id": "UCC2702CD5AED3F95DBB8FD8EBD09207B89C", "loginName": "userAALoginName", "type": "user" }, "ownedBy": { "displayName": "User AA", "id": "UCC2702CD5AED3F95DBB8FD8EBD09207B89C", "loginName": "userAALoginName", "type": "user" }, "links": [ { "rel": "self", "href": "[OCEHost]/documents/api/1.2/folders/FAC441565BA56476111D864028751E0EF7ECCB1679CF" }, { "rel": "canonical", "href": "[OCEHost]/documents/api/1.2/folders/FAC441565BA56476111D864028751E0EF7ECCB1679CF" }, { "rel": "parent", "href": "[OCEHost]/documents/api/1.2/folders/F1564DFB2D7C7FBE8EE7A38CACF5DA9752E1734D9F36" }, { "rel": "child", "href": "[OCEHost]/documents/api/1.2/folders/FAC441565BA56476111D864028751E0EF7ECCB1679CF/items" } ] } ], "links": [ { "rel": "self", "href": "[OCEHost]/documents/api/1.2/folders/F1564DFB2D7C7FBE8EE7A38CACF5DA9752E1734D9F36/_bulkCreate?links=true" }, { "rel": "canonical", "href": "[OCEHost]/documents/api/1.2/folders/F1564DFB2D7C7FBE8EE7A38CACF5DA9752E1734D9F36/_bulkCreate?links=true" }, { "rel": "child", "href": "[OCEHost]/documents/api/1.2/folders/items" } ] }