Create folder
A request to create new folder.
POST /api/v1/files/makeDir HTTP/1.1
Generates Notification add file/folder.
- Request structure
| Path | Type | Description |
|---|---|---|
parentId | String | The parent folder Id. |
filename | String | The name of the folder |
conflictStrategy | String | Conflict resolution strategy (keep_both / overwrite / versioned) |
- Response structure
See Get file info.
- Example request
curl 'http://localhost:8080/api/v1/files/makeDir' -i -X POST \
-H 'Content-Type: application/json' \
-H 'X-co-auth-token: f571e4bf982a8c49c492d636e793f07c' \
-d '{
"filename" : "New Folder",
"conflictStrategy" : "keep_both",
"parentId" : "db0a822e-e593-4a14-a87c-ef18c3815392"
}'
- Example response
HTTP/1.1 200 OK
X-co-request-id: 7e6NUqLRRt8nMFshTYviwZg4IeFQ94c6
Content-Type: application/json
Content-Length: 1950
{
"file": {
"id": "370b9fba-02c9-40bd-b1f0-c0a76940bfb3",
"createdDate": "2025-02-18T12:52:16.000Z",
"creator": "testsrvdocs@tacos.devoffice.ru",
"creatorFsId": "5177189d266a4862ad93b1cda2f5ac2b",
"creatorFirstName": "r",
"creatorLastName": "t",
"creatorMiddleName": "f",
"filename": "New Folder",
"lastModifyingUserId": "testsrvdocs@tacos.devoffice.ru",
"lastModifyingUserFsId": "5177189d266a4862ad93b1cda2f5ac2b",
"lastModifyingUserFirstName": "r",
"lastModifyingUserLastName": "t",
"lastModifyingUserMiddleName": "f",
"mediaType": "application/vnd.ncloudtech.cloudoffice.folder",
"modifiedByMeDate": "2025-02-18T12:52:16.000Z",
"modifiedDate": "2025-02-18T12:52:16.000Z",
"ownerFsId": "5177189d266a4862ad93b1cda2f5ac2b",
"ownerId": "testsrvdocs@tacos.devoffice.ru",
"parentId": "db0a822e-e593-4a14-a87c-ef18c3815392",
"properties": [
{
"id": "sharedParent",
"key": "sharedParent",
"value": "true"
}
],
"totalSize": "0",
"tree": "/docs-test-makeDirExample()-w3JIp4WlFM/New Folder/",
"ownerFirstName": "r",
"ownerLastName": "t",
"ownerMiddleName": "f",
"isVersion": false,
"originalFileIdOpt": null,
"creatorIsDeleted": false,
"editorIsDeleted": false,
"ownerIsDeleted": false,
"ownerAvatar": "a00bbb30-993e-4632-925f-152939195049",
"creatorAvatar": "a00bbb30-993e-4632-925f-152939195049",
"editorAvatar": "a00bbb30-993e-4632-925f-152939195049"
},
"links": [
{
"rel": "self",
"href": "http://localhost:8080/api/v1/files/189331451"
},
{
"rel": "link",
"href": "http://localhost:8080/link/189331451"
}
]
}