Listing Files in Favorites
Function
List files in favorites. Up to 100 files are supported each time.
URI
GET /koodrive/ose/v1/star/files
Parameter | Mandatory | Type | Description |
|---|---|---|---|
pageSize | No | Integer | Definition: Number of pages. Constraints: N/A Range: ≤ 100 Default Value: 100 |
pageCursor | No | String | Definition: Cursor, which is obtained from nextCursor in the previous response. Constraints: N/A Range: N/A Default Value: N/A |
sortType | No | Integer | Definition: Sorting type. Constraints: N/A Range: Time when the file is added to favorites (default). Default Value: 1 |
sortDirection | No | Integer | Definition: Sorting direction type. Constraints: N/A Range: 1: ascending 2: descending (default) Default Value: 2 |
fileType | No | String | Definition: File type. Constraints: N/A Range: Default Value: N/A |
imageProcess | No | String | Definition: Thumbnail size. Constraints: N/A 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 |
Request 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. 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 |
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 |
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 |
Response Parameters
Status code: 200
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). |
starFileList | Array of StarFile objects | Favorite file information. |
code | String | Response code. |
msg | String | Response information. |
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. |
parentFolder | Array of strings | List of parent directory IDs. Currently, only the first ID is used. |
properties | Map<String,String> | List of parent directory IDs. Currently, only the first ID is used. 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 | File creation time. |
editedTime | String | File modification time. |
owners | Array of owners objects | Owner. |
lastEditor | lastEditor object | Last editor. |
fileSuffix | String | File name extension, which is the last character string of fullFileExtension. |
size | Integer | File size. |
sha256 | String | SHA256 of the file. |
attachments | Array of attachments objects | Attachment (purpose and attachment). Only the app ID of the risk control service is returned. |
downloadLinks | Array of DownloadLink objects | Link for downloading FileProxy files. |
userProperties | userProperties object | User property. |
starredTime | String | Time when the file is added to favorites. |
filePath | String | File location, specific to the team name. |
spaceType | String | Space type: |
invalid | Integer | Whether the file has expired. 0: normal 1: expired |
hidden | Boolean | Whether the file is hidden. |
userCapabilities | userCapabilities object | User permissions. |
Parameter | Type | Description |
|---|---|---|
category | String | Type. The value is drive#user. |
userId | String | Huawei user ID. |
me | Boolean | Whether you are the user. |
permissionId | String | Permission ID. |
Parameter | Type | Description |
|---|---|---|
category | String | Type. The value is drive#user. |
userId | String | Huawei user ID. |
me | Boolean | Whether you are the user. |
permissionId | String | Permission ID. |
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 | asset object | Assets. |
Parameter | Type | Description |
|---|---|---|
objects | Array of SliceObject objects | Part object, which is applicable when type is set to 0 or 3. |
Parameter | Type | Description |
|---|---|---|
id | String | Part ID. |
start | Long | Start position of a part, which is not applicable when type is set to 12. |
downloadUrl | downloadUrl object | Download URL. |
images | Array of Images objects | Thumbnail. |
Parameter | Type | Description |
|---|---|---|
process | String | File resource name. |
downloadUrl | EndpointURLMetadata object | URL structure for file upload or download. |
Parameter | Type | Description |
|---|---|---|
usage | String | Default usage: content or thumbnail. This parameter is customizable. |
downloadLink | String | Attachment download link. |
Parameter | Type | Description |
|---|---|---|
properties | Map<String,String> | Extended properties (The size of a single property is not limited, but the total size cannot exceed 16 KB.) |
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
Sorts 100 files displayed on each page in descending order by collection time, and displays thumbnails according to the size.
GET /koodrive/ose/v1/star/files?pageSize=100&sortDirection=2&sortType=1&imageProcess=image/resize,m_lfit,h_128,w_128%3Bimage/resize,m_lfit,h_480,w_480%3Bimage/resize,m_lfit,h_800,w_800%3Bimage/resize,m_lfit,h_1080,w_1080&tenantId=667706171d1c4ef2a4d7464f3656066c Authorization: Bearer+f19b0*********1421be9c
Example Responses
Status code: 200
OK
{
"starFileList": [
{
"id": "Fo*********A",
"fileName": "Hello.jpg",
"favorite": true,
"starredTime": "2025*********Z",
"mimeType": "image/jpeg",
"fileSuffix": "jpg",
"recycled": false,
"hidden": false,
"size": 2058,
"parentFolder": [
"DFkaJ_Mm*********77"
],
"containers": [
"I*********77"
],
"properties": {
"path": "rootI*********WA",
"localCreatedAt": "",
"localUpdatedAt": "",
"auditResult": "{\"auditDetail\":\"{}\",\"auditLevel\":10,\"auditResult\":1}"
},
"sha256": "938c32*********8a506029",
"attachments": [
{
"asset": {
"resource": {
"object": {
"id": "002*********86",
"start": 0,
"downloadUrl": {
"url": "https://*********",
"method": "GET"
},
"images": [
{
"process": "image/resize,m_lfit,h_128,w_128",
"downloadUrl": {
"url": "https://*********",
"method": "GET"
}
}
]
}
}
},
"hash": "938c*********029",
"usage": "content",
"sha256": "938c*********029"
}
],
"owners": [
{
"category": "dr*********r",
"me": true,
"permissionId": "160*********76",
"userId": "ZWU*********M0NA"
}
],
"lastEditor": {
"category": "drive#user",
"me": true,
"permissionId": "160*********76",
"userId": "ZWU*********M0NA"
},
"fileType": "15",
"createdTime": "2025-*********Z",
"editedTime": "2025-*********Z",
"userProperties": {
"attributes": {
"starred": "false"
},
"properties": {
"hidden": "false"
}
},
"downloadLinks": [
{
"usage": "content",
"downloadLink": "https://*********"
},
{
"usage": "thumbnail",
"downloadLink": "https://*********"
}
],
"userCapabilities": {
"addChildNodePermission": true,
"copyPermission": true,
"deletePermission": true,
"downloadPermission": true,
"editPermission": true,
"listChildNodePermission": true,
"removeChildNodePermission": true,
"renameFilePermission": true,
"shareFilePermission": true,
"uploadPermission": true,
"viewPermission": true
},
"creatingUser": "ZWU*********M0NA",
"filePath": "Individual space",
"invalid": 0,
"spaceType": "1"
},
],
"autoDeleted": 0,
"code": 0,
"msg": "success"
} Status Codes
Status Code | Description |
|---|---|
200 | OK |
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
