跳到主要内容

searchFolder

FolderContentWrapper searchFolder(folderId, FolderMetadataSearch)

POST /api/2.0/files/{folderId}/search

Search a folder by metadata

Lists one page of the contents of a folder narrowed by metadata, in the shape GET api/2.0/files/{folderId} returns: subfolders in folders, files in files, the folder itself in current. The filter is a typed body: metadataTemplateId alone keeps the entries the template is assigned to, every condition in metadataFilters must hold at once, and filterValue adds a text search over titles and metadata values; the template and field IDs come from GET api/2.0/files/metadata/templates, and a body with none of them lists the folder unfiltered. The caller needs read access to the folder. No entry is changed, but a recognised sortBy is saved as the account's default order while an unrecognised one is ignored, and opening a room or an ordinary folder clears its new-item marks for the caller. withSubFolders searches the whole subtree unless switched off; total counts every match, and count with startIndex page through them. A folder in a connected third-party storage carries no metadata, so a filter there returns an empty page. An unknown template or field, a field outside the named template, more than 20 conditions, or a filter in the Templates or Private section is refused with 400; a folder the caller may not read with 403, a missing one with 404. To combine metadata with the user, extension or form filters, use GET api/2.0/files/{folderId}, which takes the same filter as a JSON string.

Parameters​

NameInTypeDescriptionNotes
folderIdpathInteger (int32)The folder or room to search in; take the id from a listing such as GET api/2.0/files/@root. A numeric id addresses a folder of the portal, a string one a folder in a connected third-party storage.[required] [example: 1]
FolderMetadataSearchbodyFolderMetadataSearchThe search parameters.[required]

Responses​

Status codeDescriptionTypeResponse headers
200One page of the folder contents that match the filter, with the folder itself and the chain of its parentsFolderContentWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
400Invalid metadata filter, or a metadata filter on a section that cannot apply it--
403You don't have enough permission to view the folder content--
404The required folder was not found--
401UnauthorizedErrorApiResponse-
429Too Many Requests.ErrorApiResponseRetry-After
500Internal Server Error.ErrorApiResponse-
502Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON.--
503Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON.--

Return type​

FolderContentWrapper

Third-party storage​

For a file or folder in a connected third-party storage the identifier is a string such as sbox-42, and the call differs in these parts only:

NameInTypeDescriptionNotes
folderIdpathStringThe folder or room to search in; take the id from a listing such as `GET api/2.0/files/@root`. A numeric id addresses a folder of the portal, a string one a folder in a connected third-party storage.[required] [example: sbox-42]

Return type: ThirdPartyFolderContentWrapper

Authorization​

Basic, OAuth2 (scopes: read, write), ApiKeyBearer, asc_auth_key, Bearer, OpenId

HTTP request headers​

  • Content-Type: application/json
  • Accept: application/json