Help Center/ KooDrive/ API Reference/ API/ File Favorites/ Listing Files in Favorites
Updated on 2024-08-05 GMT+08:00

Listing Files in Favorites

Function

List files in favorites. Up to 100 files are supported.

URI

GET /koodrive/ose/v1/star/files

Table 1 Query Parameters

Parameter

Mandatory

Type

Description

pageSize

No

Integer

Number of records to be returned on each page. Default and maximum value: 100. It is possible that partial or empty result pages are returned before the end of the result list has been reached.

Maximum: 100

pageCursor

No

String

Current page cursor, which is obtained from nextCursor of the previous response.

sortType

No

Integer

Sorting type. 1: by the time when a file is added to favorites (default).

sortDirection

No

Integer

Sorting order. 1: ascending; 2: descending (default).

fileType

No

String

File type.

  • 10: folder.

  • 15: image.

  • 20: video.

  • 26: Word file.

  • 27: Excel file.

  • 28: PowerPoint file.

  • 30: audio.

  • 35: compressed file.

  • 40: application.

  • 45: other.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

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-hw-trace-id

No

String

Message log trace ID. The value contains 58 bits.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

nextCursor

String

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

autoDeleted

Integer

Number of automatically deleted files (original files have been physically deleted).

starFiles

Array of StarFileInfo objects

Table 4 StarFileInfo

Parameter

Type

Description

category

String

Type. The value is drive#file.

Enumeration values:

  • drive#file

id

String

File ID.

fileName

String

File name, which contains up to 160 bytes.

fileType

String

File type, which is input externally.

mimeType

String

Content type.

description

String

File description. The value contains up to 512 characters and cannot contain emojis or invalid characters.

Maximum: 512

favorite

Boolean

Whether the file is added to favorites.

recycled

Boolean

Whether the file is moved to the recycle bin.

directlyRecycled

Boolean

Whether the file is directly moved to the recycle bin. If the folder containing this file is deleted, the value is false. If the file is directly deleted, the value is true.

recyclingUser

User object

User that deletes the file.

recycledTime

String

Time when the file is moved to the recycle bin.

parentFolder

Array of strings

List of 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.

appSettings

Map<String,String>

User-defined app attributes. 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.

version

Integer

Version number.

createdTime

String

File creation time.

editedTime

String

File modification time.

editedByMeTime

String

Time when you modify the file.

editedByMe

Boolean

Whether the file is modified by you.

sharedWithMeTime

String

Time when the file is shared to you.

sharer

User object

User who shares the file.

owners

Array of User objects

Owner.

lastEditor

User object

Last editor.

hasShared

Boolean

Whether the file is shared.

ownedByMe

Boolean

Whether the file is uploaded by you.

capabilities

Capabilities object

Capabilities.

viewersHasCopyContentPermission

Boolean

Whether a viewer can copy content.

writerHasCopyPermission

Boolean

Whether the writer permission is required for replication.

writersHasSharePermission

Boolean

Whether a user with the write permission can share the file.

originalFilename

String

Original file name, which contains up to 80 characters. The value cannot contain <>|:"*? /\ or emojis. The value cannot be two periods (..), a period (.), or a space.

fullFileSuffix

String

Complete file name extension, which is the characters following the first period (.) in the name.

fileSuffix

String

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

size

Integer

File size.

pictureMetadata

PictureMetadata object

Image metadata.

videoMetadata

VideoMetadata object

Video metadata.

audioMetadata

AudioMetadata object

Audio metadata.

sha256

String

SHA256 of the file.

lastHistoryVersionId

String

ID of the latest historical version.

attachments

Array of Attachment objects

Attachment (Usage, Attachment). Only the app ID of the risk control service is returned.

iconDownloadLink

String

Icon link.

existThumbnail

Boolean

Whether a thumbnail is available.

privateKey

String

Special folder ID. The usage rules are as follows:

  • The name cannot be _default.

  • This parameter can be specified only when the folder is created in the space root directory.

  • This parameter can be specified only when a folder is created.

  • The value must be unique in the same space.

signedDownloadLink

String

Download link of the FileProxy signature, which is used for online playback.

downloadLinks

Array of DownloadLink objects

Link for downloading FileProxy files.

localPath

String

ID path of the top-level parent directory during change (the first 10 levels are used). This parameter is returned for change record and file query.

sortName

String

Sorting name after filename conversion.

userProperties

PrivateProperties object

User attributes.

starredTime

String

Time when the file is added to favorites.

filePath

String

File location, specific to the team name.

spaceType

String

Space type.

  • 1: individual space.

  • 2: team space.

  • 3: recycle bin.

  • 4: space without access permission.

invalid

Integer

Whether the file has expired. *0: normal; 1: expired.

metadataAuditInfo

FileAuditInfo object

File moderation information.

contentAuditInfo

FileAuditInfo object

File moderation information.

Table 5 User

Parameter

Type

Description

category

String

Type. The value is drive#user.

Enumeration values:

  • 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 6 Capabilities

Parameter

Type

Description

addChildNodePermission

Boolean

Whether a sub-directory or sub-file can be added.

writerHasChangeCopyPermission

Boolean

Whether the write permission is required for change and replication.

commentPermission

Boolean

Whether comments can be made.

copyPermission

Boolean

Whether the file can be copied.

deletePermission

Boolean

Whether the file can be deleted.

downloadPermission

Boolean

Whether the content can be downloaded.

editPermission

Boolean

Whether the file can be edited.

listChildNodePermission

Boolean

Whether sub-directories or sub-files can be listed.

editContentPermission

Boolean

Whether the content can be modified.

readHistoryVersionPermission

Boolean

Whether a backup can be read.

removeChildNodePermission

Boolean

Whether a sub-directory can be moved.

renameFilePermission

Boolean

Whether the file can be renamed.

shareFilePermission

Boolean

Whether the file can be shared.

recyclePermission

Boolean

Whether the file can be moved to the recycle bin.

unrecyclePermission

Boolean

Whether moving a sub-file to the recycle bin can be withdrawn.

Table 7 PictureMetadata

Parameter

Type

Description

width

Integer

Photo width.

height

Integer

Photo height.

rotation

Integer

Photo rotation angle. This parameter is not available currently.

location

Location object

Location information.

exifTime

String

Time of the photo. The value is an EXIF DateTime.

cameraMaker

String

Camera manufacturer.

cameraModel

String

Camera model.

exposureTime

Float

Exposure time, in seconds.

aperture

Float

Aperture f-number.

flashUsed

Boolean

Whether the flash is used.

focalLength

Float

Focal length, in millimeters.

isoSpeed

Integer

ISO speed.

meteringMode

String

Metering mode.

sensor

String

Sensor type.

exposureMode

String

Exposure mode.

colorSpace

String

Color space.

whiteBalance

String

White balance mode.

exposureBias

Float

Exposure bias. The value is an APEX value.

maxApertureValue

Float

Maximum aperture. The value is an APEX value.

subjectDistance

Integer

Distance to subject, in meters. This parameter is not available currently.

lens

String

Lens.

Table 8 Location

Parameter

Type

Description

latitude

Double

Latitude.

longitude

Double

Longitude.

altitude

Double

Altitude.

Table 9 VideoMetadata

Parameter

Type

Description

width

Integer

Width.

height

Integer

Altitude.

durationTime

Integer

Duration, in milliseconds.

position

String

Longitude and latitude information. The format is "x":"111","y":"222","z":"2222".

rotation

Integer

Rotation angle. Value range: 1 to 8.

format

String

Video encoding format, for example, H.264, H.265, VP8, VP9, Ogg, and MPEG-4 AVC.

dynamicRange

String

SDR or HDR.

snapshotTime

String

Shooting time.

Table 10 AudioMetadata

Parameter

Type

Description

durationTime

Integer

Duration, in milliseconds.

sampleRate

String

Sampling rate, for example, 16,000 or 48,000.

encoding

String

Audio encoding format, for example, PCM, AAC, AMR, or AMR-WB.

codeRate

Number

Bit rate, in kbit/s. Example: 12.8.

rateModel

String

Bit rate mode, for example, CBR.

languageCode

String

Language code, for example, en.

Table 11 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 12 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. Two versions are retained. The earliest version is deleted when the third version is added. (This prevents obtaining failures in concurrent scenarios.)

  • 1: permanent storage.

Default: 0

state

Integer

Data status.

  • 0: available.

  • 1: unavailable.

  • 2: temporary.

  • 3: retained (flash upload unsupported).

  • 4: to be cut over.

Enumeration values:

  • 0

  • 1

  • 2

  • 3

  • 4

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 13 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 14 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.

Table 15 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 16 Cipher

Parameter

Type

Description

algorithm

String

Encryption algorithm.

Enumeration values:

  • AES_128_CBC_PKCS5Padding

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.

Enumeration values:

  • 0

  • 1

  • 10

  • 11

keychains

Array of Keychain objects

Keychain.

Table 17 Keychain

Parameter

Type

Description

id

String

Key UUID.

Maximum: 128

type

Integer

Key type.

  • 1: efek.

  • 2: zfek.

  • 3: sfek.

algorithm

String

Encryption algorithm.

Enumeration values:

  • AES_128_CBC_PKCS5Padding

  • AES_256_CBC_PKCS5Padding

ekey

String

Encrypted key.

Maximum: 512

Table 19 PrivateProperties

Parameter

Type

Description

attributes

Map<String,Object>

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 20 FileAuditInfo

Parameter

Type

Description

auditStatus

Integer

Moderation status.

  • 0: not reviewed.

  • 1: reviewed.

Enumeration values:

  • 0

  • 1

auditLevel

Integer

Moderation level.

  • 10: machine moderation.

  • 20: human moderation.

  • 30: machine and human moderation.

  • 99: appeal moderation.

Enumeration values:

  • 10

  • 20

  • 30

  • 99

auditResult

Integer

Moderation result.

  • 1: normal file.

  • 2: file with low-sensitive content.

  • 3: file with high-sensitive content.

  • 4: file with sensitive metadata.

Enumeration values:

  • 1

  • 2

  • 3

  • 4

auditDetail

String

Moderation details.

Example Requests

None

Example Responses

None

Status Codes

Status Code

Description

200

OK