API: Searching files and folders
| Target URL | /api.php/Drive/files/search |
| Required scope | list |
| HTTP Method | POST |
| Output format | JSON |
Request Parameters Reference
| Parameter | Type | Required | Description |
|---|---|---|---|
| path | string | Yes | The FileRun path of the folder to search in. See this page |
| filename | string | No | Keyword to search in the file and folder names. |
| metatype | integer | No | ID of metadata file type. Get this from the FileRun control panel. |
| meta | array | No | The keys are metadata fields IDs, you can find them in FileRun's control panel. The key can also be any of the following strings: tag, rating, color, comment, or the character - for searching any field. The values are array of keywords to be searched for. |
| contents | string | No | Keyword to search files contents. Cannot be combined with any other search criteria. |
| details | array | No | Same as here. |
| limit | integer | No | The maximum number of items to return. 0, the default, returns all of them. |
| start | integer | No | The number of items to skip, for paging. |
The response has the same shape as the one of the listing endpoint: data.meta describes the searched folder and data.files holds the matching items.
The search works in the home folder (/ROOT/HOME), in the shares (/ROOT/SHARED/...), in the shared drives (/ROOT/DRIVES/...) and in the collections, and in the folders inside them. A search on another path, such as a web link, /ROOT/STARRED, /ROOT/RECENT, the trash or a media section, is refused with the status 400 and the message It is not possible to search in this location!.
A search by metadata (metatype and meta) needs the permission to read the metadata in the searched folder, and a search of the comments needs the permission to read the comments. In a share whose role does not allow it, such as Viewer or Uploader, the search is refused. - searches only the fields that the account can read.
A file whose name holds one of the characters \ / * ? < > | is left out of the results. Such a name can only be given on the storage, outside FileRun.
For additional details please see this page.