Skip to main content

Get file list

A request to list files.

POST /api/v1/files?q={query} HTTP/1.1
  1. 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

Query object structure​

FieldDescription
parentIdcontains parent folder id.
mediaTypeForLoggingcontains media type filter.
sortFielddescribes field name from JSON File structure. Available values: filename, creator, ownerId, fileSize, modifiedDate, createdDate, modifiedByMeDate, sharedWithMeDate, lastViewedByMeDate
sortOrderdescribes order of sorting ('asc' - ascending, 'desc' - descending)
searchQuerycontains search query string
searchByContentif true - search by content, if false - search by filename
searchInSharedif true search in shared folder
searchInCorporateif true search in corporate folder
offsetcontains index of the first element
limitcontains number of elements
  1. Response structure
PathTypeDescription
[]ArrayArray of File objects. See Get file info
[].file.idStringThe ID of the file.
[].file.filenameStringThe name of the file.
[].file.mediaTypeStringThe media type of the file.
[].file.createdDateDateCreate time for this file (formatted ISO8601 timestamp)
[].file.fileSizeNumberThe size of the file in bytes.
[].file.lastModifyingUserIdStringThe ID of the user who last modified the file.
[].file.lastModifyingUserFsIdStringThe FS ID of the user who last modified the file.
[].file.lastModifyingUserFirstNameStringThe first name of the user who last modified the file.
[].file.lastModifyingUserMiddleNameStringThe middle name of the user who last modified the file.
[].file.lastModifyingUserLastNameStringThe last name of the user who last modified the file.
[].file.modifiedByMeDateDateLast time this file was modified by the user (formatted RFC 3339 timestamp).
[].file.autoCreationRevisionsBooleanShould new version of file be created automatically during collaboration.
[].file.lastViewedByMeDateDateLast time this file was viewed by the user (formatted RFC 3339 timestamp).
[].file.sharedWithMeDateDateTime at which this file was shared with the user (formatted RFC 3339 timestamp).
[].file.modifiedDateDateLast time this file was modified by anyone (formatted RFC 3339 timestamp).
[].file.parentIdStringThe parent folder (parentReferenceId) which contains this file. The root has no parent
[].file.creatorStringThe original creator (userId) of this file.
[].file.creatorFsIdStringThe FS ID of the user who create the file.
[].file.creatorFirstNameStringThe first name of the user who create the file.
[].file.creatorMiddleNameStringThe middle name of the user who create the file.
[].file.creatorLastNameStringThe last name of the user who create the file.
[].file.propertiesArrayThe list of file’s properties.
[].file.checksumStringAn MD5 checksum for the content of this file
[].file.headRevisionIdStringThe ID of the file’s head (last) revision.
[].file.isVersionBooleanThe file is versiobn or not.
[].file.prerenderStringThe id of prerendered file.
[].file.previewStringThe id of preview file.
[].file.previewFailureMarkDateFlag to show unix time of unsuccessful preview generation.
[].file.prerenderFailureMarkDateFlag to show unix time of unsuccessful prerender generation.
[].file.thumbnailFailureMarkDateFlag to show unix time of unsuccessful thumbnail generation.
[].file.ownerIdStringThe owner (userId) of this file.
[].file.etagStringETag (HTTP Entity Tag) of the file.
[].file.ownerFsIdStringThe owner (userId) of this file.
[].file.publicLinkIdStringPublic link id. [Since 2021.03]
[].file.treeStringAbsolute path to this file for current user. Set of parent’s names and name of the file.
[].file.ownerFirstNameStringThe owner first name of this file.
[].file.ownerLastNameStringThe owner last name of this file.
[].file.ownerMiddleNameStringThe owner middle name of this file.
[].file.totalSizeNumberTotal size of all file’s versions.
[].file.currentRevisionObjectObjectCurrent revision object. See Get file revision
[].file.previewClientVersionStringVersion of preview client that generated preview
[].file.specialDirStringType of special folder, if present
[].file.originalFileIdOptStringExist only for version and contained file id
[].file.creatorIsDeletedBooleanShow that creator is deleted
[].file.editorIsDeletedBooleanShow that editor is deleted
[].file.ownerIsDeletedBooleanShow that owner is deleted
[].file.ownerAvatarStringOwner avatar
[].file.creatorAvatarStringCreator avatar
[].file.editorAvatarStringEditor avatar
[].file.oldPathStringOld file path
[].file.parentFolderNameStringThe name of the parent folder
[].file.properties[].idStringThe file’s property id
[].file.properties[].keyStringThe file’s property key
[].file.properties[].valueStringThe file’s property value
[].links[].relStringLink type
[].links[].hrefStringLink reference
  1. Example request
curl 'http://localhost:8080/api/v1/files?q=%7B%22parentId%22%3A%22189373322%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' -i -X GET \
-H 'X-co-auth-token: 1ac611c3016eb837f11ff29bdab2daa0'
  1. Example response
HTTP/1.1 200 OK
X-co-request-id: 4374556f31633332567973547654427a
Content-Type: application/vnd.ncloudtech.cloudoffice.filelist+json;v=1;charset=UTF-8
Content-Length: 4349
[
{
"file": {
"id": "189373377",
"createdDate": "2022-04-06T15:58:53.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-06T15:58:53.000Z",
"modifiedDate": "2022-04-06T15:58:53.000Z",
"ownerFsId": "5177189d266a4862ad93b1cda2f5ac2b",
"ownerId": "testsrvdocs@tacos.devoffice.ru",
"parentId": "189373322",
"properties": [
{
"id": "sharedParent",
"key": "sharedParent",
"value": "true"
}
],
"totalSize": "0",
"tree": "/docs-test-getFileListExample()-QgrfcT3y0S/New Folder/",
"ownerFirstName": "r",
"ownerLastName": "t",
"ownerMiddleName": "t",
"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/189373377"
},
{
"rel": "link",
"href": "http://localhost:8080/link/189373377"
}
]
},
{
"file": {
"id": "189373442",
"createdDate": "2022-04-06T15:58:53.000Z",
"creator": "testsrvdocs@tacos.devoffice.ru",
"creatorFsId": "5177189d266a4862ad93b1cda2f5ac2b",
"creatorFirstName": "r",
"creatorLastName": "t",
"creatorMiddleName": "f",
"fileSize": "20",
"filename": "testfile.txt",
"headRevisionId": "189373443",
"lastModifyingUserId": "testsrvdocs@tacos.devoffice.ru",
"lastModifyingUserFsId": "5177189d266a4862ad93b1cda2f5ac2b",
"lastModifyingUserFirstName": "r",
"lastModifyingUserLastName": "t",
"lastModifyingUserMiddleName": "f",
"mediaType": "text/plain",
"modifiedByMeDate": "2022-04-06T15:58:53.000Z",
"modifiedDate": "2022-04-06T15:58:53.000Z",
"ownerFsId": "5177189d266a4862ad93b1cda2f5ac2b",
"ownerId": "testsrvdocs@tacos.devoffice.ru",
"parentId": "189373322",
"properties": [
{
"id": "sharedParent",
"key": "sharedParent",
"value": "true"
}
],
"totalSize": "20",
"checksum": "e0e102b9ff40785fac8902d8bcbf2279",
"tree": "/docs-test-getFileListExample()-QgrfcT3y0S/testfile.txt",
"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/189373442"
},
{
"rel": "download",
"href": "http://localhost:8080/api/v1/files/189373442/content"
},
{
"rel": "import",
"href": "http://localhost:8080/api/v1/files/189373442/import"
},
{
"rel": "preview",
"href": "http://localhost:8080/api/v1/files/189373442/preview"
},
{
"rel": "link",
"href": "http://localhost:8080/link/189373442"
}
]
}
]