Lists files.
GET
https://drive.cloud.hicloud.com/drive/v1/files
| Parameter Name | Type | Description | |
| queryParam | string | query | A query for filtering the file results by property.For details, please refer to the Note. |
| orderBy | string | query | A list of sort keys separated by commas. Valid keys: createdTime, folder, editedTime, fileName, and size. Each key sorts in ascending order by default, but can be reversed with the desc modifier. Example: orderBy=folder,editedTime desc,fileName. Note: For users with one million files or more, orderBy will be ignored. |
| pageSize | integer | query | Maximum number of results to return per page. The default value is 100. The value ranges from 1 to 100. Note: It is possible that partial or empty result pages are returned before the end of the result list has been reached. |
| cursor | string | query | Cursor for the current page.It should be set to the value of nextCursor from the previous response. |
| containers[] | string | query | Query scope. Its value can be drive, applicationData, or a combination of the two (separated by a comma). The default value is drive. |
| fields | string | query | Fields in the request, which are in the partial response format. |
| form | string | query | Media format. |
| prettyPrint | boolean | query | Indicates whether to return a response in a human-readable format. |
| quotaId | string | query | User identifier, consisting of 40 characters at maximum. It is used to restrict the number of API calls of an individual user. |
| callback | string | query | Callback function used in JSONP requests. |
| x-hw-trace-id | string | header | ID used for service tracing. |
| x-hw-app-id | string | header | App ID. |
| version | string | header | SDK version number. |
| x-hw-terminal | string | header | Device model. |
| x-hw-os | string | header | Device operating system. |
| unionID | string | header | Open user ID. |
| User-Agent | string | header | App version number or ID. |
Leave the request body empty.
| Parameter Name | Type | Description |
If successful, this method returns a response body with the following structure:
- {
- "category":"drive#fileList",
- "cursor":"string",
- "searchCompleted":true,
- "files":{
- "category": "drive#file",
- "id": "string",
- "fileName": "string",
- "mimeType": "string",
- "description": "string",
- "favorite": true,
- "recycled": true,
- "directlyRecycled": true,
- "recyclingUser": {
- "category": "drive#user",
- "displayName": "string",
- "profilePhotoLink": "string",
- "me": true,
- "permissionId": "string",
- "userAccount": "string"
- },
- "recycledTime": "2019-12-10T13:06:04.519Z",
- "parentFolder": ["string"],
- "properties": {
- "additionalProp1": "string",
- "additionalProp2": "string",
- "additionalProp3": "string"
- },
- "appSettings": {
- "additionalProp1": "string",
- "additionalProp2": "string",
- "additionalProp3": "string"
- },
- "containers": ["drive"],
- "version": 0,
- "contentDownloadLink": "string",
- "iconDownloadLink": "string",
- "existThumbnail": true,
- "thumbnailDownloadLink": "string",
- "smallThumbnailDownloadLink": "string",
- "thumbnailVersion": 0,
- "onLineViewLink": "string",
- "createdTime": "2019-12-10T13:06:04.519Z",
- "editedTime": "2019-12-10T13:06:04.519Z",
- "editedByMeTime": "2019-12-10T13:06:04.519Z",
- "editedByMe": true,
- "sharedWithMeTime": "2019-12-10T13:06:04.519Z",
- "sharer": {
- "category": "drive#user",
- "displayName": "string",
- "profilePhotoLink": "string",
- "me": true,
- "permissionId": "string",
- "userAccount": "string"
- },
- "owners": [
- {
- "category": "drive#user",
- "displayName": "string",
- "profilePhotoLink": "string",
- "me": true,
- "permissionId": "string",
- "userAccount": "string"
- }
- ],
- "lastEditor": {
- "category": "drive#user",
- "displayName": "string",
- "profilePhotoLink": "string",
- "me": true,
- "permissionId": "string",
- "userAccount": "string"
- },
- "hasShared": false,
- "ownedByMe": true,
- "capabilities": {
- "addChildNodePermission": true,
- "writerHasChangeCopyPermission": false,
- "commentPermission": true,
- "copyPermission": true,
- "deletePermission": true,
- "deleteChildNodePermission": true,
- "downloadPermission": true,
- "editPermission": true,
- "listChildNodePermission": true,
- "editContentPermission": true,
- "readHistoryVersionPermission": true,
- "removeChildNodePermission": true,
- "renameFilePermission": true,
- "shareFilePermission": false,
- "recyclePermission": true,
- "recycleChildNodePermission": true,
- "unrecyclePermission": true
- },
- "viewersHasCopyContentPermission": false,
- "writerHasCopyPermission": false,
- "writersHasSharePermission": false,
- "permissions": [
- {
- "category": "drive#permission",
- "id": "string",
- "type": "user",
- "role": "owner",
- "userAccount": "string",
- "displayName": "string",
- "expirationTime": "2020-02-24T00:50:54.483Z",
- "deleted": true,
- "canDiscoverFile": true
- }
- ],
- "permissionIds": ["string"],
- "originalFilename": "string",
- "fullFileSuffix": "string",
- "fileSuffix": "string",
- "size": 0,
- "occupiedSpace": 0,
- "pictureMetadata": {
- "width": 0,
- "height": 0,
- "rotation": 0,
- "location": {
- "latitude": 0,
- "longitude": 0,
- "altitude": 0
- },
- "exifTime": "string",
- "cameraMaker": "string",
- "cameraModel": "string",
- "exposureTime": 0,
- "aperture": 0,
- "flashUsed": true,
- "focalLength": 0,
- "isoSpeed": 0,
- "meteringMode": "string",
- "sensor": "string",
- "exposureMode": "string",
- "colorSpace": "string",
- "whiteBalance": "string",
- "exposureBias": 0,
- "maxApertureValue": 0,
- "subjectDistance": 0,
- "lens": "string"
- },
- "videoMetadata": {
- "width": 0,
- "height": 0,
- "durationTime": 0
- },
- "sha256": "string",
- "lastHistoryVersionId": "string",
- "contentVersion": "string"
- }
- }
| id | string | ID of the file. |
| category | string | Resource type. The value is always drive#fileList. |
| cursor | string | The page token for the next page of files. It will be absent if the end of the file list has been reached. |
| serachCompleted | boolean | Indicates whether the search process is complete. |
| files[] | list | The list of files. |
| files.category | string | Resource type. The value is always drive#file. |
| files.id | string | ID of the file. |
| files.fileName | string | Name of the file. |
| files.mimeType | string | MIME type of the file. |
| files.description | string | Short description of the file. |
| files.favorite | boolean | Indicates whether the file has been favorited. |
| files.recycled | boolean | Indicates whether the file has been moved to the recycle bin. |
| files.directlyRecycled | boolean | Indicates whether the file has been explicitly trashed. |
| files.recyclingUser.category | string | User type. The value is always drive#user. |
| files.recyclingUser.displayName | string | Display name for this user. |
| files.recyclingUser.profilePhotoLink | string | Link to the user's profile picture, which is not returned by default. |
| files.recyclingUser.me | boolean | Indicates whether this user is the requesting user. |
| files.recyclingUser.permissionId | string | Permission ID. |
| files.recyclingUser.userAccount | string | Account of the user, which is not returned by default. |
| files.recycledTime | string | Time when the item was moved to the recycle bin. |
| files.parentFolder[] | string | Parent folder. |
| files.properties[] | string | Custom file properties that are universally visible. |
| files.appSettings[] | string | Custom properties of the requesting app. |
| files.containers[] | string | Spaces that contain the file. Values: drive and applicationData |
| files.version | integer | Version number of the file. |
| files.contentDownloadLink | string | Link for downloading the file in a browser. |
| files.iconDownloadLink | string | Link to the file's icon. |
| files.existThumbnail | boolean | Indicates whether the file has a thumbnail. |
| files.thumbnailDownloadLink | string | Link to the file's large thumbnail. |
| files.smallThumbnailDownloadLink | string | Link to the file's small thumbnail. |
| files.thumbnailVersion | integer | Version number for the thumbnail. |
| files.onLineViewLink | string | Link to view the file online. |
| files.createdTime | string | Time when the file was created. |
| files.editedTime | string | Last time the file was modified. |
| files.editedByMeTime | string | Last time the file was modified by the user. |
| files.editedByMe | boolean | Indicates whether the file was modified by the user. |
| files.sharedWithMeTime | string | Time at which the file was shared with the user. |
| files.sharer.category | string | User type. The value is always drive#user. |
| files.sharer.displayName | string | Display name for this user. |
| files.sharer.profilePhotoLink | string | Link to the user's profile picture, which is not returned by default. |
| files.sharer.me | boolean | Indicates whether this user is the requesting user. |
| files.sharer.permissionId | string | Permission ID. |
| files.sharer.userAccount | string | Account of the user, which is not returned by default. |
| files.owners.category | string | User type. The value is always drive#user. |
| files.owners.displayName | string | Display name for this user. |
| files.owners.profilePhotoLink | string | Link to the user's profile picture, which is not returned by default. |
| files.owners.me | boolean | Indicates whether this user is the requesting user. |
| files.owners.permissionId | string | Permission ID. |
| files.owners.userAccount | string | Account of the user, which is not returned by default. |
| files.lastEditor.category | string | User type. The value is always drive#user. |
| files.lastEditor.displayName | string | Display name for this user. |
| files.lastEditor.profilePhotoLink | string | Link to the user's profile picture, which is not returned by default. |
| files.lastEditor.me | boolean | Indicates whether this user is the requesting user. |
| files.lastEditor.permissionId | string | Permission ID. |
| files.lastEditor.userAccount | string | Account of the user, which is not returned by default. |
| files.hasShared | boolean | Indicates whether the file has been shared. |
| files.ownedByMe | boolean | Indicates whether the user owns the file. |
| files.capabilities.addChildNodePermission | boolean | Indicates whether the current user has permission to create subfolders to a particular folder. |
| files.capabilities.writerHasChangeCopyPermission | boolean | Indicates whether the current user (assuming the writer role) has permission to change the content of this file. |
| files.capabilities.commentPermission | boolean | Indicates whether the current user has permission to comment on this file. |
| files.capabilities.copyPermission | boolean | Indicates whether the current user has permission to copy this file. |
| files.capabilities.deletePermission | boolean | Indicates whether the current user has permission to delete this file. |
| files.capabilities.deleteChildNodePermission | boolean | Indicates whether the current user has permission to delete subfolders from this folder. |
| files.capabilities.downloadPermission | boolean | Indicates whether the current user has permission to download this file. |
| files.capabilities.editPermission | boolean | Indicates whether the current has permission to edit this file. |
| files.capabilities.listChildNodePermission | boolean | Indicates whether the current user has permission to list subfolders in this folder. |
| files.capabilities.editContentPermission | boolean | Indicates whether the current user has permission to modify the content of this file. |
| files.capabilities.readHistoryVersionPermission | boolean | Indicates whether the current user has permission to read revisions of this file. |
| files.capabilities.removeChildNodePermission | boolean | Indicates whether the current user has permission to remove subfolders from this folder. |
| files.capabilities.renameFilePermission | boolean | Indicates whether the current user has permission to rename this file. |
| files.capabilities.shareFilePermission | boolean | Indicates whether the current user has permission to share this file. |
| files.capabilities.recyclePermission | boolean | Indicates whether the current user has permission to move this file to the recycle bin. |
| files.capabilities.recycleChildNodePermission | boolean | Indicates whether the current user has permission to move the subfolders in this folder to the recycle bin. |
| files.capabilities.unrecyclePermission | boolean | Indicates whether the current user has permission to restore this file from the recycle bin. |
| files.viewersHasCopyContentPermission | boolean | Indicates whether the current user has permission to copy the content of this file. |
| files.writerHasCopyPermission | boolean | Indicates whether the current user (assuming the writer role) has permission to copy this file. |
| files.writersHasSharePermission | boolean | Indicates whether the current user (assuming the writer role) has permission to share this file. |
| files.permissions[] | string | List of permissions for the file. |
| files.permissions.category | string | Permission type. The value is always drive#permission. |
| files.permissions.id | string | Permission ID. |
| files.permissions.type | string | Grantee type. Values: user and anyone. |
| files.permissions.role | string | Role granted by the permission. Values: owner, writer, commenter, and reader. |
| files.permissions.userAccount | string | User account. |
| files.permissions.displayName | string | Display name for the permission. |
| files.permissions.expirationTime | string | Time when the permission will expire. |
| files.permissions.deleted | boolean | Indicates whether the permission is deleted. |
| files.permissions.canDiscoverFile | boolean | Indicates whether the permission allows the file to be searched. It is applicable only to permissions of the anyone type. |
| files.originalFilename | string | Original name of the file. |
| files.fullFileSuffix | string | Full file extension extracted from the name field. It is the substring that comes immediately after the dot character in the filename. |
| files.fileSuffix | string | Final component offullFileSuffix. |
| files.size | integer | Size of file content. |
| files.occupiedSpace | integer | Actual storage used by the file. |
| files.pictureMetadata.width | integer | Image width. |
| files.pictureMetadata.height | integer | Image height. |
| files.pictureMetadata.rotation | integer | Image rotation angle. |
| files.pictureMetadata.location.latitude | number | Latitude stored in the image. |
| files.pictureMetadata.location.longitude | number | Longitude stored in the image. |
| files.pictureMetadata.location.altitude | number | Altitude stored in the image. |
| files.pictureMetadata.exifTime | string | Date and time the image was created (EXIF DateTime). |
| files.pictureMetadata.cameraMaker | string | Maker of the camera that was used to create the image. |
| files.pictureMetadata.cameraModel | string | Model of the camera that was used to create the image. |
| files.pictureMetadata.exposureTime | number | Length of the exposure, in seconds. |
| files.pictureMetadata.aperture | number | Aperture (f-number) used when creating the image. |
| files.pictureMetadata.flashUsed | boolean | Indicates whether a flash was used to create the image. |
| files.pictureMetadata.focalLength | number | Focal length used when creating the image, in millimeters. |
| files.pictureMetadata.isoSpeed | integer | ISO speed used when creating the image. |
| files.pictureMetadata.meteringMode | string | Metering mode used when creating the image. |
| files.pictureMetadata.sensor | string | Type of sensor used when creating the image. |
| files.pictureMetadata.exposureMode | string | Exposure mode used when creating the image. |
| files.pictureMetadata.colorSpace | string | Color space of the image. |
| files.pictureMetadata.whiteBalance | string | White balance mode used when creating the image. |
| files.pictureMetadata.exposureBias | number | Exposure bias of the image (APEX value). |
| files.pictureMetadata.maxApertureValue | number | Maximum aperture used when creating the image (APEX value). |
| files.pictureMetadata.subjectDistance | integer | Distance to the subject of the image, in meters. |
| files.pictureMetadata.lens | string | Lens used for creating the image. |
| files.videoMetadata.width | integer | Width of the video. |
| files.videoMetadata.height | integer | Height of the video. |
| files.videoMetadata.durationTime | integer | Duration of the video in milliseconds. |
| files.sha256 | string | SHA-256 value for the file. |
| files.lastHistoryVersionId | string | ID of the latest version. |
| files.contentVersion | string | Content version number. |
| queryParam | File query statement, which can be used to query the specified file or folder based on the set filter criteria. A filter criterion is in the format Attribute name Operator Attribute value. If multiple filter criteria need to be specified, use and to connect them. If no query statement is set, all files and folders on the drive are returned by default. The following table lists the attributes currently supported by a query statement. To query files or folders in a parent folder, the filter criterion is always fileId in parents, in which fileId indicates the ID of a parent folder. |
Attributes supported by a query statement specified by queryParam
| mimeType | string | =,!=,contains | application/vnd.huawei-apps.folder | Type of objects to be queried. mimeType='application/vnd.huawei-apps.folder' indicates that folders are to be queried and mimeType!=application/vnd.huawei-apps.folder indicates that files are to be queried. If mimeType is not set, both files and folders are queried by default. |
| parentFolder | array | in | fileId (ID of the parent folder to be queried) | Parent folder whose files or folders are to be queried. The fixed format is as follows: 'fileId' in parentFolder. Currently, only one ID is allowed in the value of fileId. If multiple IDs are specified, only the first is valid. The ID specified by fileId must be enclosed by single quotation marks in a query statement. If no parent folder is specified, files or folders in the root folder are queried by default. Note: For the root directory of Drive, the 'root' in parentFolder format can be used; for the root directory of application data, the 'applicationData' in parentFolder format can be used. |
| recycled | boolean | = | true/false | Indicates whether to query only recycled files or folders. Currently, the value of recycled must be true. |
| fileName | string | =,!=,contains | fileName | Name of the files or folders to be queried. The contains operator indicates that files and folders whose names start with the value specified by fileName are to be queried. The specified file name must be enclosed by single quotation marks in a query statement. |
| editedTime | dateTime | <=,<,=,!=,>,>= | editedTime (last modification time of a file or folder) | Last modification time range of the files and folders to be queried. By default, the value is UTC time in RFC 3339 format, for example, 2012-06-04T12:00:00-08:00. The specified time range must be enclosed by single quotation marks in a query statement. |
| favorite | boolean | =,!= | true/false | Indicates whether a file is favorited. |