Retrieving Files Using Search Engine Capabilities
Function
Search for files in a space by conditions such as search scope, parent directory, file name, file size range, update time range, and owner. Common users and department administrators can search for their individual and team space. Tenant administrators can search for all team spaces of the tenant.
URI
POST /koodrive/ose/v1/files/search
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Traceid |
No |
String |
Message log trace ID. The value contains 58 bits. |
Authorization |
Yes |
String |
Access token. Token authentication is used to call KooDrive APIs. A token indicates the permission. When an API is called, the token is added to the request header to obtain the operation permission. For details about how to obtain an access token, see the corresponding developer guide. The format is Bearer+{access_token}. |
language |
No |
String |
Language code, which complies with the internationalization specifications. For example, en-US indicates English (United States). English (United States) is used by default. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
searchType |
Yes |
String |
Query type, which is the individual space or team space. |
pageInfo |
Yes |
pageInfo object |
Pagination information. |
filter |
No |
filter object |
Filter. |
sortInfo |
No |
sortInfo object |
Sorting information. |
recycled |
No |
Boolean |
Whether files in the recycle bin are queried.
Default: false |
recursived |
No |
Boolean |
Whether files in sub-directories are queried recursively. Default value: false. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
pageSize |
Yes |
Integer |
Number of records on each page. Minimum: 1 Maximum: 100 |
pageCursor |
Yes |
String |
Start cursor. If this parameter is null, the query starts from the first page. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
keyWord |
No |
String |
File name, which is used for fuzzy match. Minimum: 1 Maximum: 255 |
containerId |
No |
String |
Space ID. This parameter is mandatory when the parent directory is specified. |
parentFolder |
No |
String |
Parent directory. |
fileType |
No |
String |
File type. Enumerated values: /** * Folder / FOLDER("10"), /* * Image / PICTURE("15"), /* * Video / VIDEO("20"), /* * Word file / WORD("26"), /* * Excel file / EXCEL("27"), /* * PowerPoint file / PPT("28"), /* * Audio / AUDIO("30"), /* * Compressed file / ARCHIVE("35"), /* * Application / APPLICATION("40"), /* * Other */ OTHER("45"); |
updateTimeRange |
No |
String |
Update time range. |
ownerId |
No |
String |
File owner. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
sortType |
No |
String |
Enumerated values:
|
sortDirection |
No |
String |
Enumerated values:
|
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
code |
Integer |
Response code. 0 indicates success. Other values indicate failure. |
msg |
String |
Success and error information. |
files |
Array of files objects |
Search results |
total |
Integer |
Total number of records. |
nextPageCursor |
String |
Start cursor of the next page. It is null for the last page. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
File ID. |
fileSuffix |
String |
File suffix. |
fileName |
String |
File name. |
fileType |
String |
File type. |
size |
String |
File size. |
updateTime |
String |
Update time. |
namePath |
String |
Full name path. |
idPath |
String |
Full ID path. |
downloadLinks |
Array of DownLoadLink objects |
Thumbnail link, which is returned for an image. |
teamName |
String |
Department name or group space name returned for the team space. |
teamId |
String |
Group ID, that is, department ID or group ID. |
containerId |
String |
Space ID. |
containerType |
String |
0: department space; 1: individual space; 2: group space. |
favorite |
Boolean |
Whether the file returned by the individual space or team space is added to favorites by the current user. |
owner |
String |
Owner name returned for the team space. |
metadataAuditInfo |
FileAuditInfo object |
File moderation information. |
contentAuditInfo |
FileAuditInfo object |
File moderation information. |
Parameter |
Type |
Description |
---|---|---|
usage |
String |
Default usage: content or thumbnail. This parameter is customizable. |
downloadLink |
String |
Attachment download link. |
Parameter |
Type |
Description |
---|---|---|
auditStatus |
Integer |
Moderation status.
Enumeration values:
|
auditLevel |
Integer |
Moderation level.
Enumeration values:
|
auditResult |
Integer |
Moderation result.
Enumeration values:
|
auditDetail |
String |
Moderation details. |
Example Requests
Example request for searching for a file.
POST /koodrive/ose/v1/files/search Authorization:Bearer+10f88*********4791e9ff { "searchType" : " personal/team", "pageInfo" : { "pageSize" : 100, "pageCursor" : 1 }, "filter" : { "keyWord" : "Material", "containerId" : "123456", "parentFolder" : "1", "fileType" : "1", "sizeRang" : "1024,2048", "updateTimeRange" : "2023-11-02,2023-11-21", "ownerId" : "Owner ID" } }
Example Responses
Status code: 200
Search results
{ "code" : 0, "msg" : "success", "files" : [ { "id" : "Abc", "fileName" : "Abc", "fileType" : "1", "size" : "1024", "updateTime" : "2023-05-26T02:08:53.683Z", "namePath" : "", "downloadLinks" : "", "deptName" : "" } ], "total" : 1000 }
Status Codes
Status Code |
Description |
---|---|
200 |
Search results |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot