List

Lists or searches files

13 variables
159 variables

Lists or searches files

Authorization

To use this building block you will have to grant access to at least one of the following scopes:

  • See, edit, create, and delete all of your Google Drive files
  • View and manage its own configuration data in your Google Drive
  • View and manage Google Drive files and folders that you have opened or created with this app
  • View and manage metadata of files in your Google Drive
  • View metadata for files in your Google Drive
  • View the photos, videos and albums in your Google Photos
  • See and download all your Google Drive files

Input

This building block consumes 13 input parameters

  = Parameter name
  = Format

corpora STRING

Bodies of items (files/documents) to which the query applies. Supported bodies are 'user', 'domain', 'drive' and 'allDrives'. Prefer 'user' or 'drive' to 'allDrives' for efficiency

corpus ENUMERATION

The source of files to list. Deprecated: use 'corpora' instead

driveId STRING

ID of the shared drive to search

includeItemsFromAllDrives BOOLEAN

Deprecated - Whether both My Drive and shared drive items should be included in results. This parameter will only be effective until June 1, 2020. Afterwards shared drive items will be included in the results

includeTeamDriveItems BOOLEAN

Deprecated use includeItemsFromAllDrives instead

orderBy STRING

A comma-separated list of sort keys. Valid keys are 'createdTime', 'folder', 'modifiedByMeTime', 'modifiedTime', 'name', 'name_natural', 'quotaBytesUsed', 'recency', 'sharedWithMeTime', 'starred', and 'viewedByMeTime'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedTime desc,name. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored

pageSize INTEGER

The maximum number of files to return per page. Partial or empty result pages are possible even before the end of the files list has been reached

pageToken STRING

The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response

q STRING

A query for filtering the file results. See the "Search for Files" guide for supported syntax

spaces STRING

A comma-separated list of spaces to query within the corpus. Supported values are 'drive', 'appDataFolder' and 'photos'

supportsAllDrives BOOLEAN

Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives

supportsTeamDrives BOOLEAN

Deprecated use supportsAllDrives instead

teamDriveId STRING

Deprecated use driveId instead

Output

This building block provides 159 output parameters

  = Parameter name
  = Format

files[] OBJECT

The metadata for a file

files[].appProperties OBJECT

A collection of arbitrary key-value pairs which are private to the requesting app. Entries with null values are cleared in update and copy requests

files[].appProperties.customKey.value STRING

A collection of arbitrary key-value pairs which are private to the requesting app. Entries with null values are cleared in update and copy requests

files[].capabilities OBJECT

Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take

files[].capabilities.canAddChildren BOOLEAN

Whether the current user can add children to this folder. This is always false when the item is not a folder

files[].capabilities.canChangeCopyRequiresWriterPermission BOOLEAN

Whether the current user can change the copyRequiresWriterPermission restriction of this file

files[].capabilities.canChangeViewersCanCopyContent BOOLEAN

Deprecated

files[].capabilities.canComment BOOLEAN

Whether the current user can comment on this file

files[].capabilities.canCopy BOOLEAN

Whether the current user can copy this file. For an item in a shared drive, whether the current user can copy non-folder descendants of this item, or this item itself if it is not a folder

files[].capabilities.canDelete BOOLEAN

Whether the current user can delete this file

files[].capabilities.canDeleteChildren BOOLEAN

Whether the current user can delete children of this folder. This is false when the item is not a folder. Only populated for items in shared drives

files[].capabilities.canDownload BOOLEAN

Whether the current user can download this file

files[].capabilities.canEdit BOOLEAN

Whether the current user can edit this file

files[].capabilities.canListChildren BOOLEAN

Whether the current user can list the children of this folder. This is always false when the item is not a folder

files[].capabilities.canMoveChildrenOutOfDrive BOOLEAN

Whether the current user can move children of this folder outside of the shared drive. This is false when the item is not a folder. Only populated for items in shared drives

files[].capabilities.canMoveChildrenOutOfTeamDrive BOOLEAN

Deprecated - use canMoveChildrenOutOfDrive instead

files[].capabilities.canMoveChildrenWithinDrive BOOLEAN

Whether the current user can move children of this folder within the shared drive. This is false when the item is not a folder. Only populated for items in shared drives

files[].capabilities.canMoveChildrenWithinTeamDrive BOOLEAN

Deprecated - use canMoveChildrenWithinDrive instead

files[].capabilities.canMoveItemIntoTeamDrive BOOLEAN

Deprecated - use canMoveItemOutOfDrive instead

files[].capabilities.canMoveItemOutOfDrive BOOLEAN

Whether the current user can move this item outside of this drive by changing its parent. Note that a request to change the parent of the item may still fail depending on the new parent that is being added

files[].capabilities.canMoveItemOutOfTeamDrive BOOLEAN

Deprecated - use canMoveItemOutOfDrive instead

files[].capabilities.canMoveItemWithinDrive BOOLEAN

Whether the current user can move this item within this shared drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. Only populated for items in shared drives

files[].capabilities.canMoveItemWithinTeamDrive BOOLEAN

Deprecated - use canMoveItemWithinDrive instead

files[].capabilities.canMoveTeamDriveItem BOOLEAN

Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead

files[].capabilities.canReadDrive BOOLEAN

Whether the current user can read the shared drive to which this file belongs. Only populated for items in shared drives

files[].capabilities.canReadRevisions BOOLEAN

Whether the current user can read the revisions resource of this file. For a shared drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read

files[].capabilities.canReadTeamDrive BOOLEAN

Deprecated - use canReadDrive instead

files[].capabilities.canRemoveChildren BOOLEAN

Whether the current user can remove children from this folder. This is always false when the item is not a folder. For a folder in a shared drive, use canDeleteChildren or canTrashChildren instead

files[].capabilities.canRename BOOLEAN

Whether the current user can rename this file

files[].capabilities.canShare BOOLEAN

Whether the current user can modify the sharing settings for this file

files[].capabilities.canTrash BOOLEAN

Whether the current user can move this file to trash

files[].capabilities.canTrashChildren BOOLEAN

Whether the current user can trash children of this folder. This is false when the item is not a folder. Only populated for items in shared drives

files[].capabilities.canUntrash BOOLEAN

Whether the current user can restore this file from trash

files[].contentHints OBJECT

Additional information about the content of the file. These fields are never populated in responses

files[].contentHints.indexableText STRING

Text to be indexed for the file to improve fullText queries. This is limited to 128KB in length and may contain HTML elements

files[].contentHints.thumbnail OBJECT

A thumbnail for the file. This will only be used if Google Drive cannot generate a standard thumbnail

files[].contentHints.thumbnail.image BINARY

The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5)

files[].contentHints.thumbnail.mimeType STRING

The MIME type of the thumbnail

files[].copyRequiresWriterPermission BOOLEAN

Whether the options to copy, print, or download this file, should be disabled for readers and commenters

files[].createdTime DATE_TIME

The time at which the file was created (RFC 3339 date-time)

files[].description STRING

A short description of the file

files[].driveId STRING

ID of the shared drive the file resides in. Only populated for items in shared drives

files[].explicitlyTrashed BOOLEAN

Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder

files[].exportLinks OBJECT

Links for exporting Google Docs to specific formats

files[].exportLinks.customKey.value STRING

Links for exporting Google Docs to specific formats

files[].fileExtension STRING

The final component of fullFileExtension. This is only available for files with binary content in Google Drive

files[].folderColorRgb STRING

The color for a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource. If an unsupported color is specified, the closest color in the palette will be used instead

files[].fullFileExtension STRING

The full file extension extracted from the name field. May contain multiple concatenated extensions, such as "tar.gz". This is only available for files with binary content in Google Drive. This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension

files[].hasAugmentedPermissions BOOLEAN

Whether any users are granted file access directly on this file. This field is only populated for shared drive files

files[].hasThumbnail BOOLEAN

Whether this file has a thumbnail. This does not indicate whether the requesting app has access to the thumbnail. To check access, look for the presence of the thumbnailLink field

files[].headRevisionId STRING

The ID of the file's head revision. This is currently only available for files with binary content in Google Drive

files[].iconLink STRING

A static, unauthenticated link to the file's icon

files[].id STRING

The ID of the file

files[].imageMediaMetadata OBJECT

Additional metadata about image media, if available

files[].imageMediaMetadata.aperture FLOAT

The aperture used to create the photo (f-number)

files[].imageMediaMetadata.cameraMake STRING

The make of the camera used to create the photo

files[].imageMediaMetadata.cameraModel STRING

The model of the camera used to create the photo

files[].imageMediaMetadata.colorSpace STRING

The color space of the photo

files[].imageMediaMetadata.exposureBias FLOAT

The exposure bias of the photo (APEX value)

files[].imageMediaMetadata.exposureMode STRING

The exposure mode used to create the photo

files[].imageMediaMetadata.exposureTime FLOAT

The length of the exposure, in seconds

files[].imageMediaMetadata.flashUsed BOOLEAN

Whether a flash was used to create the photo

files[].imageMediaMetadata.focalLength FLOAT

The focal length used to create the photo, in millimeters

files[].imageMediaMetadata.height INTEGER

The height of the image in pixels

files[].imageMediaMetadata.isoSpeed INTEGER

The ISO speed used to create the photo

files[].imageMediaMetadata.lens STRING

The lens used to create the photo

files[].imageMediaMetadata.location OBJECT

Geographic location information stored in the image

files[].imageMediaMetadata.location.altitude NUMBER

The altitude stored in the image

files[].imageMediaMetadata.location.latitude NUMBER

The latitude stored in the image

files[].imageMediaMetadata.location.longitude NUMBER

The longitude stored in the image

files[].imageMediaMetadata.maxApertureValue FLOAT

The smallest f-number of the lens at the focal length used to create the photo (APEX value)

files[].imageMediaMetadata.meteringMode STRING

The metering mode used to create the photo

files[].imageMediaMetadata.rotation INTEGER

The rotation in clockwise degrees from the image's original orientation

files[].imageMediaMetadata.sensor STRING

The type of sensor used to create the photo

files[].imageMediaMetadata.subjectDistance INTEGER

The distance to the subject of the photo, in meters

files[].imageMediaMetadata.time STRING

The date and time the photo was taken (EXIF DateTime)

files[].imageMediaMetadata.whiteBalance STRING

The white balance mode used to create the photo

files[].imageMediaMetadata.width INTEGER

The width of the image in pixels

files[].isAppAuthorized BOOLEAN

Whether the file was created or opened by the requesting app

files[].kind STRING

Identifies what kind of resource this is. Value: the fixed string "drive#file"

files[].lastModifyingUser OBJECT

Information about a Drive user

files[].lastModifyingUser.displayName STRING

A plain text displayable name for this user

files[].lastModifyingUser.emailAddress STRING

The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester

files[].lastModifyingUser.kind STRING

Identifies what kind of resource this is. Value: the fixed string "drive#user"

files[].lastModifyingUser.me BOOLEAN

Whether this user is the requesting user

files[].lastModifyingUser.permissionId STRING

The user's ID as visible in Permission resources

files[].lastModifyingUser.photoLink STRING

A link to the user's profile photo, if available

files[].md5Checksum STRING

The MD5 checksum for the content of the file. This is only applicable to files with binary content in Google Drive

files[].mimeType STRING

The MIME type of the file. Google Drive will attempt to automatically detect an appropriate value from uploaded content if no value is provided. The value cannot be changed unless a new revision is uploaded. If a file is created with a Google Doc MIME type, the uploaded content will be imported if possible. The supported import formats are published in the About resource

files[].modifiedByMe BOOLEAN

Whether the file has been modified by this user

files[].modifiedByMeTime DATE_TIME

The last time the file was modified by the user (RFC 3339 date-time)

files[].modifiedTime DATE_TIME

The last time the file was modified by anyone (RFC 3339 date-time). Note that setting modifiedTime will also update modifiedByMeTime for the user

files[].name STRING

The name of the file. This is not necessarily unique within a folder. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the name is constant

files[].originalFilename STRING

The original filename of the uploaded content if available, or else the original value of the name field. This is only available for files with binary content in Google Drive

files[].ownedByMe BOOLEAN

Whether the user owns the file. Not populated for items in shared drives

files[].owners[] OBJECT

Information about a Drive user

files[].owners[].displayName STRING

A plain text displayable name for this user

files[].owners[].emailAddress STRING

The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester

files[].owners[].kind STRING

Identifies what kind of resource this is. Value: the fixed string "drive#user"

files[].owners[].me BOOLEAN

Whether this user is the requesting user

files[].owners[].permissionId STRING

The user's ID as visible in Permission resources

files[].owners[].photoLink STRING

A link to the user's profile photo, if available

files[].parents[] STRING

files[].permissionIds[] STRING

files[].permissions[] OBJECT

A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy

files[].permissions[].allowFileDiscovery BOOLEAN

Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone

files[].permissions[].deleted BOOLEAN

Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions

files[].permissions[].displayName STRING

A displayable name for users, groups or domains

files[].permissions[].domain STRING

The domain to which this permission refers

files[].permissions[].emailAddress STRING

The email address of the user or group to which this permission refers

files[].permissions[].expirationTime DATE_TIME

The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions:

  • They can only be set on user and group permissions
  • The time must be in the future
  • The time cannot be more than a year in the future

files[].permissions[].id STRING

The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId

files[].permissions[].kind STRING

Identifies what kind of resource this is. Value: the fixed string "drive#permission"

files[].permissions[].permissionDetails[] OBJECT

files[].permissions[].photoLink STRING

A link to the user's profile photo, if available

files[].permissions[].role STRING

The role granted by this permission. While new values may be supported in the future, the following are currently allowed:

  • owner
  • organizer
  • fileOrganizer
  • writer
  • commenter
  • reader

files[].permissions[].teamDrivePermissionDetails[] OBJECT

files[].permissions[].type STRING

The type of the grantee. Valid values are:

  • user
  • group
  • domain
  • anyone

files[].properties OBJECT

A collection of arbitrary key-value pairs which are visible to all apps. Entries with null values are cleared in update and copy requests

files[].properties.customKey.value STRING

A collection of arbitrary key-value pairs which are visible to all apps. Entries with null values are cleared in update and copy requests

files[].quotaBytesUsed INTEGER

The number of storage quota bytes used by the file. This includes the head revision as well as previous revisions with keepForever enabled

files[].shared BOOLEAN

Whether the file has been shared. Not populated for items in shared drives

files[].sharedWithMeTime DATE_TIME

The time at which the file was shared with the user, if applicable (RFC 3339 date-time)

files[].sharingUser OBJECT

Information about a Drive user

files[].sharingUser.displayName STRING

A plain text displayable name for this user

files[].sharingUser.emailAddress STRING

The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester

files[].sharingUser.kind STRING

Identifies what kind of resource this is. Value: the fixed string "drive#user"

files[].sharingUser.me BOOLEAN

Whether this user is the requesting user

files[].sharingUser.permissionId STRING

The user's ID as visible in Permission resources

files[].sharingUser.photoLink STRING

A link to the user's profile photo, if available

files[].size INTEGER

The size of the file's content in bytes. This is only applicable to files with binary content in Google Drive

files[].spaces[] STRING

files[].starred BOOLEAN

Whether the user has starred the file

files[].teamDriveId STRING

Deprecated - use driveId instead

files[].thumbnailLink STRING

A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content

files[].thumbnailVersion INTEGER

The thumbnail version for use in thumbnail cache invalidation

files[].trashed BOOLEAN

Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file, and other users cannot see files in the owner's trash

files[].trashedTime DATE_TIME

The time that the item was trashed (RFC 3339 date-time). Only populated for items in shared drives

files[].trashingUser OBJECT

Information about a Drive user

files[].trashingUser.displayName STRING

A plain text displayable name for this user

files[].trashingUser.emailAddress STRING

The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester

files[].trashingUser.kind STRING

Identifies what kind of resource this is. Value: the fixed string "drive#user"

files[].trashingUser.me BOOLEAN

Whether this user is the requesting user

files[].trashingUser.permissionId STRING

The user's ID as visible in Permission resources

files[].trashingUser.photoLink STRING

A link to the user's profile photo, if available

files[].version INTEGER

A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the user

files[].videoMediaMetadata OBJECT

Additional metadata about video media. This may not be available immediately upon upload

files[].videoMediaMetadata.durationMillis INTEGER

The duration of the video in milliseconds

files[].videoMediaMetadata.height INTEGER

The height of the video in pixels

files[].videoMediaMetadata.width INTEGER

The width of the video in pixels

files[].viewedByMe BOOLEAN

Whether the file has been viewed by this user

files[].viewedByMeTime DATE_TIME

The last time the file was viewed by the user (RFC 3339 date-time)

files[].viewersCanCopyContent BOOLEAN

Deprecated - use copyRequiresWriterPermission instead

files[].webContentLink STRING

A link for downloading the content of the file in a browser. This is only available for files with binary content in Google Drive

files[].webViewLink STRING

A link for opening the file in a relevant Google editor or viewer in a browser

files[].writersCanShare BOOLEAN

Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives

incompleteSearch BOOLEAN

Whether the search process was incomplete. If true, then some search results may be missing, since all documents were not searched. This may occur when searching multiple drives with the "allDrives" corpora, but all corpora could not be searched. When this happens, it is suggested that clients narrow their query by choosing a different corpus such as "user" or "drive"

kind STRING

Identifies what kind of resource this is. Value: the fixed string "drive#fileList"

nextPageToken STRING

The page token for the next page of files. This will be absent if the end of the files list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results