Skip to main content

Check file has sub folder(s)

In some requests to check sub folder(s) and send hasChildFolders property in response need to set withHasSubFolder parameter to true.

Property hasChildFolders is true if file has sub folder(s) otherwise false.

  1. Request examples
POST /api/v1/files/?q={query},withHasSubFolder=true HTTP/1.1
POST /api/v1/files/{fileId}?withHasSubFolder=true HTTP/1.1
POST /api/v1/files/{linkUid}/children?withHasSubFolder=true HTTP/1.1
  1. Example request parameters
ParameterDescription
qUrlencoded query json object. See Query object structure.
withHasSubFolderIf flag is true, send hasChildFolders property in response. By default is true. hasChildFolders is true when file has sub folder(s), otherwise false.
  1. Example request
curl 'http://localhost:8080/api/v1/files?q=%7B%22parentId%22%3A%22189405957%22%2C%22sortField%22%3A%22filename%22%2C%22sortOrder%22%3A%22asc%22%2C%22searchByContent%22%3Afalse%2C%22searchInShared%22%3Afalse%2C%22searchInCorporate%22%3Afalse%2C%22offset%22%3A-1%2C%22limit%22%3A-1%7D&withHasSubFolder=true' -i -X GET \
-H 'X-co-auth-token: 78d71bda851e332d4ed5fc67e8ab2963'
  1. Example response
HTTP/1.1 200 OK
X-co-request-id: 3134576c49583039514d556e7157356c
Content-Type: application/vnd.ncloudtech.cloudoffice.filelist+json;v=1;charset=UTF-8
Content-Length: 2067
[
{
"file": {
"id": "189406012",
"createdDate": "2022-04-06T16:01:36.000Z",
"creator": "testsrvdocs@tacos.devoffice.ru",
"creatorFsId": "5177189d266a4862ad93b1cda2f5ac2b",
"creatorFirstName": "r",
"creatorLastName": "t",
"creatorMiddleName": "f",
"fileSize": "null",
"filename": "New Folder",
"lastModifyingUserId": "testsrvdocs@tacos.devoffice.ru",
"lastModifyingUserFsId": "5177189d266a4862ad93b1cda2f5ac2b",
"lastModifyingUserFirstName": "r",
"lastModifyingUserLastName": "t",
"lastModifyingUserMiddleName": "f",
"mediaType": "application/vnd.ncloudtech.cloudoffice.folder",
"modifiedByMeDate": "2022-04-06T16:01:36.000Z",
"modifiedDate": "2022-04-06T16:01:36.000Z",
"ownerFsId": "5177189d266a4862ad93b1cda2f5ac2b",
"ownerId": "testsrvdocs@tacos.devoffice.ru",
"parentId": "189405957",
"properties": [
{
"id": "hasChildFolders",
"key": "hasChildFolders",
"value": "true"
},
{
"id": "sharedParent",
"key": "sharedParent",
"value": "true"
}
],
"totalSize": "0",
"tree": "/docs-test-getFileWithHasSubFolderExample()-c6FzJXTE5q/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/189406012"
},
{
"rel": "link",
"href": "http://localhost:8080/link/189406012"
}
]
}
]
  1. Example request
curl 'http://localhost:8080/api/v1/files?q=%7B%22parentId%22%3A%22189389259%22%2C%22sortField%22%3A%22filename%22%2C%22sortOrder%22%3A%22asc%22%2C%22searchByContent%22%3Afalse%2C%22searchInShared%22%3Afalse%2C%22searchInCorporate%22%3Afalse%2C%22offset%22%3A-1%2C%22limit%22%3A-1%7D&withHasSubFolder=false' -i -X GET \
-H 'X-co-auth-token: a4c6384a46b23bfd51dacfc11e57e528'
  1. Example response
HTTP/1.1 200 OK
X-co-request-id: 6966326f7667614c5035666c70703166
Content-Type: application/vnd.ncloudtech.cloudoffice.filelist+json;v=1;charset=UTF-8
Content-Length: 2070
[
{
"file": {
"id": "189389314",
"createdDate": "2022-04-06T16:00:02.000Z",
"creator": "testsrvdocs@tacos.devoffice.ru",
"creatorFsId": "5177189d266a4862ad93b1cda2f5ac2b",
"creatorFirstName": "r",
"creatorLastName": "t",
"creatorMiddleName": "f",
"fileSize": "null",
"filename": "New Folder",
"lastModifyingUserId": "testsrvdocs@tacos.devoffice.ru",
"lastModifyingUserFsId": "5177189d266a4862ad93b1cda2f5ac2b",
"lastModifyingUserFirstName": "r",
"lastModifyingUserLastName": "t",
"lastModifyingUserMiddleName": "f",
"mediaType": "application/vnd.ncloudtech.cloudoffice.folder",
"modifiedByMeDate": "2022-04-06T16:00:02.000Z",
"modifiedDate": "2022-04-06T16:00:03.000Z",
"ownerFsId": "5177189d266a4862ad93b1cda2f5ac2b",
"ownerId": "testsrvdocs@tacos.devoffice.ru",
"parentId": "189389259",
"properties": [
{
"id": "hasChildFolders",
"key": "hasChildFolders",
"value": "true"
},
{
"id": "sharedParent",
"key": "sharedParent",
"value": "true"
}
],
"totalSize": "0",
"tree": "/docs-test-getFileWithoutHasSubFolderExample()-3uKdcoHL0R/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/189389314"
},
{
"rel": "link",
"href": "http://localhost:8080/link/189389314"
}
]
}
]