Bu sayfa henüz yerel dilinizde mevcut değildir. Daha fazla dil seçeneği eklemek için yoğun bir şekilde çalışıyoruz. Desteğiniz için teşekkür ederiz.
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}. |
X-User-Id |
Yes |
String |
User ID, which is used for app authentication. |
X-Date |
Yes |
String |
Date, which is used for app authentication. |
Host |
Yes |
String |
Address, which is used for app authentication. |
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.
|
pageInfo |
Yes |
pageInfo object |
Pagination information. |
filter |
No |
filter object |
Filter. |
sortInfo |
No |
sortInfo object |
Sorting information. |
recycled |
No |
Boolean |
Whether to query the recycle bin. The default value is false. The options are as follows:
|
recursived |
No |
Boolean |
Whether files in sub-directories are queried recursively. Default value: false. |
imageProcess |
No |
String |
Image operation, which can be used to specify the thumbnail size. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
pageSize |
Yes |
Integer |
Size of each page. The value ranges from 1 to 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. Fuzzy match is supported. The value contains up to 80 characters. |
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"), /* * Smart folder (available only to whitelisted users) / SMART_FOLDER("11"), /* * 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 downLoadLinks 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. |
attachments |
Attachment object |
Attachment. |
createTime |
String |
Creation time. |
editeTime |
String |
Editing time. |
lastEditor |
User object |
Last editor. |
mimeType |
String |
Content type. Content type. |
ownerId |
String |
Owner ID. |
owners |
Array of User objects |
Owner. |
parentFolder |
Array of strings |
List of the parent directory IDs. Currently, only the first ID is used. |
properties |
Map<String,String> |
Common user-defined attributes of the file. The number of key-value pairs cannot exceed 30. A single key-value pair can contain up to 124 characters. |
recycled |
Boolean |
Whether the file is moved to the recycle bin. |
sha256 |
String |
sha256 |
userCapabilities |
userCapabilities object |
User permissions. |
userProperties |
Array of FileListPrivateProperties objects |
Extended user attributes. |
Parameter |
Type |
Description |
---|---|---|
usage |
String |
Usage. The value can be thumbnail or content. |
downloadLink |
String |
Image address. |
Parameter |
Type |
Description |
---|---|---|
usage |
String |
Default usage: content or thumbnail. This parameter is customizable. |
assetId |
String |
Asset ID |
length |
Long |
File size. |
versionId |
String |
Asset version ID. |
mimeType |
String |
MIME type. |
hash |
String |
Hash of the resource associated with the asset. |
sha256 |
String |
SHA256 of the resource associated with the asset. |
createdTime |
String |
Time when the data is created. |
modifiedTime |
String |
Time when the data is last modified. |
attributes |
Map<String,Object> |
Type attributes. |
asset |
Asset object |
Asset. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Asset ID |
versionId |
String |
Asset version ID. |
version |
Long |
Version number. |
mimeType |
String |
MIME type |
keepPolicy |
Integer |
Storage policy of historical versions.
|
state |
Integer |
Data status.
|
createdTime |
String |
Time when the data is created. |
modifiedTime |
String |
Time when the data is last modified. |
lastModifyingUser |
String |
UPID of the user that last modifies the data. |
resource |
Resource object |
Resource. |
cipher |
Cipher object |
Cipher. |
attributes |
Map<String,Object> |
Type attributes. A key consists of letters and digits and starts with a letter. A value cannot contain emojis. The size of an attribute is not limited, but the total size cannot exceed 16 KB. Attribute options:
|
properties |
Map<String,String> |
Extended attributes. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
ID of the file resource. |
hash |
String |
Hash of the file resource. |
length |
Long |
Size of the file resource. |
sha256 |
String |
SHA256 of the file (used for integrity check). |
type |
Integer |
Resource type.
|
state |
Integer |
Data status.
|
sliceSize |
Long |
Part size. |
hfek |
String |
Hash of the FEK of the encrypted file. This parameter is applicable when type is set to 0. |
iv |
String |
IV of the encrypted file. This parameter is applicable when type is set to 0. |
createdTime |
String |
Time when the data is created. |
modifiedTime |
String |
Time when the data is last modified. |
objects |
Array of SliceObject objects |
Part object, which is applicable when type is set to 0 or 3. |
attributes |
Map<String,Object> |
Type attributes. |
properties |
Map<String,String> |
Extended attributes. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Part ID. |
number |
Integer |
Part No., starting from 0. This parameter is not applicable when type is set to 12. |
start |
Long |
Start position of a part, which is not applicable when type is set to 12. |
sha256 |
String |
SHA256 of the part (or SHA256 of the ciphertext if the part is encrypted.) |
length |
Long |
Part length (or ciphertext length if the part is encrypted). |
bucket |
String |
OBS bucket information. |
createdTime |
String |
Time when the data is created. |
modifiedTime |
String |
Time when the data is last modified. |
uploadUrl |
EndpointURL object |
Upload URL. |
downloadUrl |
EndpointURL object |
Download URL. |
uploadId |
String |
Multipart upload ID. This parameter is applicable when type is set to 12 and uploadMode is set to multipart. |
attributes |
Map<String,Object> |
Type attributes. |
properties |
Map<String,String> |
Extended attributes. |
images |
Array of Images objects |
Thumbnail. |
Parameter |
Type |
Description |
---|---|---|
url |
String |
URL |
method |
String |
http method |
headers |
Map<String,String> |
http headers |
forms |
Map<String,String> |
Form parameter, which is applicable when type is set to 12 and uploadMode is set to post. |
partId |
String |
Multipart parameter, which is applicable when type is set to 12 and uploadMode is set to multipart. |
Parameter |
Type |
Description |
---|---|---|
process |
String |
File resource name. |
downloadUrl |
EndpointURLMetadata object |
URL structure for file upload or download. |
Parameter |
Type |
Description |
---|---|---|
algorithm |
String |
Encryption algorithm. |
hfek |
String |
Hash of the FEK of the encrypted file. This parameter is applicable when type is set to 0 or 4. |
iv |
String |
IV of the encrypted file. This parameter is applicable when type is set to 0 or 4. |
dataType |
Integer |
Data type.
|
keychains |
Array of Keychain objects |
Keychain. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Key UUID. |
type |
Integer |
Key type.
|
algorithm |
String |
Encryption algorithm. |
ekey |
String |
Encrypted key. |
Parameter |
Type |
Description |
---|---|---|
category |
String |
Type. The value is drive#user. |
userId |
String |
Huawei user ID. |
displayName |
String |
Display name of the user. |
me |
Boolean |
Whether you are the user. |
permissionId |
String |
Permission ID. |
Parameter |
Type |
Description |
---|---|---|
addChildNodePermission |
Boolean |
Whether the user can add sub-directories or sub-files. |
copyPermission |
Boolean |
Whether the user can copy files. |
deletePermission |
Boolean |
Whether the user can delete files. |
downloadPermission |
Boolean |
Whether the use can download content. |
editPermission |
Boolean |
Whether the user can edit files. |
listChildNodePermission |
Boolean |
Whether the user can list sub-directories or sub-files. |
removeChildNodePermission |
Boolean |
Whether the user can move sub-directories. |
renameFilePermission |
Boolean |
Whether the user can rename files. |
shareFilePermission |
Boolean |
Whether the user can share files. |
uploadPermission |
Boolean |
Whether the user can upload files. |
viewPermission |
Boolean |
Whether the user can preview files. |
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
{ "files" : [ { "id" : "Fu2A5BQZ1qUk3h1tU6ZlAS66swzlN9mnJ", "sha256" : "57eafb818ad716aa11b443fb9fc2c1f23875f0c8da49035a8ca98136e4525632", "fileName" : "KooDrive Service Overview.docx", "fileSuffix" : "docx", "fileType" : "26", "size" : "705395", "updateTime" : "2024-12-25T06:41:22.873Z", "idPath" : "DFcz6PEuDwIArootIAAFWbRXM-jxLg8CA1578177668157825025", "downloadLinks" : [ { "usage" : "content", "downloadLink" : "https://b10-obs-ykj-uat-01.obs.cidc-rp-2006.joint.cmecloud.cn/18ad967c9af047fd8b909ed163c0fdb6086?response-content-disposition=attachment%3B%20filename%2A%3DUTF-8%27%27KooDrive%25E6%259C%258D%25E5%258A%25A1%25E4%25BB%258B%25E7%25BB%258D.docx&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20250103T023324Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Credential=MKRISPBZAJWFHNBJ5WLB%2F20250103%2Fcidc-rp-2006%2Fs3%2Faws4_request&X-Amz-Signature=e518a982307ef9b6d6e4bd8788e421d3488f58f3ed79eb3ab42702ac5c3d7513" }, { "usage" : "thumbnail", "downloadLink" : "https://b10-obs-ykj-uat-01.obs.cidc-rp-2006.joint.cmecloud.cn/18ad967c9af047fd8b909ed163c0fdb6086?x-image-process=image%2Fresize%2Cm_lfit%2Ch_128%2Cw_128&response-content-disposition=attachment%3B%20filename%2A%3DUTF-8%27%27KooDrive%25E6%259C%258D%25E5%258A%25A1%25E4%25BB%258B%25E7%25BB%258D.docx&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20250103T023324Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Credential=MKRISPBZAJWFHNBJ5WLB%2F20250103%2Fcidc-rp-2006%2Fs3%2Faws4_request&X-Amz-Signature=ad55a09e66ddd32c6f9b3cce08c7c9a867c7a579a41200f415fb2918de1ab473" } ], "teamName" : "fdsgdsf", "teamId" : "1578175198769733633", "containerId" : "IAAFWbRXM-jxLg8CA1578177668157825025", "containerType" : "0", "favorite" : false, "owner" : "hid42638091", "ownerId" : "1568722386902108288", "properties" : { "localCreatedAt" : "", "localUpdatedAt" : "", "createUser" : "1568722386902108288", "lastEditUser" : "1568722386902108288", "auditResult" : "{\"auditDetail\":\"{}\",\"auditLevel\":10,\"auditResult\":1}" }, "attachments" : [ { "assetId" : "1584078561541652992", "asset" : { "id" : "1584078561541652992", "versionId" : "1584078561541652993", "version" : 49923, "mimeType" : "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "state" : 0, "createdTime" : "2024-12-25T06:41:20.050Z", "modifiedTime" : "2024-12-25T06:41:20.050Z", "resource" : { "id" : "1584078561810055808", "length" : 705395, "sha256" : "57eafb818ad716aa11b443fb9fc2c1f23875f0c8da49035a8ca98136e4525632", "object" : { "id" : "18ad967c9af047fd8b909ed163c0fdb6086", "start" : 0, "downloadUrl" : { "url" : "https://b10-obs-ykj-uat-01.obs.cidc-rp-2006.joint.cmecloud.cn/18ad967c9af047fd8b909ed163c0fdb6086?response-content-disposition=attachment%3B%20filename%2A%3DUTF-8%27%27KooDrive%25E6%259C%258D%25E5%258A%25A1%25E4%25BB%258B%25E7%25BB%258D.docx&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20250103T023324Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Credential=MKRISPBZAJWFHNBJ5WLB%2F20250103%2Fcidc-rp-2006%2Fs3%2Faws4_request&X-Amz-Signature=e518a982307ef9b6d6e4bd8788e421d3488f58f3ed79eb3ab42702ac5c3d7513", "method" : "GET" }, "images" : [ { "process" : "image/resize,m_lfit,h_128,w_128", "downloadUrl" : { "url" : "https://b10-obs-ykj-uat-01.obs.cidc-rp-2006.joint.cmecloud.cn/18ad967c9af047fd8b909ed163c0fdb6086?x-image-process=image%2Fresize%2Cm_lfit%2Ch_128%2Cw_128&response-content-disposition=attachment%3B%20filename%2A%3DUTF-8%27%27KooDrive%25E6%259C%258D%25E5%258A%25A1%25E4%25BB%258B%25E7%25BB%258D.docx&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20250103T023324Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Credential=MKRISPBZAJWFHNBJ5WLB%2F20250103%2Fcidc-rp-2006%2Fs3%2Faws4_request&X-Amz-Signature=ad55a09e66ddd32c6f9b3cce08c7c9a867c7a579a41200f415fb2918de1ab473", "method" : "GET" } } ] } }, "attributes" : { "fileName" : "KooDrive Service Overview.docx", "localCreatedAt" : "", "createdBy" : "667706171d1c4ef2a4d7464f3656066c", "resource" : { "id" : "1584078561810055808", "object" : { "bucket" : "b10-obs-ykj-uat-01", "objectId" : "18ad967c9af047fd8b909ed163c0fdb6086" } }, "localUpdatedAt" : "" } }, "versionId" : "1584078561541652993", "attributes" : { "fileName" : "KooDrive Service Overview.docx", "localCreatedAt" : "", "createdBy" : "667706171d1c4ef2a4d7464f3656066c", "resource" : { "id" : "1584078561810055808", "object" : { "bucket" : "b10-obs-ykj-uat-01", "objectId" : "18ad967c9af047fd8b909ed163c0fdb6086" } }, "localUpdatedAt" : "" }, "hash" : "57eafb818ad716aa11b443fb9fc2c1f23875f0c8da49035a8ca98136e4525632", "length" : 705395, "mimeType" : "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "usage" : "content", "sha256" : "57eafb818ad716aa11b443fb9fc2c1f23875f0c8da49035a8ca98136e4525632", "createdTime" : "2024-12-25T06:41:20.050Z", "modifiedTime" : "2024-12-25T06:41:20.050Z" } ], "createdTime" : "2024-12-25T06:41:19.794Z", "editedTime" : "2024-12-25T06:41:22.873Z", "lastEditor" : { "category" : "drive#user", "me" : true, "permissionId" : "1570905506917367936", "userId" : "NDEzMDA4NjAwMDAwMjc0MTY2NS02Njc3MDYxNzFkMWM0ZWYyYTRkNzQ2NGYzNjU2MDY2Yw", "displayName" : "hid42638091" }, "mimeType" : "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "owners" : [ { "category" : "drive#user", "me" : true, "permissionId" : "1570905506917367936", "userId" : "NDEzMDA4NjAwMDAwMjc0MTY2NS02Njc3MDYxNzFkMWM0ZWYyYTRkNzQ2NGYzNjU2MDY2Yw" } ], "parentFolder" : [ "DFcz6PEuDwIArootIAAFWbRXM-jxLg8CA1578177668157825025" ], "recycled" : false, "userProperties" : { "properties" : { "hidden" : "false" } }, "userCapabilities" : { "addChildNodePermission" : true, "copyPermission" : true, "deletePermission" : true, "downloadPermission" : true, "editPermission" : true, "listChildNodePermission" : true, "removeChildNodePermission" : true, "renameFilePermission" : true, "shareFilePermission" : true, "uploadPermission" : true, "viewPermission" : true } } ], "total" : 1, "code" : 0, "msg" : "Successful." }
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