Listing Files in a Group or Department Space
Function
List files in a group or department space.
URI
POST /koodrive/ose/v1/files/{groupId}/{type}
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
groupId |
Yes |
String |
Team ID. |
type |
Yes |
String |
Type.
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
team_type |
No |
Integer |
(Optional) Team type. If this parameter is not carried, the default value 0 is used. 0: department. 2: group. |
Request 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-Traceid |
No |
String |
Message log trace ID. The value contains 58 bits. |
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 |
---|---|---|---|
pageInfo |
No |
PageInfo object |
Pagination information. |
sortInfo |
No |
FileSortInfo object |
Classification information. |
containerId |
Yes |
String |
Space ID. |
parentFileId |
Yes |
String |
Parent directory of the file.
|
fileType |
No |
String |
File type.
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
pageSize |
No |
Integer |
Number of files on each page. Default value: 100. |
pageCursor |
No |
String |
Pagination start cursor. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
sortType |
No |
Integer |
Sorting field.
|
sortDirection |
No |
Integer |
Sorting order.
|
Response Parameters
Status code: 200
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. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
File ID. |
fileName |
String |
File name, which contains up to 80 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,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. |
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 |
Integer |
File size. |
attachments |
Array of FileListAttachment objects |
Attachment. |
downloadLinks |
Array of DownLoadLink objects |
Link for downloading FileProxy files. |
userProperties |
FileListPrivateProperties object |
User attributes. |
Parameter |
Type |
Description |
---|---|---|
category |
String |
Type. The value is drive#user. Enumeration values:
|
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 |
---|---|---|
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. |
Parameter |
Type |
Description |
---|---|---|
resource |
FileListResource object |
Resource. |
mimeType |
String |
MIME type |
Parameter |
Type |
Description |
---|---|---|
object |
FileListSliceObject object |
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 |
EndpointURLMetadata object |
Download URL. |
image |
Array of Images objects |
Thumbnail information. |
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 attributes (The size of a single attribute is not limited, but the total size cannot exceed 16 KB.) |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error |
Error object |
Error message. |
Example Requests
Lists files in the root directory of team space IAAB_BRGQ-MajA2WAf81df00a3443452aa3dd54e35245bc.
POST /koodrive/ose/v1/files/1269529595850261633/0 Authorization:Bearer+10f88*********4791e9ff { "pageInfo": { "pageSize": "10", "pageCursor": "" }, "sortInfo": { "sortType": "", "sortDirection": "" }, "containerId": "IAAB_BRGQ-MajA2WAf81df00a3443452aa3dd54e35245bc", "parentFileId": "root", "fileType": "", "fileName": "" }
Example Responses
Status code: 200
Returns the queried 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 queried file list. |
400 |
Bad request |
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