Help Center/KooDrive/API Reference(Carrier)/API/File Management/Retrieving Files Using Search Engine Capabilities
Updated on 2026-02-12 GMT+08:00

Retrieving Files Using Search Engine Capabilities

Function

You can search for files or folders in the cloud space by file name or type.

URI

POST /koodrive/ose/v1/files/search

Request Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

X-Traceid

No

String

Definition:

Service trace ID, which contains 58 bits.

Constraints:

N/A

Range:

The value contains 58 bits.

Default Value:

N/A

Authorization

Yes

String

Definition:

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}.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

language

No

String

Definition:

Language code.

Constraints:

The value must comply with the internationalization specifications. For example, en_us indicates English (United States).

Range:

The value must comply with the internationalization specifications.

Default Value:

en-US

X-User-Id

Yes

String

Definition:

User ID on KooDrive, which is used for app authentication.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

X-Date

Yes

String

Definition:

Date, which is used for app authentication. The format is yyyyMMdd'T'HHmmss'Z'.

Constraints:

The time must be within 15 minutes from the current time and cannot be later than the current time.

Range:

N/A

Default Value:

N/A

x-hw-share-folder-id

No

String

Definition:

ID of the shared folder. If this request header is passed, the current operation is performed in the shared folder.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

searchType

Yes

String

Definition:

Query type.

Constraints:

N/A

Range:

  • personal

Default Value:

N/A

pageInfo

Yes

PageInfo object

Definition:

Pagination information.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

filter

No

filter object

Definition:

Filter criterion.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

sortInfo

No

FileSortInfo object

Definition:

Sorting information.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

recursived

No

Boolean

Definition:

Whether files in sub-directories are queried recursively.

Constraints:

N/A

Range:

true or false

Default Value:

false

imageProcess

No

String

Definition:

Image operation, which can be used to specify the thumbnail size.

Constraints:

The length cannot exceed 300.

Range:

For details about the value, see https://support.huaweicloud.com/en-us/usermanual-obs/obs_01_0430.html.

Default Value:

image/resize,m_lfit,h_128,w_128

recycled

No

Boolean

Definition:

Recycle bin query.

Constraints:

N/A

Range:

true or false

Default Value:

false

Table 3 PageInfo

Parameter

Mandatory

Type

Description

pageSize

No

Integer

Definition:

Number of files on each page.

Constraints:

N/A

Range:

1 to 100

Default Value:

100

pageCursor

No

String

Definition:

Pagination start cursor.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

Table 4 filter

Parameter

Mandatory

Type

Description

keyWord

No

String

Definition:

File name.

Constraints:

The maximum length is 250.

Range:

N/A

Default Value:

N/A

containerId

No

String

Definition:

Space ID.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

parentFolder

No

String

Definition:

Parent directory ID.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

fileType

No

String

Definition:

File type.

Constraints:

N/A

Range:

10: folder

11: smart folder (available only to whitelisted users)

15: image

20: video

26: Word file

27: Excel file

28: PowerPoint file

30: audio

35: compressed file

40: application

45: other

Default Value:

N/A

sizeRange

No

String

Definition:

File size range, in bytes.

Constraints:

The value is in the format of "minimum value,maximum value", for example, 10,200.

Range:

N/A

Default Value:

N/A

updateTimeRange

No

String

Definition:

Update time range.

Constraints:

Example: 2025-05-16 16:00:00,2025-05-18 15:59:59

Range:

N/A

Default Value:

N/A

ownerId

No

String

Definition:

File owner ID.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

fileSuffixList

No

Array of strings

Definition:

File name extension.

Constraints:

The list can contain a maximum of 100.

Range:

N/A

Default Value:

N/A

Table 5 FileSortInfo

Parameter

Mandatory

Type

Description

sortType

No

Integer

Definition:

Sort field.

Constraints:

N/A

Range:

1: file name 2: file size 3: creation time 4: modification time 5: reclaim time (only for reclaimed files) 6: file format

Default Value:

N/A

sortDirection

No

Integer

Definition:

Sorting order.

Constraints:

N/A

Range:

1: ascending 2: descending

Default Value:

N/A

Response Parameters

Status code: 200

Table 6 Response body parameters

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.

Table 7 files

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.

containerId

String

Space ID.

containerType

String

0: department space 1: individual space

favorite

Boolean

Whether the file returned by the space is added to favorites by the current user.

owner

String

Owner name returned for the space.

attachments

Attachment object

Attachment.

createTime

String

Creation time.

editeTime

String

Editing time.

lastEditor

User object

Last editor.

mimeType

String

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,Object>

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.

Table 9 Attachment

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.

Table 10 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.

  • 0: automatic clearance

  • 1: permanent storage

state

Integer

Data status.

  • 0: available.

  • 1: unavailable.

  • 2: temporary.

  • 3: retained (flash upload unsupported).

  • 4: to be cut over.

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:

  • pictureMetadata: image attribute data. For details, see the definition of PictureMetadata.

  • videoMetadata: video attribute data. For details, see the definition of VideoMetadata.

  • audioMetadata: audio attribute data. For details, see the definition of AudioMetadata.

  • contentDisposition: used when response-content-disposition is not specified for the downloaded attachment (valid when resource.type is set to 12).

properties

Map<String,String>

Extended attributes.

Table 11 Resource

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.

  • 0: ciphertext multipart file.

  • 3: plaintext multipart file.

  • 12: plaintext single-part file.

state

Integer

Data status.

  • 0: available.

  • 1: unavailable.

  • 2: temporary.

  • 3: retained (flash upload unsupported).

  • 4: to be cut over.

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.

Table 12 SliceObject

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.

Table 13 EndpointURL

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.

Table 14 Images

Parameter

Type

Description

process

String

File resource name.

downloadUrl

EndpointURLMetadata object

URL structure for file upload or download.

Table 15 EndpointURLMetadata

Parameter

Type

Description

url

String

URL

method

String

http method

Table 16 Cipher

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.

  • 11: sync drive.

keychains

Array of Keychain objects

Keychain.

Table 17 Keychain

Parameter

Type

Description

id

String

Key UUID.

type

Integer

Key type.

  • 1: efek.

  • 2: zfek.

  • 3: sfek.

algorithm

String

Encryption algorithm.

ekey

String

Encrypted key.

Table 18 User

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.

Table 19 userCapabilities

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.

Table 20 FileListPrivateProperties

Parameter

Type

Description

properties

Map<String,String>

Extended attributes (The size of a single attribute is not limited, but the total size cannot exceed 16 KB.)

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