For a list of methods for this resource, see the end of this page.
Resource representations
The metadata for a file.
{ "kind": "drive#file", "id": string, "etag": etag, "selfLink": string, "webContentLink": string, "webViewLink": string, "alternateLink": string, "embedLink": string, "openWithLinks": { (key): string }, "defaultOpenWithLink": string, "iconLink": string, "hasThumbnail": boolean, "thumbnailLink": string, "thumbnailVersion": long, "thumbnail": { "image": bytes, "mimeType": string }, "title": string, "mimeType": string, "description": string, "labels": { "starred": boolean, "hidden": boolean, "trashed": boolean, "restricted": boolean, "viewed": boolean, "modified": boolean }, "copyRequiresWriterPermission": boolean, "createdDate": datetime, "modifiedDate": datetime, "modifiedByMeDate": datetime, "lastViewedByMeDate": datetime, "markedViewedByMeDate": datetime, "sharedWithMeDate": datetime, "version": long, "sharingUser": { "kind": "drive#user", "displayName": string, "picture": { "url": string }, "isAuthenticatedUser": boolean, "permissionId": string, "emailAddress": string }, "parents": [ parents Resource ], "downloadUrl": string, "exportLinks": { (key): string }, "indexableText": { "text": string }, "userPermission": permissions Resource, "permissions": [ permissions Resource ], "permissionIds": [ string ], "hasAugmentedPermissions": boolean, "originalFilename": string, "fileExtension": string, "fullFileExtension": string, "md5Checksum": string, "sha1Checksum": string, "sha256Checksum": string, "fileSize": long, "quotaBytesUsed": long, "ownerNames": [ string ], "owners": [ { "kind": "drive#user", "displayName": string, "picture": { "url": string }, "isAuthenticatedUser": boolean, "permissionId": string, "emailAddress": string } ], "teamDriveId": string, "driveId": string, "lastModifyingUserName": string, "lastModifyingUser": { "kind": "drive#user", "displayName": string, "picture": { "url": string }, "isAuthenticatedUser": boolean, "permissionId": string, "emailAddress": string }, "ownedByMe": boolean, "capabilities": { "canAcceptOwnership": boolean, "canAddChildren": boolean, "canAddFolderFromAnotherDrive": boolean, "canAddMyDriveParent": boolean, "canChangeCopyRequiresWriterPermission": boolean, "canChangeRestrictedDownload": boolean, "canChangeSecurityUpdateEnabled": boolean, "canComment": boolean, "canCopy": boolean, "canDelete": boolean, "canDeleteChildren": boolean, "canDownload": boolean, "canEdit": boolean, "canListChildren": boolean, "canModifyContent": boolean, "canModifyContentRestriction": boolean, "canModifyLabels": boolean, "canMoveChildrenOutOfTeamDrive": boolean, "canMoveChildrenOutOfDrive": boolean, "canMoveChildrenWithinTeamDrive": boolean, "canMoveChildrenWithinDrive": boolean, "canMoveItemIntoTeamDrive": boolean, "canMoveItemOutOfTeamDrive": boolean, "canMoveItemOutOfDrive": boolean, "canMoveItemWithinTeamDrive": boolean, "canMoveItemWithinDrive": boolean, "canMoveTeamDriveItem": boolean, "canReadLabels": boolean, "canReadRevisions": boolean, "canReadTeamDrive": boolean, "canReadDrive": boolean, "canRemoveChildren": boolean, "canRemoveMyDriveParent": boolean, "canRename": boolean, "canShare": boolean, "canTrash": boolean, "canTrashChildren": boolean, "canUntrash": boolean }, "editable": boolean, "canComment": boolean, "canReadRevisions": boolean, "shareable": boolean, "copyable": boolean, "writersCanShare": boolean, "shared": boolean, "explicitlyTrashed": boolean, "trashingUser": { "kind": "drive#user", "displayName": string, "picture": { "url": string }, "isAuthenticatedUser": boolean, "permissionId": string, "emailAddress": string }, "trashedDate": datetime, "appDataContents": boolean, "headRevisionId": string, "properties": [ properties Resource ], "folderColorRgb": string, "imageMediaMetadata": { "width": integer, "height": integer, "rotation": integer, "location": { "latitude": double, "longitude": double, "altitude": double }, "date": string, "cameraMake": string, "cameraModel": string, "exposureTime": float, "aperture": float, "flashUsed": boolean, "focalLength": float, "isoSpeed": integer, "meteringMode": string, "sensor": string, "exposureMode": string, "colorSpace": string, "whiteBalance": string, "exposureBias": float, "maxApertureValue": float, "subjectDistance": integer, "lens": string }, "videoMediaMetadata": { "width": integer, "height": integer, "durationMillis": long }, "spaces": [ string ], "isAppAuthorized": boolean, "shortcutDetails": { "targetId": string, "targetMimeType": string, "targetResourceKey": string }, "contentRestrictions": [ { "readOnly": boolean, "reason": string, "restrictingUser": { "kind": "drive#user", "displayName": string, "picture": { "url": string }, "isAuthenticatedUser": boolean, "permissionId": string, "emailAddress": string }, "restrictionDate": datetime, "type": string } ], "labelInfo": { "labels": [ { "kind": "drive#label", "id": string, "revisionId": string, "fields": { (key): { "kind": "drive#labelField", "id": string, "valueType": string, "dateString": [ date ], "integer": [ long ], "selection": [ string ], "text": [ string ], "user": [ { "kind": "drive#user", "displayName": string, "picture": { "url": string }, "isAuthenticatedUser": boolean, "permissionId": string, "emailAddress": string } ] } } } ] }, "resourceKey": string, "linkShareMetadata": { "securityUpdateEligible": boolean, "securityUpdateEnabled": boolean } }
Property name | Value | Description | Notes |
---|---|---|---|
kind |
string |
The type of file. This is always drive#file. | |
id |
string |
The ID of the file. | writable |
etag |
etag |
ETag of the file. | |
selfLink |
string |
A link back to this file. | |
title |
string |
The title of this file. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the title is constant. | writable |
mimeType |
string |
The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type. | writable |
description |
string |
A short description of the file. | writable |
labels |
object |
A group of labels for the file. | |
labels.starred |
boolean |
Whether this file is starred by the user. | writable |
labels.trashed |
boolean |
Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file. The trashed item is excluded from all files.list responses returned for any user who does not own the file. However, all users with access to the file can see the trashed item metadata in an API response. All users with access can copy, download, export, and share the file. | writable |
createdDate |
datetime |
Create time for this file (formatted RFC 3339 timestamp). | |
modifiedDate |
datetime |
Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set. | writable |
modifiedByMeDate |
datetime |
Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date. | |
downloadUrl |
string |
Short lived download URL for the file. This field is only populated for files with content stored in Google Drive; it isn't populated for Docs Editors or shortcut files. | |
indexableText |
object |
Indexable text attributes for the file (can only be written). For more information, see Manage file metadata. | |
indexableText.text |
string |
The text to be indexed for this file. | writable |
userPermission |
nested object |
The permissions for the authenticated user on this file. | |
fileExtension |
string |
The final component of fullFileExtension with trailing text that does not appear to be part of the extension removed. This field is only populated for files with content stored in Google Drive; it isn't populated for Docs Editors or shortcut files. |
|
md5Checksum |
string |
An MD5 checksum for the content of this file. This field is only populated for files with content stored in Google Drive; it isn't populated for Docs Editors or shortcut files. | |
fileSize |
long |
The size of the file's content in bytes. This field is populated for files with binary content stored in Google Drive and for Docs Editors files; it is not populated for shortcuts or folders. | |
alternateLink |
string |
A link for opening the file in a relevant Google editor or viewer. | |
embedLink |
string |
A link for embedding the file. | |
labels.restricted |
boolean |
Deprecated - use copyRequiresWriterPermission instead. |
|
labels.viewed |
boolean |
Whether this file has been viewed by this user. | writable |
sharedWithMeDate |
datetime |
Time at which this file was shared with the user (formatted RFC 3339 timestamp). | |
parents[] |
list |
Collection of parent folders which contain this file. If not specified as part of an insert request, the file will be placed directly in the user's My Drive folder. If not specified as part of a copy request, the file will inherit any discoverable parents of the source file. Update requests can also use the |
writable |
exportLinks |
object |
Links for exporting Docs Editors files to specific formats. | |
exportLinks.(key) |
string |
A mapping from export format to URL | |
originalFilename |
string |
The original filename of the uploaded content if available, or else the original value of the title field. This is only available for files with binary content in Google Drive. |
writable |
quotaBytesUsed |
long |
The number of quota bytes used by this file. | |
ownerNames[] |
list |
Name(s) of the owner(s) of this file. Not populated for items in shared drives. | |
lastModifyingUserName |
string |
Name of the last user to modify this file. | |
editable |
boolean |
Deprecated: use capabilities/canEdit. | |
writersCanShare |
boolean |
Whether writers can share the document with other users. Not populated for items in shared drives. | writable |
thumbnailLink |
string |
A short-lived link to the file's thumbnail. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content. If the file isn't shared publicly, the URL returned in Files.thumbnailLink must be fetched using a credentialed request. |
|
lastViewedByMeDate |
datetime |
Last time this file was viewed by the user (formatted RFC 3339 timestamp). | writable |
webContentLink |
string |
A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials. | |
explicitlyTrashed |
boolean |
Whether this file has been explicitly trashed, as opposed to recursively trashed. | |
imageMediaMetadata |
object |
Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content. | |
imageMediaMetadata.width |
integer |
The width of the image in pixels. | |
imageMediaMetadata.height |
integer |
The height of the image in pixels. | |
imageMediaMetadata.rotation |
integer |
The number of clockwise 90 degree rotations applied from the image's original orientation. | |
imageMediaMetadata.location |
object |
Geographic location information stored in the image. | |
imageMediaMetadata.location.latitude |
double |
The latitude stored in the image. | |
imageMediaMetadata.location.longitude |
double |
The longitude stored in the image. | |
imageMediaMetadata.location.altitude |
double |
The altitude stored in the image. | |
thumbnail |
object |
A thumbnail for the file. This will only be used if a standard thumbnail cannot be generated. | |
thumbnail.image |
bytes |
The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5. | |
thumbnail.mimeType |
string |
The MIME type of the thumbnail. | |
imageMediaMetadata.date |
string |
The date and time the photo was taken (EXIF format timestamp). | |
imageMediaMetadata.cameraMake |
string |
The make of the camera used to create the photo. | |
imageMediaMetadata.cameraModel |
string |
The model of the camera used to create the photo. | |
imageMediaMetadata.exposureTime |
float |
The length of the exposure, in seconds. | |
imageMediaMetadata.aperture |
float |
The aperture used to create the photo (f-number). | |
imageMediaMetadata.flashUsed |
boolean |
Whether a flash was used to create the photo. | |
imageMediaMetadata.focalLength |
float |
The focal length used to create the photo, in millimeters. | |
imageMediaMetadata.isoSpeed |
integer |
The ISO speed used to create the photo. | |
webViewLink |
string |
A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting. | |
iconLink |
string |
A link to the file's icon. | |
imageMediaMetadata.meteringMode |
string |
The metering mode used to create the photo. | |
imageMediaMetadata.sensor |
string |
The type of sensor used to create the photo. | |
imageMediaMetadata.exposureMode |
string |
The exposure mode used to create the photo. | |
imageMediaMetadata.colorSpace |
string |
The color space of the photo. | |
imageMediaMetadata.whiteBalance |
string |
The white balance mode used to create the photo. | |
imageMediaMetadata.exposureBias |
float |
The exposure bias of the photo (APEX value). | |
imageMediaMetadata.maxApertureValue |
float |
The smallest f-number of the lens at the focal length used to create the photo (APEX value). | |
imageMediaMetadata.subjectDistance |
integer |
The distance to the subject of the photo, in meters. | |
imageMediaMetadata.lens |
string |
The lens used to create the photo. | |
shared |
boolean |
Whether the file has been shared. Not populated for items in shared drives. | |
owners[] |
list |
The owner of this file. Only certain legacy files may have more than one owner. This field isn't populated for items in shared drives. | |
owners[].kind |
string |
This is always drive#user. | |
owners[].displayName |
string |
A plain text displayable name for this user. | |
owners[].picture |
object |
The user's profile picture. | |
owners[].picture.url |
string |
A URL that points to a profile picture of this user. | |
owners[].isAuthenticatedUser |
boolean |
Whether this user is the same as the authenticated user for whom the request was made. | |
owners[].permissionId |
string |
The user's ID as visible in the permissions collection. | |
lastModifyingUser |
nested object |
The last user to modify this file. | |
lastModifyingUser.kind |
string |
This is always drive#user. | |
lastModifyingUser.displayName |
string |
A plain text displayable name for this user. | |
lastModifyingUser.picture |
object |
The user's profile picture. | |
lastModifyingUser.picture.url |
string |
A URL that points to a profile picture of this user. | |
lastModifyingUser.isAuthenticatedUser |
boolean |
Whether this user is the same as the authenticated user for whom the request was made. | |
lastModifyingUser.permissionId |
string |
The user's ID as visible in the permissions collection. | |
appDataContents |
boolean |
Whether this file is in the Application Data folder. | |
openWithLinks |
object |
A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used. | |
openWithLinks.(key) |
string |
||
defaultOpenWithLink |
string |
A link to open this file with the user's default app for this file. Only populated when the drive.apps.readonly scope is used. | |
headRevisionId |
string |
The ID of the file's head revision. This field is only populated for files with content stored in Google Drive; it isn't populated for Docs Editors or shortcut files. | |
copyable |
boolean |
Deprecated: use capabilities/canCopy. | |
properties[] |
list |
The list of properties. | writable |
owners[].emailAddress |
string |
The email address of the user. | |
lastModifyingUser.emailAddress |
string |
The email address of the user. This field is returned only if the last modifying user is an owner of the file, the requesting user is an owner or can modify the file, or if the last modifying user's email address is visible. | |
markedViewedByMeDate |
datetime |
Deprecated. | |
version |
long |
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 requesting user. | |
sharingUser |
nested object |
User that shared the item with the current user, if available. | |
sharingUser.kind |
string |
This is always drive#user. | |
sharingUser.displayName |
string |
A plain text displayable name for this user. | |
sharingUser.picture |
object |
The user's profile picture. | |
sharingUser.picture.url |
string |
A URL that points to a profile picture of this user. | |
sharingUser.isAuthenticatedUser |
boolean |
Whether this user is the same as the authenticated user for whom the request was made. | |
sharingUser.permissionId |
string |
The user's ID as visible in the permissions collection. | |
sharingUser.emailAddress |
string |
The email address of the user. | |
permissions[] |
list |
The list of permissions for users with access to this file. Not populated for items in shared drives. | |
videoMediaMetadata |
object |
Metadata about video media. This will only be present for video types. | |
videoMediaMetadata.width |
integer |
The width of the video in pixels. | |
videoMediaMetadata.height |
integer |
The height of the video in pixels. | |
videoMediaMetadata.durationMillis |
long |
The duration of the video in milliseconds. | |
folderColorRgb |
string |
Folder color as an RGB hex string if the file is a folder or a shortcut to a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette. | writable |
fullFileExtension |
string |
The full file extension; extracted from the title. May contain multiple concatenated extensions, such as "tar.gz". Removing an extension from the title does not clear this field; however, changing the extension on the title does update this field. This field is only populated for files with content stored in Google Drive; it isn't populated for Docs Editors or shortcut files. | |
ownedByMe |
boolean |
Whether the file is owned by the current user. Not populated for items in shared drives. | |
canComment |
boolean |
Deprecated: use capabilities/canComment. | |
shareable |
boolean |
Deprecated: use capabilities/canShare. | |
spaces[] |
list |
The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'. | |
canReadRevisions |
boolean |
Deprecated: use capabilities/canReadRevisions. | |
isAppAuthorized |
boolean |
Whether the file was created or opened by the requesting app. | |
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. | |
thumbnailVersion |
long |
The thumbnail version for use in thumbnail cache invalidation. | |
labels.modified |
boolean |
Whether the file has been modified by this user. | |
hasAugmentedPermissions |
boolean |
Whether there are permissions directly on this file. This field is only populated for items in shared drives. | |
teamDriveId |
string |
Deprecated - use driveId instead. |
|
capabilities |
object |
Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take. | |
capabilities.canAddChildren |
boolean |
Whether the current user can add children to this folder. This is always false when the item is not a folder. | |
capabilities.canComment |
boolean |
Whether the current user can comment on this file. | |
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. | |
capabilities.canDelete |
boolean |
Whether the current user can delete this file. | |
capabilities.canDownload |
boolean |
Whether the current user can download this file. | |
capabilities.canEdit |
boolean |
Whether the current user can edit this file. Other factors may limit the type of changes a user can make to a file. For example, see canChangeCopyRequiresWriterPermission or canModifyContent . |
|
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. | |
capabilities.canMoveItemIntoTeamDrive |
boolean |
Deprecated - use canMoveItemOutOfDrive instead. |
|
capabilities.canMoveTeamDriveItem |
boolean |
Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead. |
|
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 isn't a folder, can be read. | |
capabilities.canReadTeamDrive |
boolean |
Deprecated - use canReadDrive instead. |
|
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. |
|
capabilities.canRename |
boolean |
Whether the current user can rename this file. | |
capabilities.canShare |
boolean |
Whether the current user can modify the sharing settings for this file. | |
capabilities.canTrash |
boolean |
Whether the current user can move this file to trash. | |
capabilities.canUntrash |
boolean |
Whether the current user can restore this file from trash. | |
trashingUser |
nested object |
If the file has been explicitly trashed, the user who trashed it. Only populated for items in shared drives. | |
trashingUser.kind |
string |
This is always drive#user. | |
trashingUser.displayName |
string |
A plain text displayable name for this user. | |
trashingUser.picture |
object |
The user's profile picture. | |
trashingUser.picture.url |
string |
A URL that points to a profile picture of this user. | |
trashingUser.isAuthenticatedUser |
boolean |
Whether this user is the same as the authenticated user for whom the request was made. | |
trashingUser.permissionId |
string |
The user's ID as visible in the permissions collection. | |
trashingUser.emailAddress |
string |
The email address of the user. | |
trashedDate |
datetime |
The time that the item was trashed (formatted RFC 3339 timestamp). Only populated for items in shared drives. | |
capabilities.canChangeRestrictedDownload |
boolean |
Deprecated | |
permissionIds[] |
list |
List of permission IDs for users with access to this file. | |
copyRequiresWriterPermission |
boolean |
Whether the options to copy, print, or download this file, should be disabled for readers and commenters. | writable |
capabilities.canChangeCopyRequiresWriterPermission |
boolean |
Whether the current user can change the copyRequiresWriterPermission restriction of this file. |
|
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. | |
capabilities.canMoveChildrenOutOfTeamDrive |
boolean |
Deprecated - use canMoveChildrenOutOfDrive instead. |
|
capabilities.canMoveChildrenWithinTeamDrive |
boolean |
Deprecated - use canMoveChildrenWithinDrive instead. |
|
capabilities.canMoveItemOutOfTeamDrive |
boolean |
Deprecated - use canMoveItemOutOfDrive instead. |
|
capabilities.canMoveItemWithinTeamDrive |
boolean |
Deprecated - use canMoveItemWithinDrive instead. |
|
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. | |
driveId |
string |
ID of the shared drive the file resides in. Only populated for items in shared drives. | |
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. | |
capabilities.canMoveChildrenWithinDrive |
boolean |
Whether the current user can move children of this folder within this drive. This is false when the item is not a folder. Note that a request to move the child may still fail depending on the current user's access to the child and to the destination folder. | |
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. | |
capabilities.canMoveItemWithinDrive |
boolean |
Whether the current user can move this item within this drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added and the parent that is being removed. | |
capabilities.canReadDrive |
boolean |
Whether the current user can read the shared drive to which this file belongs. Only populated for items in shared drives. | |
capabilities.canModifyContent |
boolean |
Whether the current user can modify the content of this file. | |
capabilities.canAddMyDriveParent |
boolean |
Whether the current user can add a parent for the item without removing an existing parent in the same request. Not populated for shared drive files. | |
capabilities.canRemoveMyDriveParent |
boolean |
Whether the current user can remove a parent from the item without adding another parent in the same request. Not populated for shared drive files. | |
shortcutDetails |
object |
Shortcut file details. Only populated for shortcut files, which have the mimeType field set to application/vnd.google-apps.shortcut . |
|
shortcutDetails.targetId |
string |
The ID of the file that this shortcut points to. | writable |
shortcutDetails.targetMimeType |
string |
The MIME type of the file that this shortcut points to. The value of this field is a snapshot of the target's MIME type, captured when the shortcut is created. | |
capabilities.canAddFolderFromAnotherDrive |
boolean |
Whether the current user can add a folder from another drive (different shared drive or My Drive) to this folder. This is false when the item is not a folder. Only populated for items in shared drives. | |
capabilities.canModifyContentRestriction |
boolean |
Whether the current user can modify restrictions on content of this file. | |
contentRestrictions[] |
list |
Restrictions for accessing the content of the file. Only populated if such a restriction exists. | |
contentRestrictions[].readOnly |
boolean |
Whether the content of the file is read-only. If a file is read-only, a new revision of the file may not be added, comments may not be added or modified, and the title of the file may not be modified. | writable |
contentRestrictions[].reason |
string |
Reason for why the content of the file is restricted. This is only mutable on requests that also set readOnly=true . |
writable |
contentRestrictions[].restrictingUser |
nested object |
The user who set the content restriction. Only populated if readOnly is true. |
|
contentRestrictions[].restrictingUser.kind |
string |
This is always drive#user. | |
contentRestrictions[].restrictingUser.displayName |
string |
A plain text displayable name for this user. | |
contentRestrictions[].restrictingUser.picture |
object |
The user's profile picture. | |
contentRestrictions[].restrictingUser.picture.url |
string |
A URL that points to a profile picture of this user. | |
contentRestrictions[].restrictingUser.isAuthenticatedUser |
boolean |
Whether this user is the same as the authenticated user for whom the request was made. | |
contentRestrictions[].restrictingUser.permissionId |
string |
The user's ID as visible in the permissions collection. | |
contentRestrictions[].restrictingUser.emailAddress |
string |
The email address of the user. | |
contentRestrictions[].restrictionDate |
datetime |
The time at which the content restriction was set (formatted RFC 3339 timestamp). Only populated if readOnly is true. |
|
contentRestrictions[].type |
string |
The type of the content restriction. Currently the only possible value is globalContentRestriction . |
|
capabilities.canChangeSecurityUpdateEnabled |
boolean |
Whether the current user can change the securityUpdateEnabled field on link share metadata. | |
shortcutDetails.targetResourceKey |
string |
The ResourceKey for the target file. | |
resourceKey |
string |
A key needed to access the item via a shared link. | |
linkShareMetadata |
object |
Contains details about the link URLs that clients are using to refer to this item. | |
linkShareMetadata.securityUpdateEligible |
boolean |
Whether the file is eligible for security update. | |
linkShareMetadata.securityUpdateEnabled |
boolean |
Whether the security update is enabled for this file. | |
capabilities.canAcceptOwnership |
boolean |
Whether the current user is the pending owner of the file. Not populated for shared drive files. | |
capabilities.canModifyLabels |
boolean |
Whether the current user can modify the labels on this file. | |
capabilities.canReadLabels |
boolean |
Whether the current user can read the labels on this file. | |
labelInfo |
object |
An overview of the labels on the file. | |
labelInfo.labels[] |
list |
The set of labels on the file as requested by the label IDs in the includeLabels parameter. By default, no labels are returned. |
|
labelInfo.labels[].kind |
string |
This is always drive#label | |
labelInfo.labels[].id |
string |
The ID of the label. | |
labelInfo.labels[].revisionId |
string |
The revision ID of the label. | |
labelInfo.labels[].fields |
object |
A map of the label's fields keyed by the field ID. | |
labelInfo.labels[].fields.(key) |
nested object |
||
labelInfo.labels[].fields.(key).kind |
string |
This is always drive#labelField. | |
labelInfo.labels[].fields.(key).id |
string |
The identifier of this field. | |
labelInfo.labels[].fields.(key).valueType |
string |
The field type. While new values may be supported in the future, the following are currently allowed:
|
|
labelInfo.labels[].fields.(key).dateString[] |
list |
Only present if valueType is dateString . RFC 3339 formatted date: YYYY-MM-DD. |
|
labelInfo.labels[].fields.(key).integer[] |
list |
Only present if valueType is integer . |
|
labelInfo.labels[].fields.(key).selection[] |
list |
Only present if valueType is selection . |
|
labelInfo.labels[].fields.(key).text[] |
list |
Only present if valueType is text . |
|
labelInfo.labels[].fields.(key).user[] |
list |
Only present if valueType is user . |
|
labelInfo.labels[].fields.(key).user[].kind |
string |
This is always drive#user. | |
labelInfo.labels[].fields.(key).user[].displayName |
string |
A plain text displayable name for this user. | |
labelInfo.labels[].fields.(key).user[].picture |
object |
The user's profile picture. | |
labelInfo.labels[].fields.(key).user[].picture.url |
string |
A URL that points to a profile picture of this user. | |
labelInfo.labels[].fields.(key).user[].isAuthenticatedUser |
boolean |
Whether this user is the same as the authenticated user for whom the request was made. | |
labelInfo.labels[].fields.(key).user[].permissionId |
string |
The user's ID as visible in the permissions collection. | |
labelInfo.labels[].fields.(key).user[].emailAddress |
string |
The email address of the user. | |
sha1Checksum |
string |
The SHA1 checksum associated with this file, if available. This field is only populated for files with content stored in Google Drive; it isn't populated for Docs Editors or shortcut files. | |
sha256Checksum |
string |
The SHA256 checksum associated with this file, if available. This field is only populated for files with content stored in Google Drive; it isn't populated for Docs Editors or shortcut files. |
Methods
- get
- Gets a file's metadata or content by ID.
- insert
- Insert a new file.
- patch
- Updates a file's metadata and/or content. When calling this method, only populate fields in the request that you want to modify. When updating fields, some fields might change automatically, such as modifiedDate. This method supports patch semantics.
- update
- Updates a file's metadata and/or content. When calling this method, only populate fields in the request that you want to modify. When updating fields, some fields might be changed automatically, such as modifiedDate. This method supports patch semantics.
- copy
- Creates a copy of the specified file. Folders cannot be copied.
- delete
- Permanently deletes a file by ID. Skips the trash. The currently authenticated user must own the file or be an organizer on the parent for shared drive files.
- list
- Lists the user's files.
- touch
- Set the file's updated time to the current server time.
- trash
- Moves a file to the trash. The currently authenticated user must own the file or be at least a fileOrganizer on the parent for shared drive files. Only the owner may trash a file. The trashed item is excluded from all files.list responses returned for any user who does not own the file. However, all users with access to the file can see the trashed item metadata in an API response. All users with access can copy, download, export, and share the file.
- untrash
- Restores a file from the trash. The currently authenticated user must own the file or be at least a fileOrganizer on the parent for shared drive files. Only the owner may untrash a file.
- watch
- Subscribes to changes to a file. While you can establish a channel for changes to a file on a shared drive, a change to a shared drive file won't create a notification.
- emptyTrash
- Permanently deletes all of the user's trashed files.
- generateIds
- Generates a set of file IDs which can be provided in insert or copy requests.
- export
- Exports a Google Workspace document to the requested MIME type and returns exported byte content. Note that the exported content is limited to 10MB.
- listLabels
- Lists the labels on a file.
- modifyLabels
- Modifies the set of labels on a file.