目录

Lists files.

Request

HTTP Request

GET
https://drive.cloud.hicloud.com/drive/v1/files

Parameters

Parameter NameType
Description
queryParamstringqueryA query for filtering the file results by property.For details, please refer to the Note.
orderBystringqueryA 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.
pageSizeintegerqueryMaximum 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.
cursorstringqueryCursor for the current page.It should be set to the value of nextCursor from the previous response.
containers[]stringqueryQuery scope. Its value can be drive, applicationData, or a combination of the two (separated by a comma). The default value is drive.
fieldsstringqueryFields in the request, which are in the partial response format.
formstringqueryMedia format.
prettyPrintbooleanqueryIndicates whether to return a response in a human-readable format.
quotaIdstringqueryUser identifier, consisting of 40 characters at maximum. It is used to restrict the number of API calls of an individual user.
callbackstringqueryCallback function used in JSONP requests.
x-hw-trace-idstringheaderID used for service tracing. 
x-hw-app-idstringheaderApp ID. 
versionstringheaderSDK version number.
x-hw-terminalstringheaderDevice model.
x-hw-osstringheaderDevice operating system. 
unionIDstringheaderOpen user ID. 
User-AgentstringheaderApp version number or ID. 

Request Body

Leave the request body empty.

Parameter NameTypeDescription

Response

If successful, this method returns a response body with the following structure:

  1. {
  2.    "category":"drive#fileList",
  3.    "cursor":"string",
  4.    "searchCompleted":true,
  5.    "files":{
  6.        "category": "drive#file",
  7.        "id": "string",
  8.        "fileName": "string",
  9.        "mimeType": "string",
  10.        "description": "string",
  11.        "favorite": true,
  12.        "recycled": true,
  13.        "directlyRecycled": true,
  14.        "recyclingUser": {
  15.            "category": "drive#user",
  16.            "displayName": "string",
  17.            "profilePhotoLink": "string",
  18.            "me": true,
  19.            "permissionId": "string",
  20.            "userAccount": "string"
  21.        },
  22.        "recycledTime": "2019-12-10T13:06:04.519Z",
  23.        "parentFolder": ["string"],
  24.        "properties": {
  25.            "additionalProp1": "string",
  26.            "additionalProp2": "string",
  27.            "additionalProp3": "string"
  28.        },
  29.        "appSettings": {
  30.            "additionalProp1": "string",
  31.            "additionalProp2": "string",
  32.            "additionalProp3": "string"
  33.        },
  34.        "containers": ["drive"],
  35.        "version": 0,
  36.        "contentDownloadLink": "string",
  37.        "iconDownloadLink": "string",
  38.        "existThumbnail": true,
  39.        "thumbnailDownloadLink": "string",
  40.        "smallThumbnailDownloadLink": "string",
  41.        "thumbnailVersion": 0,
  42.        "onLineViewLink": "string",
  43.        "createdTime": "2019-12-10T13:06:04.519Z",
  44.        "editedTime": "2019-12-10T13:06:04.519Z",
  45.        "editedByMeTime": "2019-12-10T13:06:04.519Z",
  46.        "editedByMe": true,
  47.        "sharedWithMeTime": "2019-12-10T13:06:04.519Z",
  48.        "sharer": {
  49.            "category": "drive#user",
  50.            "displayName": "string",
  51.            "profilePhotoLink": "string",
  52.            "me": true,
  53.            "permissionId": "string",
  54.            "userAccount": "string"
  55.        },
  56.        "owners": [
  57.        {
  58.            "category": "drive#user",
  59.            "displayName": "string",
  60.            "profilePhotoLink": "string",
  61.            "me": true,
  62.            "permissionId": "string",
  63.            "userAccount": "string"
  64.        }
  65.        ],
  66.        "lastEditor": {
  67.            "category": "drive#user",
  68.            "displayName": "string",
  69.            "profilePhotoLink": "string",
  70.            "me": true,
  71.            "permissionId": "string",
  72.            "userAccount": "string"
  73.        },
  74.        "hasShared": false,
  75.        "ownedByMe": true,
  76.        "capabilities": {
  77.            "addChildNodePermission": true,
  78.            "writerHasChangeCopyPermission": false,
  79.            "commentPermission": true,
  80.            "copyPermission": true,
  81.            "deletePermission": true,
  82.            "deleteChildNodePermission": true,
  83.            "downloadPermission": true,
  84.            "editPermission": true,
  85.            "listChildNodePermission": true,
  86.            "editContentPermission": true,
  87.            "readHistoryVersionPermission": true,
  88.            "removeChildNodePermission": true,
  89.            "renameFilePermission": true,
  90.            "shareFilePermission": false,
  91.            "recyclePermission": true,
  92.            "recycleChildNodePermission": true,
  93.            "unrecyclePermission": true
  94.        },
  95.        "viewersHasCopyContentPermission": false,
  96.        "writerHasCopyPermission": false,
  97.        "writersHasSharePermission": false,
  98.        "permissions": [
  99.        {
  100.            "category": "drive#permission",
  101.            "id": "string",
  102.            "type": "user",
  103.            "role": "owner",
  104.            "userAccount": "string",
  105.            "displayName": "string",
  106.            "expirationTime": "2020-02-24T00:50:54.483Z",
  107.            "deleted": true,
  108.            "canDiscoverFile": true
  109.        }
  110.        ],
  111.        "permissionIds": ["string"],
  112.        "originalFilename": "string",
  113.        "fullFileSuffix": "string",
  114.        "fileSuffix": "string",
  115.        "size": 0,
  116.        "occupiedSpace": 0,
  117.        "pictureMetadata": {
  118.            "width": 0,
  119.            "height": 0,
  120.            "rotation": 0,
  121.            "location": {
  122.                "latitude": 0,
  123.                "longitude": 0,
  124.                "altitude": 0
  125.            },
  126.            "exifTime": "string",
  127.            "cameraMaker": "string",
  128.            "cameraModel": "string",
  129.            "exposureTime": 0,
  130.            "aperture": 0,
  131.            "flashUsed": true,
  132.            "focalLength": 0,
  133.            "isoSpeed": 0,
  134.            "meteringMode": "string",
  135.            "sensor": "string",
  136.            "exposureMode": "string",
  137.            "colorSpace": "string",
  138.            "whiteBalance": "string",
  139.            "exposureBias": 0,
  140.            "maxApertureValue": 0,
  141.            "subjectDistance": 0,
  142.            "lens": "string"
  143.        },
  144.        "videoMetadata": {
  145.            "width": 0,
  146.            "height": 0,
  147.            "durationTime": 0
  148.        },
  149.        "sha256": "string",
  150.        "lastHistoryVersionId": "string",
  151.        "contentVersion": "string"
  152.    }
  153. }
idstringID of the file.
categorystringResource type. The value is always drive#fileList.
cursor
stringThe page token for the next page of files. It will be absent if the end of the file list has been reached.
serachCompletedbooleanIndicates whether the search process is complete.
files[]listThe list of files.
files.categorystringResource type. The value is always drive#file.
files.idstringID of the file.
files.fileNamestringName of the file.
files.mimeTypestringMIME type of the file.
files.descriptionstringShort description of the file.
files.favoritebooleanIndicates whether the file has been favorited.
files.recycledbooleanIndicates whether the file has been moved to the recycle bin.
files.directlyRecycledbooleanIndicates whether the file has been explicitly trashed.
files.recyclingUser.categorystringUser type. The value is always drive#user.
files.recyclingUser.displayNamestringDisplay name for this user.
files.recyclingUser.profilePhotoLinkstringLink to the user's profile picture, which is not returned by default.
files.recyclingUser.mebooleanIndicates whether this user is the requesting user.
files.recyclingUser.permissionIdstringPermission ID.
files.recyclingUser.userAccountstringAccount of the user, which is not returned by default.
files.recycledTimestringTime when the item was moved to the recycle bin.
files.parentFolder[]stringParent folder.
files.properties[]stringCustom file properties that are universally visible.
files.appSettings[]stringCustom properties of the requesting app.
files.containers[]stringSpaces that contain the file. Values: drive and applicationData
files.versionintegerVersion number of the file.
files.contentDownloadLinkstringLink for downloading the file in a browser.
files.iconDownloadLinkstringLink to the file's icon.
files.existThumbnailbooleanIndicates whether the file has a thumbnail.
files.thumbnailDownloadLinkstringLink to the file's large thumbnail.
files.smallThumbnailDownloadLinkstringLink to the file's small thumbnail.
files.thumbnailVersionintegerVersion number for the thumbnail.
files.onLineViewLinkstringLink to view the file online.
files.createdTimestringTime when the file was created.
files.editedTimestringLast time the file was modified.
files.editedByMeTimestringLast time the file was modified by the user.
files.editedByMebooleanIndicates whether the file was modified by the user.
files.sharedWithMeTimestringTime at which the file was shared with the user.
files.sharer.categorystringUser type. The value is always drive#user.
files.sharer.displayNamestringDisplay name for this user.
files.sharer.profilePhotoLinkstringLink to the user's profile picture, which is not returned by default.
files.sharer.mebooleanIndicates whether this user is the requesting user.
files.sharer.permissionIdstringPermission ID.
files.sharer.userAccountstringAccount of the user, which is not returned by default.
files.owners.categorystringUser type. The value is always drive#user.
files.owners.displayNamestringDisplay name for this user.
files.owners.profilePhotoLinkstringLink to the user's profile picture, which is not returned by default.
files.owners.mebooleanIndicates whether this user is the requesting user.
files.owners.permissionIdstringPermission ID.
files.owners.userAccountstringAccount of the user, which is not returned by default.
files.lastEditor.categorystringUser type. The value is always drive#user.
files.lastEditor.displayNamestringDisplay name for this user.
files.lastEditor.profilePhotoLinkstringLink to the user's profile picture, which is not returned by default.
files.lastEditor.mebooleanIndicates whether this user is the requesting user.
files.lastEditor.permissionIdstringPermission ID.
files.lastEditor.userAccountstringAccount of the user, which is not returned by default.
files.hasSharedbooleanIndicates whether the file has been shared.
files.ownedByMebooleanIndicates whether the user owns the file.
files.capabilities.addChildNodePermissionbooleanIndicates whether the current user has permission to create subfolders to a particular folder.
files.capabilities.writerHasChangeCopyPermissionbooleanIndicates whether the current user (assuming the writer role) has permission to change the content of this file.
files.capabilities.commentPermissionbooleanIndicates whether the current user has permission to comment on this file.
files.capabilities.copyPermissionbooleanIndicates whether the current user has permission to copy this file.
files.capabilities.deletePermissionbooleanIndicates whether the current user has permission to delete this file.
files.capabilities.deleteChildNodePermissionbooleanIndicates whether the current user has permission to delete subfolders from this folder.
files.capabilities.downloadPermissionbooleanIndicates whether the current user has permission to download this file.
files.capabilities.editPermissionbooleanIndicates whether the current has permission to edit this file.
files.capabilities.listChildNodePermissionbooleanIndicates whether the current user has permission to list subfolders in this folder.
files.capabilities.editContentPermissionbooleanIndicates whether the current user has permission to modify the content of this file.
files.capabilities.readHistoryVersionPermissionbooleanIndicates whether the current user has permission to read revisions of this file.
files.capabilities.removeChildNodePermissionbooleanIndicates whether the current user has permission to remove subfolders from this folder.
files.capabilities.renameFilePermissionbooleanIndicates whether the current user has permission to rename this file.
files.capabilities.shareFilePermissionbooleanIndicates whether the current user has permission to share this file.
files.capabilities.recyclePermissionbooleanIndicates whether the current user has permission to move this file to the recycle bin.
files.capabilities.recycleChildNodePermissionbooleanIndicates whether the current user has permission to move the subfolders in this folder to the recycle bin.
files.capabilities.unrecyclePermissionbooleanIndicates whether the current user has permission to restore this file from the recycle bin.
files.viewersHasCopyContentPermissionbooleanIndicates whether the current user has permission to copy the content of this file.
files.writerHasCopyPermissionbooleanIndicates whether the current user (assuming the writer role) has permission to copy this file.
files.writersHasSharePermissionbooleanIndicates whether the current user (assuming the writer role) has permission to share this file.
files.permissions[]
stringList of permissions for the file.
files.permissions.categorystringPermission type. The value is always drive#permission.
files.permissions.idstringPermission ID.
files.permissions.typestringGrantee type. Values: user and anyone.
files.permissions.rolestringRole granted by the permission. Values: owner, writer, commenter, and reader.
files.permissions.userAccountstringUser account.
files.permissions.displayNamestringDisplay name for the permission.
files.permissions.expirationTimestringTime when the permission will expire.
files.permissions.deletedbooleanIndicates whether the permission is deleted.
files.permissions.canDiscoverFilebooleanIndicates whether the permission allows the file to be searched. It is applicable only to permissions of the anyone type.
files.originalFilenamestringOriginal name of the file.
files.fullFileSuffixstringFull file extension extracted from the name field. It is the substring that comes immediately after the dot character in the filename.
files.fileSuffixstringFinal component offullFileSuffix.
files.sizeintegerSize of file content.
files.occupiedSpaceintegerActual storage used by the file.
files.pictureMetadata.widthintegerImage width.
files.pictureMetadata.heightintegerImage height.
files.pictureMetadata.rotationintegerImage rotation angle.
files.pictureMetadata.location.latitudenumberLatitude stored in the image.
files.pictureMetadata.location.longitudenumberLongitude stored in the image.
files.pictureMetadata.location.altitudenumberAltitude stored in the image.
files.pictureMetadata.exifTimestringDate and time the image was created (EXIF DateTime).
files.pictureMetadata.cameraMakerstringMaker of the camera that was used to create the image.
files.pictureMetadata.cameraModelstringModel of the camera that was used to create the image.
files.pictureMetadata.exposureTimenumberLength of the exposure, in seconds.
files.pictureMetadata.aperturenumberAperture (f-number) used when creating the image.
files.pictureMetadata.flashUsedbooleanIndicates whether a flash was used to create the image.
files.pictureMetadata.focalLengthnumberFocal length used when creating the image, in millimeters.
files.pictureMetadata.isoSpeedintegerISO speed used when creating the image.
files.pictureMetadata.meteringModestringMetering mode used when creating the image.
files.pictureMetadata.sensorstringType of sensor used when creating the image.
files.pictureMetadata.exposureModestringExposure mode used when creating the image.
files.pictureMetadata.colorSpacestringColor space of the image.
files.pictureMetadata.whiteBalancestringWhite balance mode used when creating the image.
files.pictureMetadata.exposureBiasnumberExposure bias of the image (APEX value).
files.pictureMetadata.maxApertureValuenumberMaximum aperture used when creating the image (APEX value).
files.pictureMetadata.subjectDistanceintegerDistance to the subject of the image, in meters.
files.pictureMetadata.lensstringLens used for creating the image.
files.videoMetadata.widthintegerWidth of the video.
files.videoMetadata.heightintegerHeight of the video.
files.videoMetadata.durationTimeintegerDuration of the video in milliseconds.
files.sha256stringSHA-256 value for the file.
files.lastHistoryVersionIdstringID of the latest version.
files.contentVersionstringContent version number.


Note

queryParamFile 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

mimeTypestring=,!=,containsapplication/vnd.huawei-apps.folderType 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.
parentFolderarrayinfileId (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.

recycledboolean=true/falseIndicates whether to query only recycled files or folders. Currently, the value of recycled must be true.
fileNamestring=,!=,containsfileNameName 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.
editedTimedateTime<=,<,=,!=,>,>=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.
favoriteboolean=,!=true/falseIndicates whether a file is favorited.