Help Center/KooDrive/API Reference(Carrier)/API/File List Query/Listing Files in the Individual Space
Updated on 2026-02-12 GMT+08:00

Listing Files in the Individual Space

Function

List files in the individual space.

URI

POST /koodrive/ose/v1/files/{type}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

type

Yes

String

Definition:

Space type.

Constraints:

N/A

Range:

0: individual space 1: individual recycle bin

Default Value:

N/A

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

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.

Constraints:

The format is Bearer+{access_token}.

Range:

For details about how to obtain an access token, see the corresponding developer guide.

Default Value:

N/A

X-Traceid

No

String

Definition:

Message log trace ID. The value contains 58 bits.

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.

Range:

en_us indicates English (United States)

Default Value:

English (United States)

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.

Constraints:

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

Range:

The format is yyyMMdd'T'HHmmss'Z', for example, 20251103T070140Z.

Default Value:

N/A

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

pageInfo

No

PageInfo object

Definition:

Pagination information.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

sortInfo

No

FileSortInfo object

Definition:

Classification information.

Constraints:

N/A

Range:

N/A

containerId

Yes

String

Definition:

Space ID.

Constraints:

The length cannot exceed 64.

Range:

N/A

Default Value:

N/A

parentFileId

Yes

String

Definition:

Parent directory of the file.

Constraints:

The length cannot exceed 64.

Range:

For querying the root directory, pass root. For querying other directories, pass the parent directory ID.

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: others

Default Value:

N/A

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:

N/A

hidden

No

Boolean

Definition: whether to query hidden files (only for whitelisted users)

Constraints:

N/A

Range:

N/A

Default Value:

N/A

fileName

No

String

Definition:

File name.

Constraints:

The length cannot exceed 80.

Range:

N/A

Default Value:

N/A

Table 4 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 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

category

String

Resource type. The value is fixed to drive#fileList.

nextCursor

String

Pagination cursor. If the cursor does not exist, the last record has been returned.

searchCompleted

Boolean

Whether the search is complete.

files

Array of FileListMetadata objects

File list.

code

String

Response code.

msg

String

Response information.

Table 7 FileListMetadata

Parameter

Type

Description

id

String

File ID.

fileName

String

File name, which contains up to 250 characters.

fileType

String

File type, which is input externally.

mimeType

String

Content type.

favorite

Boolean

Whether the file is added to favorites.

recycled

Boolean

Whether the file is moved to the recycle bin.

recycledTime

String

Time when the file is moved to the recycle bin. This parameter is returned when the file is recycled.

parentFolder

Array of strings

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

containers

Array of strings

Space ID.

createdTime

String

UTC time when the file is created.

editedTime

String

UTC time when the file is modified.

owners

Array of User objects

Owner.

lastEditor

User object

Last editor.

fileSuffix

String

File name extension, which is the last character string of fullFileExtension.

size

Long

File size, in bytes.

attachments

Array of FileListAttachment objects

Attachment.

downloadLinks

Array of downLoadLinks objects

Link for downloading FileProxy files.

userProperties

Array of PrivateProperties objects

User attributes.

sha256

String

SHA256 value of the file.

userCapabilities

userCapabilities object

User permissions.

hidden

Boolean

Whether it is hidden.

directlyRecycled

Boolean

Directly reclaimed or not.

idPath

String

ID path of the file or folder.

creatingUser

String

Creator.

Table 8 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 9 FileListAttachment

Parameter

Type

Description

usage

String

Default usage: content or thumbnail. This parameter is customizable.

hash

String

Hash of the resource associated with the asset.

sha256

String

SHA256 of the resource associated with the asset.

asset

FileListAsset object

Asset.

Table 10 FileListAsset

Parameter

Type

Description

resource

FileListResource object

Resource.

mimeType

String

MIME type

Table 11 FileListResource

Parameter

Type

Description

object

FileListSliceObject object

Part object, which is applicable when type is set to 0 or 3.

Table 12 FileListSliceObject

Parameter

Type

Description

id

String

Part ID.

start

Integer

Start position of a part, which is not applicable when type is set to 12.

downloadUrl

EndpointURLMetadata object

Download URL.

image

Array of Images objects

Thumbnail information.

Table 13 Images

Parameter

Type

Description

process

String

File resource name.

downloadUrl

EndpointURLMetadata object

URL structure for file upload or download.

Table 14 EndpointURLMetadata

Parameter

Type

Description

url

String

URL

method

String

http method

Table 16 PrivateProperties

Parameter

Type

Description

attributes

Map<String,String>

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

properties

Map<String,String>

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

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

Status code: 400

Table 18 Response body parameters

Parameter

Type

Description

error

Error object

Error message.

Table 19 Error

Parameter

Type

Description

errorData

errorData object

Extended data returned to visitors when an exception occurs.

errorDetail

Array of ErrorMsg objects

Error chain.

code

Integer

HTTP status code.

description

String

HTTP status information.

Table 20 errorData

Parameter

Type

Description

conflictFileId

String

Conflicting file ID.

Table 21 ErrorMsg

Parameter

Type

Description

domain

String

Domain.

reason

String

Error cause.

errorCode

String

Internal system error code. For details, see the error code specifications.

description

String

Error message.

errorPos

String

Error position type.

errorParam

String

Error position.

Example Requests

Lists files in the root directory of individual space IAADfsBFCO6WtAtuAb7e92cde625843cfb7f4ceba802e0b.

POST /koodrive/ose/v1/files/0

Authorization:Bearer+10f88*********4791e9ff

{
  "pageInfo": {
    "pageSize": "10",
    "pageCursor": ""
  },
  "sortInfo": {
    "sortType": "",
    "sortDirection": ""
  },
  "containerId": "IAADfsBFCO6WtAtuAb7e92cde625843cfb7f4ceba802e0b",
  "parentFileId": "root",
  "fileType": "",
  "fileName": ""
}

Example Responses

Status code: 200

Returns the file list.

{
  "category" : "drive#fileList",
  "nextCursor" : "0|[9-1-0,11-0-1][JzIwMjMtMTItMTNUMDM6MzA6NTkuNTU4Wic=,J0ZpQk02VHhsS2JiSEx4LW54X3FaT2M1bFJBZXEwU0xZeCc=]",
  "searchCompleted" : false,
  "files" : [ {
    "id" : "Fk0n_I_3nVynIIlxGSUdLkYILxIZQ5Yyp",
    "fileName" : "AI Test",
    "mimeType" : "application/vnd.huawei-apps.folder",
    "fileSuffix" : "",
    "recycled" : false,
    "parentFolder" : [ "DEUI7pa0C24ArootIAADfsBFCO6WtAtuAb7e92cde625843cfb7f4ceba802e0b" ],
    "containers" : [ "IAADfsBFCO6WtAtuAb7e92cde625843cfb7f4ceba802e0b" ],
    "properties" : {
      "srcFileId" : "Fuyt9uELO9mny6vLWnWpIDqppRh3vzC3p",
      "createUser" : "369528171409614001",
      "lastEditUser" : "369528171409614001"
    },
    "owners" : [ {
      "category" : "drive#user",
      "me" : true,
      "permissionId" : "1243622029865966464",
      "userId" : "NDEzMDA4NjAwMDAwMjc0MTY2NS00MDA4NjAwMDAwNDg3MTY2Ng",
      "displayName" : "Tenant Administrator"
    } ],
    "lastEditor" : {
      "category" : "drive#user",
      "me" : true,
      "permissionId" : "1243622029865966464",
      "userId" : "NDEzMDA4NjAwMDAwMjc0MTY2NS00MDA4NjAwMDAwNDg3MTY2Ng",
      "displayName" : "Tenant Administrator"
    },
    "fileType" : "10",
    "createdTime" : "2023-12-11T09:17:25.529Z",
    "editedTime" : "2023-12-11T09:17:25.529Z",
    "favorite" : false
  } ],
  "code" : 0,
  "msg" : "OK"
}

Status Codes

Status Code

Description

200

Returns the file list.

400

Bad request