Google Drive (version v3.*.*)

Google Drive Integration

copy_file

Creates a copy of a file and applies any requested updates with patch semantics. Folders cannot be copied.

Parameters

fileId (required)

The ID of the file.

Type: string

$body

The metadata for a file.

Type: object

{
  "modifiedTime" : "The last time the file was modified by anyone (RFC 3339 date-time).\nNote that setting modifiedTime will also update modifiedByMeTime for the user.",
  "copyRequiresWriterPermission" : "Whether the options to copy, print, or download this file, should be disabled for readers and commenters.",
  "owners" : [ {
    "permissionId" : "The user's ID as visible in Permission resources.",
    "emailAddress" : "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.",
    "displayName" : "A plain text displayable name for this user.",
    "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#user\".",
    "me" : "Whether this user is the requesting user.",
    "photoLink" : "A link to the user's profile photo, if available."
  } ],
  "mimeType" : "The MIME type of the file.\nGoogle 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.\nIf 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.",
  "contentRestrictions" : [ {
    "reason" : "Reason for why the content of the file is restricted. This is only mutable on requests that also set readOnly=true.",
    "readOnly" : "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.",
    "restrictionTime" : "The time at which the content restriction was set (formatted RFC 3339 timestamp). Only populated if readOnly is true.",
    "type" : "The type of the content restriction. Currently the only possible value is globalContentRestriction.",
    "restrictingUser" : {
      "permissionId" : "The user's ID as visible in Permission resources.",
      "emailAddress" : "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.",
      "displayName" : "A plain text displayable name for this user.",
      "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#user\".",
      "me" : "Whether this user is the requesting user.",
      "photoLink" : "A link to the user's profile photo, if available."
    }
  } ],
  "iconLink" : "A static, unauthenticated link to the file's icon.",
  "starred" : "Whether the user has starred the file.",
  "permissions" : [ {
    "teamDrivePermissionDetails" : [ {
      "role" : "Deprecated - use permissionDetails/role instead.",
      "inherited" : "Deprecated - use permissionDetails/inherited instead.",
      "inheritedFrom" : "Deprecated - use permissionDetails/inheritedFrom instead.",
      "teamDrivePermissionType" : "Deprecated - use permissionDetails/permissionType instead."
    } ],
    "role" : "The role granted by this permission. While new values may be supported in the future, the following are currently allowed:  \n- owner \n- organizer \n- fileOrganizer \n- writer \n- commenter \n- reader",
    "displayName" : "The \"pretty\" name of the value of the permission. The following is a list of examples for each type of permission:  \n- user - User's full name, as defined for their Google account, such as \"Joe Smith.\" \n- group - Name of the Google Group, such as \"The Company Administrators.\" \n- domain - String domain name, such as \"thecompany.com.\" \n- anyone - No displayName is present.",
    "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#permission\".",
    "type" : "The type of the grantee. Valid values are:  \n- user \n- group \n- domain \n- anyone  When creating a permission, if type is user or group, you must provide an emailAddress for the user or group. When type is domain, you must provide a domain. There isn't extra information required for a anyone type.",
    "emailAddress" : "The email address of the user or group to which this permission refers.",
    "view" : "Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value.",
    "deleted" : "Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.",
    "permissionDetails" : [ {
      "permissionType" : "The permission type for this user. While new values may be added in future, the following are currently possible:  \n- file \n- member",
      "role" : "The primary role for this user. While new values may be added in the future, the following are currently possible:  \n- organizer \n- fileOrganizer \n- writer \n- commenter \n- reader",
      "inherited" : "Whether this permission is inherited. This field is always populated. This is an output-only field.",
      "inheritedFrom" : "The ID of the item from which this permission is inherited. This is an output-only field."
    } ],
    "expirationTime" : "The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions:  \n- They can only be set on user and group permissions \n- The time must be in the future \n- The time cannot be more than a year in the future",
    "domain" : "The domain to which this permission refers.",
    "id" : "The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. IDs should be treated as opaque values.",
    "photoLink" : "A link to the user's profile photo, if available.",
    "allowFileDiscovery" : "Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone."
  } ],
  "modifiedByMe" : "Whether the file has been modified by this user.",
  "contentHints" : {
    "thumbnail" : {
      "image" : "The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).",
      "mimeType" : "The MIME type of the thumbnail."
    },
    "indexableText" : "Text to be indexed for the file to improve fullText queries. This is limited to 128KB in length and may contain HTML elements."
  },
  "isAppAuthorized" : "Whether the file was created or opened by the requesting app.",
  "createdTime" : "The time at which the file was created (RFC 3339 date-time).",
  "id" : "The ID of the file.",
  "sharedWithMeTime" : "The time at which the file was shared with the user, if applicable (RFC 3339 date-time).",
  "writersCanShare" : "Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives.",
  "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#file\".",
  "viewersCanCopyContent" : "Deprecated - use copyRequiresWriterPermission instead.",
  "webViewLink" : "A link for opening the file in a relevant Google editor or viewer in a browser.",
  "ownedByMe" : "Whether the user owns the file. Not populated for items in shared drives.",
  "version" : "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.",
  "explicitlyTrashed" : "Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder.",
  "trashedTime" : "The time that the item was trashed (RFC 3339 date-time). Only populated for items in shared drives.",
  "viewedByMe" : "Whether the file has been viewed by this user.",
  "driveId" : "ID of the shared drive the file resides in. Only populated for items in shared drives.",
  "size" : "The size of the file's content in bytes. This is applicable to binary files in Google Drive and Google Docs files.",
  "imageMediaMetadata" : {
    "meteringMode" : "The metering mode used to create the photo.",
    "exposureTime" : "The length of the exposure, in seconds.",
    "whiteBalance" : "The white balance mode used to create the photo.",
    "rotation" : "The number of clockwise 90 degree rotations applied from the image's original orientation.",
    "maxApertureValue" : "The smallest f-number of the lens at the focal length used to create the photo (APEX value).",
    "lens" : "The lens used to create the photo.",
    "exposureBias" : "The exposure bias of the photo (APEX value).",
    "colorSpace" : "The color space of the photo.",
    "aperture" : "The aperture used to create the photo (f-number).",
    "flashUsed" : "Whether a flash was used to create the photo.",
    "subjectDistance" : "The distance to the subject of the photo, in meters.",
    "cameraModel" : "The model of the camera used to create the photo.",
    "width" : "The width of the image in pixels.",
    "isoSpeed" : "The ISO speed used to create the photo.",
    "location" : {
      "altitude" : "The altitude stored in the image.",
      "latitude" : "The latitude stored in the image.",
      "longitude" : "The longitude stored in the image."
    },
    "sensor" : "The type of sensor used to create the photo.",
    "time" : "The date and time the photo was taken (EXIF DateTime).",
    "cameraMake" : "The make of the camera used to create the photo.",
    "exposureMode" : "The exposure mode used to create the photo.",
    "focalLength" : "The focal length used to create the photo, in millimeters.",
    "height" : "The height of the image in pixels."
  },
  "name" : "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.",
  "spaces" : [ "string" ],
  "appProperties" : "A collection of arbitrary key-value pairs which are private to the requesting app.\nEntries with null values are cleared in update and copy requests. These properties can only be retrieved using an authenticated request. An authenticated request uses an access token obtained with a OAuth 2 client ID. You cannot use an API key to retrieve private properties.",
  "folderColorRgb" : "The color for a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource.\nIf an unsupported color is specified, the closest color in the palette will be used instead.",
  "headRevisionId" : "The ID of the file's head revision. This is currently only available for files with binary content in Google Drive.",
  "parents" : [ "string" ],
  "teamDriveId" : "Deprecated - use driveId instead.",
  "trashed" : "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.",
  "modifiedByMeTime" : "The last time the file was modified by the user (RFC 3339 date-time).",
  "shared" : "Whether the file has been shared. Not populated for items in shared drives.",
  "hasAugmentedPermissions" : "Whether there are permissions directly on this file. This field is only populated for items in shared drives.",
  "description" : "A short description of the file.",
  "trashingUser" : {
    "permissionId" : "The user's ID as visible in Permission resources.",
    "emailAddress" : "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.",
    "displayName" : "A plain text displayable name for this user.",
    "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#user\".",
    "me" : "Whether this user is the requesting user.",
    "photoLink" : "A link to the user's profile photo, if available."
  },
  "permissionIds" : [ "string" ],
  "thumbnailLink" : "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. If the file isn't shared publicly, the URL returned in Files.thumbnailLink must be fetched using a credentialed request.",
  "quotaBytesUsed" : "The number of storage quota bytes used by the file. This includes the head revision as well as previous revisions with keepForever enabled.",
  "lastModifyingUser" : {
    "permissionId" : "The user's ID as visible in Permission resources.",
    "emailAddress" : "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.",
    "displayName" : "A plain text displayable name for this user.",
    "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#user\".",
    "me" : "Whether this user is the requesting user.",
    "photoLink" : "A link to the user's profile photo, if available."
  },
  "md5Checksum" : "The MD5 checksum for the content of the file. This is only applicable to files with binary content in Google Drive.",
  "fileExtension" : "The final component of fullFileExtension. This is only available for files with binary content in Google Drive.",
  "fullFileExtension" : "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.\nThis is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.",
  "webContentLink" : "A link for downloading the content of the file in a browser. This is only available for files with binary content in Google Drive.",
  "shortcutDetails" : {
    "targetId" : "The ID of the file that this shortcut points to.",
    "targetMimeType" : "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" : {
    "canReadRevisions" : "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.",
    "canMoveItemOutOfDrive" : "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.",
    "canEdit" : "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.",
    "canRename" : "Whether the current user can rename this file.",
    "canAddMyDriveParent" : "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.",
    "canMoveChildrenWithinTeamDrive" : "Deprecated - use canMoveChildrenWithinDrive instead.",
    "canTrashChildren" : "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.",
    "canAddChildren" : "Whether the current user can add children to this folder. This is always false when the item is not a folder.",
    "canListChildren" : "Whether the current user can list the children of this folder. This is always false when the item is not a folder.",
    "canTrash" : "Whether the current user can move this file to trash.",
    "canMoveItemIntoTeamDrive" : "Deprecated - use canMoveItemOutOfDrive instead.",
    "canRemoveMyDriveParent" : "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.",
    "canCopy" : "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.",
    "canDownload" : "Whether the current user can download this file.",
    "canDelete" : "Whether the current user can delete this file.",
    "canAddFolderFromAnotherDrive" : "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.",
    "canComment" : "Whether the current user can comment on this file.",
    "canUntrash" : "Whether the current user can restore this file from trash.",
    "canMoveItemOutOfTeamDrive" : "Deprecated - use canMoveItemOutOfDrive instead.",
    "canMoveChildrenWithinDrive" : "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.",
    "canModifyContentRestriction" : "Whether the current user can modify restrictions on content of this file.",
    "canMoveTeamDriveItem" : "Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead.",
    "canChangeCopyRequiresWriterPermission" : "Whether the current user can change the copyRequiresWriterPermission restriction of this file.",
    "canMoveChildrenOutOfDrive" : "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.",
    "canReadDrive" : "Whether the current user can read the shared drive to which this file belongs. Only populated for items in shared drives.",
    "canShare" : "Whether the current user can modify the sharing settings for this file.",
    "canDeleteChildren" : "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.",
    "canMoveItemWithinDrive" : "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.",
    "canMoveChildrenOutOfTeamDrive" : "Deprecated - use canMoveChildrenOutOfDrive instead.",
    "canMoveItemWithinTeamDrive" : "Deprecated - use canMoveItemWithinDrive instead.",
    "canModifyContent" : "Whether the current user can modify the content of this file.",
    "canRemoveChildren" : "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.",
    "canChangeViewersCanCopyContent" : "Deprecated",
    "canReadTeamDrive" : "Deprecated - use canReadDrive instead."
  },
  "hasThumbnail" : "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.",
  "viewedByMeTime" : "The last time the file was viewed by the user (RFC 3339 date-time).",
  "videoMediaMetadata" : {
    "width" : "The width of the video in pixels.",
    "durationMillis" : "The duration of the video in milliseconds.",
    "height" : "The height of the video in pixels."
  },
  "exportLinks" : "Links for exporting Docs Editors files to specific formats.",
  "thumbnailVersion" : "The thumbnail version for use in thumbnail cache invalidation.",
  "sharingUser" : {
    "permissionId" : "The user's ID as visible in Permission resources.",
    "emailAddress" : "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.",
    "displayName" : "A plain text displayable name for this user.",
    "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#user\".",
    "me" : "Whether this user is the requesting user.",
    "photoLink" : "A link to the user's profile photo, if available."
  },
  "originalFilename" : "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.",
  "properties" : "A collection of arbitrary key-value pairs which are visible to all apps.\nEntries with null values are cleared in update and copy requests."
}

alt

Data format for the response.

Type: string

Potential values: json

enforceSingleParent

Deprecated. Copying files into multiple folders is no longer supported. Use shortcuts instead.

Type: boolean

fields

Selector specifying which fields to include in a partial response.

Type: string

ignoreDefaultVisibility

Whether to ignore the domain's default visibility settings for the created file. Domain administrators can choose to make all uploaded files visible to the domain by default; this parameter bypasses that behavior for the request. Permissions are still inherited from parent folders.

Type: boolean

includePermissionsForView

Specifies which additional view's permissions to include in the response. Only 'published' is supported.

Type: string

keepRevisionForever

Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Google Drive. Only 200 revisions for the file can be kept forever. If the limit is reached, try deleting pinned revisions.

Type: boolean

ocrLanguage

A language hint for OCR processing during image import (ISO 639-1 code).

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

supportsAllDrives

Whether the requesting application supports both My Drives and shared drives.

Type: boolean

supportsTeamDrives

Deprecated use supportsAllDrives instead.

Type: boolean

userIp

Deprecated. Please use quotaUser instead.

Type: string

create_comment

Creates a new comment on a file.

Parameters

fileId (required)

The ID of the file.

Type: string

$body

A comment on a file.

Type: object

{
  "modifiedTime" : "The last time the comment or any of its replies was modified (RFC 3339 date-time).",
  "deleted" : "Whether the comment has been deleted. A deleted comment has no content.",
  "replies" : [ {
    "modifiedTime" : "The last time the reply was modified (RFC 3339 date-time).",
    "deleted" : "Whether the reply has been deleted. A deleted reply has no content.",
    "author" : {
      "permissionId" : "The user's ID as visible in Permission resources.",
      "emailAddress" : "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.",
      "displayName" : "A plain text displayable name for this user.",
      "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#user\".",
      "me" : "Whether this user is the requesting user.",
      "photoLink" : "A link to the user's profile photo, if available."
    },
    "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#reply\".",
    "action" : "The action the reply performed to the parent comment. Valid values are:  \n- resolve \n- reopen",
    "createdTime" : "The time at which the reply was created (RFC 3339 date-time).",
    "id" : "The ID of the reply.",
    "content" : "The plain text content of the reply. This field is used for setting the content, while htmlContent should be displayed. This is required on creates if no action is specified.",
    "htmlContent" : "The content of the reply with HTML formatting."
  } ],
  "author" : {
    "permissionId" : "The user's ID as visible in Permission resources.",
    "emailAddress" : "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.",
    "displayName" : "A plain text displayable name for this user.",
    "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#user\".",
    "me" : "Whether this user is the requesting user.",
    "photoLink" : "A link to the user's profile photo, if available."
  },
  "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#comment\".",
  "anchor" : "A region of the document represented as a JSON string. See anchor documentation for details on how to define and interpret anchor properties.",
  "createdTime" : "The time at which the comment was created (RFC 3339 date-time).",
  "id" : "The ID of the comment.",
  "content" : "The plain text content of the comment. This field is used for setting the content, while htmlContent should be displayed.",
  "quotedFileContent" : {
    "mimeType" : "The MIME type of the quoted content.",
    "value" : "The quoted content itself. This is interpreted as plain text if set through the API."
  },
  "htmlContent" : "The content of the comment with HTML formatting.",
  "resolved" : "Whether the comment has been resolved by one of its replies."
}

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

userIp

Deprecated. Please use quotaUser instead.

Type: string

create_comment_reply

Creates a new reply to a comment.

Parameters

commentId (required)

The ID of the comment.

Type: string

fileId (required)

The ID of the file.

Type: string

$body

A reply to a comment on a file.

Type: object

{
  "modifiedTime" : "The last time the reply was modified (RFC 3339 date-time).",
  "deleted" : "Whether the reply has been deleted. A deleted reply has no content.",
  "author" : {
    "permissionId" : "The user's ID as visible in Permission resources.",
    "emailAddress" : "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.",
    "displayName" : "A plain text displayable name for this user.",
    "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#user\".",
    "me" : "Whether this user is the requesting user.",
    "photoLink" : "A link to the user's profile photo, if available."
  },
  "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#reply\".",
  "action" : "The action the reply performed to the parent comment. Valid values are:  \n- resolve \n- reopen",
  "createdTime" : "The time at which the reply was created (RFC 3339 date-time).",
  "id" : "The ID of the reply.",
  "content" : "The plain text content of the reply. This field is used for setting the content, while htmlContent should be displayed. This is required on creates if no action is specified.",
  "htmlContent" : "The content of the reply with HTML formatting."
}

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

userIp

Deprecated. Please use quotaUser instead.

Type: string

create_drive

Creates a new shared drive.

Parameters

requestId (required)

An ID, such as a random UUID, which uniquely identifies this user's request for idempotent creation of a shared drive. A repeated request by the same user and with the same request ID will avoid creating duplicates by attempting to create the same shared drive. If the shared drive already exists a 409 error will be returned.

Type: string

$body

Representation of a shared drive.

Type: object

{
  "capabilities" : {
    "canDeleteDrive" : "Whether the current user can delete this shared drive. Attempting to delete the shared drive may still fail if there are untrashed items inside the shared drive.",
    "canReadRevisions" : "Whether the current user can read the revisions resource of files in this shared drive.",
    "canEdit" : "Whether the current user can edit files in this shared drive",
    "canShare" : "Whether the current user can share files or folders in this shared drive.",
    "canRename" : "Whether the current user can rename files or folders in this shared drive.",
    "canDeleteChildren" : "Whether the current user can delete children from folders in this shared drive.",
    "canChangeCopyRequiresWriterPermissionRestriction" : "Whether the current user can change the copyRequiresWriterPermission restriction of this shared drive.",
    "canChangeDriveBackground" : "Whether the current user can change the background of this shared drive.",
    "canTrashChildren" : "Whether the current user can trash children from folders in this shared drive.",
    "canAddChildren" : "Whether the current user can add children to folders in this shared drive.",
    "canChangeDriveMembersOnlyRestriction" : "Whether the current user can change the driveMembersOnly restriction of this shared drive.",
    "canListChildren" : "Whether the current user can list the children of folders in this shared drive.",
    "canChangeDomainUsersOnlyRestriction" : "Whether the current user can change the domainUsersOnly restriction of this shared drive.",
    "canManageMembers" : "Whether the current user can add members to this shared drive or remove them or change their role.",
    "canRenameDrive" : "Whether the current user can rename this shared drive.",
    "canCopy" : "Whether the current user can copy files in this shared drive.",
    "canDownload" : "Whether the current user can download files in this shared drive.",
    "canComment" : "Whether the current user can comment on files in this shared drive."
  },
  "backgroundImageFile" : {
    "xCoordinate" : "The X coordinate of the upper left corner of the cropping area in the background image. This is a value in the closed range of 0 to 1. This value represents the horizontal distance from the left side of the entire image to the left side of the cropping area divided by the width of the entire image.",
    "yCoordinate" : "The Y coordinate of the upper left corner of the cropping area in the background image. This is a value in the closed range of 0 to 1. This value represents the vertical distance from the top side of the entire image to the top side of the cropping area divided by the height of the entire image.",
    "width" : "The width of the cropped image in the closed range of 0 to 1. This value represents the width of the cropped image divided by the width of the entire image. The height is computed by applying a width to height aspect ratio of 80 to 9. The resulting image must be at least 1280 pixels wide and 144 pixels high.",
    "id" : "The ID of an image file in Google Drive to use for the background image."
  },
  "hidden" : "Whether the shared drive is hidden from default view.",
  "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#drive\".",
  "backgroundImageLink" : "A short-lived link to this shared drive's background image.",
  "name" : "The name of this shared drive.",
  "createdTime" : "The time at which the shared drive was created (RFC 3339 date-time).",
  "restrictions" : {
    "adminManagedRestrictions" : "Whether administrative privileges on this shared drive are required to modify restrictions.",
    "copyRequiresWriterPermission" : "Whether the options to copy, print, or download files inside this shared drive, should be disabled for readers and commenters. When this restriction is set to true, it will override the similarly named field to true for any file inside this shared drive.",
    "domainUsersOnly" : "Whether access to this shared drive and items inside this shared drive is restricted to users of the domain to which this shared drive belongs. This restriction may be overridden by other sharing policies controlled outside of this shared drive.",
    "driveMembersOnly" : "Whether access to items inside this shared drive is restricted to its members."
  },
  "themeId" : "The ID of the theme from which the background image and color will be set. The set of possible driveThemes can be retrieved from a drive.about.get response. When not specified on a drive.drives.create request, a random theme is chosen from which the background image and color are set. This is a write-only field; it can only be set on requests that don't set colorRgb or backgroundImageFile.",
  "id" : "The ID of this shared drive which is also the ID of the top level folder of this shared drive.",
  "colorRgb" : "The color of this shared drive as an RGB hex string. It can only be set on a drive.drives.update request that does not set themeId."
}

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

userIp

Deprecated. Please use quotaUser instead.

Type: string

create_file_content

Creates a file an uploads file data to it. Only simple uploads are supported. https://developers.google.com/drive/api/v3/manage-uploads#simple

Parameters

uploadType (required)

Must be set to 'media'

Type: string

Potential values: media

$body

Type: string

Content-Type

Set to the MIME media type of the object being uploaded.

Type: string

create_file_metadata

Creates a new file.

Parameters

$body

The metadata for a file.

Type: object

{
  "modifiedTime" : "The last time the file was modified by anyone (RFC 3339 date-time).\nNote that setting modifiedTime will also update modifiedByMeTime for the user.",
  "copyRequiresWriterPermission" : "Whether the options to copy, print, or download this file, should be disabled for readers and commenters.",
  "owners" : [ {
    "permissionId" : "The user's ID as visible in Permission resources.",
    "emailAddress" : "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.",
    "displayName" : "A plain text displayable name for this user.",
    "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#user\".",
    "me" : "Whether this user is the requesting user.",
    "photoLink" : "A link to the user's profile photo, if available."
  } ],
  "mimeType" : "The MIME type of the file.\nGoogle 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.\nIf 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.",
  "contentRestrictions" : [ {
    "reason" : "Reason for why the content of the file is restricted. This is only mutable on requests that also set readOnly=true.",
    "readOnly" : "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.",
    "restrictionTime" : "The time at which the content restriction was set (formatted RFC 3339 timestamp). Only populated if readOnly is true.",
    "type" : "The type of the content restriction. Currently the only possible value is globalContentRestriction.",
    "restrictingUser" : {
      "permissionId" : "The user's ID as visible in Permission resources.",
      "emailAddress" : "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.",
      "displayName" : "A plain text displayable name for this user.",
      "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#user\".",
      "me" : "Whether this user is the requesting user.",
      "photoLink" : "A link to the user's profile photo, if available."
    }
  } ],
  "iconLink" : "A static, unauthenticated link to the file's icon.",
  "starred" : "Whether the user has starred the file.",
  "permissions" : [ {
    "teamDrivePermissionDetails" : [ {
      "role" : "Deprecated - use permissionDetails/role instead.",
      "inherited" : "Deprecated - use permissionDetails/inherited instead.",
      "inheritedFrom" : "Deprecated - use permissionDetails/inheritedFrom instead.",
      "teamDrivePermissionType" : "Deprecated - use permissionDetails/permissionType instead."
    } ],
    "role" : "The role granted by this permission. While new values may be supported in the future, the following are currently allowed:  \n- owner \n- organizer \n- fileOrganizer \n- writer \n- commenter \n- reader",
    "displayName" : "The \"pretty\" name of the value of the permission. The following is a list of examples for each type of permission:  \n- user - User's full name, as defined for their Google account, such as \"Joe Smith.\" \n- group - Name of the Google Group, such as \"The Company Administrators.\" \n- domain - String domain name, such as \"thecompany.com.\" \n- anyone - No displayName is present.",
    "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#permission\".",
    "type" : "The type of the grantee. Valid values are:  \n- user \n- group \n- domain \n- anyone  When creating a permission, if type is user or group, you must provide an emailAddress for the user or group. When type is domain, you must provide a domain. There isn't extra information required for a anyone type.",
    "emailAddress" : "The email address of the user or group to which this permission refers.",
    "view" : "Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value.",
    "deleted" : "Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.",
    "permissionDetails" : [ {
      "permissionType" : "The permission type for this user. While new values may be added in future, the following are currently possible:  \n- file \n- member",
      "role" : "The primary role for this user. While new values may be added in the future, the following are currently possible:  \n- organizer \n- fileOrganizer \n- writer \n- commenter \n- reader",
      "inherited" : "Whether this permission is inherited. This field is always populated. This is an output-only field.",
      "inheritedFrom" : "The ID of the item from which this permission is inherited. This is an output-only field."
    } ],
    "expirationTime" : "The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions:  \n- They can only be set on user and group permissions \n- The time must be in the future \n- The time cannot be more than a year in the future",
    "domain" : "The domain to which this permission refers.",
    "id" : "The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. IDs should be treated as opaque values.",
    "photoLink" : "A link to the user's profile photo, if available.",
    "allowFileDiscovery" : "Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone."
  } ],
  "modifiedByMe" : "Whether the file has been modified by this user.",
  "contentHints" : {
    "thumbnail" : {
      "image" : "The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).",
      "mimeType" : "The MIME type of the thumbnail."
    },
    "indexableText" : "Text to be indexed for the file to improve fullText queries. This is limited to 128KB in length and may contain HTML elements."
  },
  "isAppAuthorized" : "Whether the file was created or opened by the requesting app.",
  "createdTime" : "The time at which the file was created (RFC 3339 date-time).",
  "id" : "The ID of the file.",
  "sharedWithMeTime" : "The time at which the file was shared with the user, if applicable (RFC 3339 date-time).",
  "writersCanShare" : "Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives.",
  "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#file\".",
  "viewersCanCopyContent" : "Deprecated - use copyRequiresWriterPermission instead.",
  "webViewLink" : "A link for opening the file in a relevant Google editor or viewer in a browser.",
  "ownedByMe" : "Whether the user owns the file. Not populated for items in shared drives.",
  "version" : "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.",
  "explicitlyTrashed" : "Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder.",
  "trashedTime" : "The time that the item was trashed (RFC 3339 date-time). Only populated for items in shared drives.",
  "viewedByMe" : "Whether the file has been viewed by this user.",
  "driveId" : "ID of the shared drive the file resides in. Only populated for items in shared drives.",
  "size" : "The size of the file's content in bytes. This is applicable to binary files in Google Drive and Google Docs files.",
  "imageMediaMetadata" : {
    "meteringMode" : "The metering mode used to create the photo.",
    "exposureTime" : "The length of the exposure, in seconds.",
    "whiteBalance" : "The white balance mode used to create the photo.",
    "rotation" : "The number of clockwise 90 degree rotations applied from the image's original orientation.",
    "maxApertureValue" : "The smallest f-number of the lens at the focal length used to create the photo (APEX value).",
    "lens" : "The lens used to create the photo.",
    "exposureBias" : "The exposure bias of the photo (APEX value).",
    "colorSpace" : "The color space of the photo.",
    "aperture" : "The aperture used to create the photo (f-number).",
    "flashUsed" : "Whether a flash was used to create the photo.",
    "subjectDistance" : "The distance to the subject of the photo, in meters.",
    "cameraModel" : "The model of the camera used to create the photo.",
    "width" : "The width of the image in pixels.",
    "isoSpeed" : "The ISO speed used to create the photo.",
    "location" : {
      "altitude" : "The altitude stored in the image.",
      "latitude" : "The latitude stored in the image.",
      "longitude" : "The longitude stored in the image."
    },
    "sensor" : "The type of sensor used to create the photo.",
    "time" : "The date and time the photo was taken (EXIF DateTime).",
    "cameraMake" : "The make of the camera used to create the photo.",
    "exposureMode" : "The exposure mode used to create the photo.",
    "focalLength" : "The focal length used to create the photo, in millimeters.",
    "height" : "The height of the image in pixels."
  },
  "name" : "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.",
  "spaces" : [ "string" ],
  "appProperties" : "A collection of arbitrary key-value pairs which are private to the requesting app.\nEntries with null values are cleared in update and copy requests. These properties can only be retrieved using an authenticated request. An authenticated request uses an access token obtained with a OAuth 2 client ID. You cannot use an API key to retrieve private properties.",
  "folderColorRgb" : "The color for a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource.\nIf an unsupported color is specified, the closest color in the palette will be used instead.",
  "headRevisionId" : "The ID of the file's head revision. This is currently only available for files with binary content in Google Drive.",
  "parents" : [ "string" ],
  "teamDriveId" : "Deprecated - use driveId instead.",
  "trashed" : "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.",
  "modifiedByMeTime" : "The last time the file was modified by the user (RFC 3339 date-time).",
  "shared" : "Whether the file has been shared. Not populated for items in shared drives.",
  "hasAugmentedPermissions" : "Whether there are permissions directly on this file. This field is only populated for items in shared drives.",
  "description" : "A short description of the file.",
  "trashingUser" : {
    "permissionId" : "The user's ID as visible in Permission resources.",
    "emailAddress" : "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.",
    "displayName" : "A plain text displayable name for this user.",
    "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#user\".",
    "me" : "Whether this user is the requesting user.",
    "photoLink" : "A link to the user's profile photo, if available."
  },
  "permissionIds" : [ "string" ],
  "thumbnailLink" : "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. If the file isn't shared publicly, the URL returned in Files.thumbnailLink must be fetched using a credentialed request.",
  "quotaBytesUsed" : "The number of storage quota bytes used by the file. This includes the head revision as well as previous revisions with keepForever enabled.",
  "lastModifyingUser" : {
    "permissionId" : "The user's ID as visible in Permission resources.",
    "emailAddress" : "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.",
    "displayName" : "A plain text displayable name for this user.",
    "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#user\".",
    "me" : "Whether this user is the requesting user.",
    "photoLink" : "A link to the user's profile photo, if available."
  },
  "md5Checksum" : "The MD5 checksum for the content of the file. This is only applicable to files with binary content in Google Drive.",
  "fileExtension" : "The final component of fullFileExtension. This is only available for files with binary content in Google Drive.",
  "fullFileExtension" : "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.\nThis is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.",
  "webContentLink" : "A link for downloading the content of the file in a browser. This is only available for files with binary content in Google Drive.",
  "shortcutDetails" : {
    "targetId" : "The ID of the file that this shortcut points to.",
    "targetMimeType" : "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" : {
    "canReadRevisions" : "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.",
    "canMoveItemOutOfDrive" : "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.",
    "canEdit" : "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.",
    "canRename" : "Whether the current user can rename this file.",
    "canAddMyDriveParent" : "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.",
    "canMoveChildrenWithinTeamDrive" : "Deprecated - use canMoveChildrenWithinDrive instead.",
    "canTrashChildren" : "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.",
    "canAddChildren" : "Whether the current user can add children to this folder. This is always false when the item is not a folder.",
    "canListChildren" : "Whether the current user can list the children of this folder. This is always false when the item is not a folder.",
    "canTrash" : "Whether the current user can move this file to trash.",
    "canMoveItemIntoTeamDrive" : "Deprecated - use canMoveItemOutOfDrive instead.",
    "canRemoveMyDriveParent" : "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.",
    "canCopy" : "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.",
    "canDownload" : "Whether the current user can download this file.",
    "canDelete" : "Whether the current user can delete this file.",
    "canAddFolderFromAnotherDrive" : "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.",
    "canComment" : "Whether the current user can comment on this file.",
    "canUntrash" : "Whether the current user can restore this file from trash.",
    "canMoveItemOutOfTeamDrive" : "Deprecated - use canMoveItemOutOfDrive instead.",
    "canMoveChildrenWithinDrive" : "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.",
    "canModifyContentRestriction" : "Whether the current user can modify restrictions on content of this file.",
    "canMoveTeamDriveItem" : "Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead.",
    "canChangeCopyRequiresWriterPermission" : "Whether the current user can change the copyRequiresWriterPermission restriction of this file.",
    "canMoveChildrenOutOfDrive" : "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.",
    "canReadDrive" : "Whether the current user can read the shared drive to which this file belongs. Only populated for items in shared drives.",
    "canShare" : "Whether the current user can modify the sharing settings for this file.",
    "canDeleteChildren" : "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.",
    "canMoveItemWithinDrive" : "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.",
    "canMoveChildrenOutOfTeamDrive" : "Deprecated - use canMoveChildrenOutOfDrive instead.",
    "canMoveItemWithinTeamDrive" : "Deprecated - use canMoveItemWithinDrive instead.",
    "canModifyContent" : "Whether the current user can modify the content of this file.",
    "canRemoveChildren" : "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.",
    "canChangeViewersCanCopyContent" : "Deprecated",
    "canReadTeamDrive" : "Deprecated - use canReadDrive instead."
  },
  "hasThumbnail" : "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.",
  "viewedByMeTime" : "The last time the file was viewed by the user (RFC 3339 date-time).",
  "videoMediaMetadata" : {
    "width" : "The width of the video in pixels.",
    "durationMillis" : "The duration of the video in milliseconds.",
    "height" : "The height of the video in pixels."
  },
  "exportLinks" : "Links for exporting Docs Editors files to specific formats.",
  "thumbnailVersion" : "The thumbnail version for use in thumbnail cache invalidation.",
  "sharingUser" : {
    "permissionId" : "The user's ID as visible in Permission resources.",
    "emailAddress" : "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.",
    "displayName" : "A plain text displayable name for this user.",
    "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#user\".",
    "me" : "Whether this user is the requesting user.",
    "photoLink" : "A link to the user's profile photo, if available."
  },
  "originalFilename" : "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.",
  "properties" : "A collection of arbitrary key-value pairs which are visible to all apps.\nEntries with null values are cleared in update and copy requests."
}

alt

Data format for the response.

Type: string

Potential values: json

enforceSingleParent

Deprecated. Creating files in multiple folders is no longer supported.

Type: boolean

fields

Selector specifying which fields to include in a partial response.

Type: string

ignoreDefaultVisibility

Whether to ignore the domain's default visibility settings for the created file. Domain administrators can choose to make all uploaded files visible to the domain by default; this parameter bypasses that behavior for the request. Permissions are still inherited from parent folders.

Type: boolean

includePermissionsForView

Specifies which additional view's permissions to include in the response. Only 'published' is supported.

Type: string

keepRevisionForever

Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Google Drive. Only 200 revisions for the file can be kept forever. If the limit is reached, try deleting pinned revisions.

Type: boolean

ocrLanguage

A language hint for OCR processing during image import (ISO 639-1 code).

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

supportsAllDrives

Whether the requesting application supports both My Drives and shared drives.

Type: boolean

supportsTeamDrives

Deprecated use supportsAllDrives instead.

Type: boolean

useContentAsIndexableText

Whether to use the uploaded content as indexable text.

Type: boolean

userIp

Deprecated. Please use quotaUser instead.

Type: string

create_permission

Creates a permission for a file or shared drive.

Parameters

fileId (required)

The ID of the file or shared drive.

Type: string

$body

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

Type: object

{
  "teamDrivePermissionDetails" : [ {
    "role" : "Deprecated - use permissionDetails/role instead.",
    "inherited" : "Deprecated - use permissionDetails/inherited instead.",
    "inheritedFrom" : "Deprecated - use permissionDetails/inheritedFrom instead.",
    "teamDrivePermissionType" : "Deprecated - use permissionDetails/permissionType instead."
  } ],
  "role" : "The role granted by this permission. While new values may be supported in the future, the following are currently allowed:  \n- owner \n- organizer \n- fileOrganizer \n- writer \n- commenter \n- reader",
  "displayName" : "The \"pretty\" name of the value of the permission. The following is a list of examples for each type of permission:  \n- user - User's full name, as defined for their Google account, such as \"Joe Smith.\" \n- group - Name of the Google Group, such as \"The Company Administrators.\" \n- domain - String domain name, such as \"thecompany.com.\" \n- anyone - No displayName is present.",
  "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#permission\".",
  "type" : "The type of the grantee. Valid values are:  \n- user \n- group \n- domain \n- anyone  When creating a permission, if type is user or group, you must provide an emailAddress for the user or group. When type is domain, you must provide a domain. There isn't extra information required for a anyone type.",
  "emailAddress" : "The email address of the user or group to which this permission refers.",
  "view" : "Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value.",
  "deleted" : "Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.",
  "permissionDetails" : [ {
    "permissionType" : "The permission type for this user. While new values may be added in future, the following are currently possible:  \n- file \n- member",
    "role" : "The primary role for this user. While new values may be added in the future, the following are currently possible:  \n- organizer \n- fileOrganizer \n- writer \n- commenter \n- reader",
    "inherited" : "Whether this permission is inherited. This field is always populated. This is an output-only field.",
    "inheritedFrom" : "The ID of the item from which this permission is inherited. This is an output-only field."
  } ],
  "expirationTime" : "The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions:  \n- They can only be set on user and group permissions \n- The time must be in the future \n- The time cannot be more than a year in the future",
  "domain" : "The domain to which this permission refers.",
  "id" : "The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. IDs should be treated as opaque values.",
  "photoLink" : "A link to the user's profile photo, if available.",
  "allowFileDiscovery" : "Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone."
}

alt

Data format for the response.

Type: string

Potential values: json

emailMessage

A plain text custom message to include in the notification email.

Type: string

enforceSingleParent

Deprecated. See moveToNewOwnersRoot for details.

Type: boolean

fields

Selector specifying which fields to include in a partial response.

Type: string

moveToNewOwnersRoot

This parameter will only take effect if the item is not in a shared drive and the request is attempting to transfer the ownership of the item. If set to true, the item will be moved to the new owner's My Drive root folder and all prior parents removed. If set to false, parents are not changed.

Type: boolean

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

sendNotificationEmail

Whether to send a notification email when sharing to users or groups. This defaults to true for users and groups, and is not allowed for other requests. It must not be disabled for ownership transfers.

Type: boolean

supportsAllDrives

Whether the requesting application supports both My Drives and shared drives.

Type: boolean

supportsTeamDrives

Deprecated use supportsAllDrives instead.

Type: boolean

transferOwnership

Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of the side effect.

Type: boolean

useDomainAdminAccess

Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.

Type: boolean

userIp

Deprecated. Please use quotaUser instead.

Type: string

create_team_drive

Deprecated use drives.create instead.

Parameters

requestId (required)

An ID, such as a random UUID, which uniquely identifies this user's request for idempotent creation of a Team Drive. A repeated request by the same user and with the same request ID will avoid creating duplicates by attempting to create the same Team Drive. If the Team Drive already exists a 409 error will be returned.

Type: string

$body

Deprecated: use the drive collection instead.

Type: object

{
  "capabilities" : {
    "canChangeTeamDriveBackground" : "Whether the current user can change the background of this Team Drive.",
    "canReadRevisions" : "Whether the current user can read the revisions resource of files in this Team Drive.",
    "canDeleteTeamDrive" : "Whether the current user can delete this Team Drive. Attempting to delete the Team Drive may still fail if there are untrashed items inside the Team Drive.",
    "canEdit" : "Whether the current user can edit files in this Team Drive",
    "canShare" : "Whether the current user can share files or folders in this Team Drive.",
    "canRename" : "Whether the current user can rename files or folders in this Team Drive.",
    "canDeleteChildren" : "Whether the current user can delete children from folders in this Team Drive.",
    "canChangeCopyRequiresWriterPermissionRestriction" : "Whether the current user can change the copyRequiresWriterPermission restriction of this Team Drive.",
    "canTrashChildren" : "Whether the current user can trash children from folders in this Team Drive.",
    "canRenameTeamDrive" : "Whether the current user can rename this Team Drive.",
    "canAddChildren" : "Whether the current user can add children to folders in this Team Drive.",
    "canChangeTeamMembersOnlyRestriction" : "Whether the current user can change the teamMembersOnly restriction of this Team Drive.",
    "canListChildren" : "Whether the current user can list the children of folders in this Team Drive.",
    "canChangeDomainUsersOnlyRestriction" : "Whether the current user can change the domainUsersOnly restriction of this Team Drive.",
    "canManageMembers" : "Whether the current user can add members to this Team Drive or remove them or change their role.",
    "canRemoveChildren" : "Deprecated - use canDeleteChildren or canTrashChildren instead.",
    "canCopy" : "Whether the current user can copy files in this Team Drive.",
    "canDownload" : "Whether the current user can download files in this Team Drive.",
    "canComment" : "Whether the current user can comment on files in this Team Drive."
  },
  "backgroundImageFile" : {
    "xCoordinate" : "The X coordinate of the upper left corner of the cropping area in the background image. This is a value in the closed range of 0 to 1. This value represents the horizontal distance from the left side of the entire image to the left side of the cropping area divided by the width of the entire image.",
    "yCoordinate" : "The Y coordinate of the upper left corner of the cropping area in the background image. This is a value in the closed range of 0 to 1. This value represents the vertical distance from the top side of the entire image to the top side of the cropping area divided by the height of the entire image.",
    "width" : "The width of the cropped image in the closed range of 0 to 1. This value represents the width of the cropped image divided by the width of the entire image. The height is computed by applying a width to height aspect ratio of 80 to 9. The resulting image must be at least 1280 pixels wide and 144 pixels high.",
    "id" : "The ID of an image file in Drive to use for the background image."
  },
  "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#teamDrive\".",
  "backgroundImageLink" : "A short-lived link to this Team Drive's background image.",
  "name" : "The name of this Team Drive.",
  "createdTime" : "The time at which the Team Drive was created (RFC 3339 date-time).",
  "restrictions" : {
    "adminManagedRestrictions" : "Whether administrative privileges on this Team Drive are required to modify restrictions.",
    "copyRequiresWriterPermission" : "Whether the options to copy, print, or download files inside this Team Drive, should be disabled for readers and commenters. When this restriction is set to true, it will override the similarly named field to true for any file inside this Team Drive.",
    "domainUsersOnly" : "Whether access to this Team Drive and items inside this Team Drive is restricted to users of the domain to which this Team Drive belongs. This restriction may be overridden by other sharing policies controlled outside of this Team Drive.",
    "teamMembersOnly" : "Whether access to items inside this Team Drive is restricted to members of this Team Drive."
  },
  "themeId" : "The ID of the theme from which the background image and color will be set. The set of possible teamDriveThemes can be retrieved from a drive.about.get response. When not specified on a drive.teamdrives.create request, a random theme is chosen from which the background image and color are set. This is a write-only field; it can only be set on requests that don't set colorRgb or backgroundImageFile.",
  "id" : "The ID of this Team Drive which is also the ID of the top level folder of this Team Drive.",
  "colorRgb" : "The color of this Team Drive as an RGB hex string. It can only be set on a drive.teamdrives.update request that does not set themeId."
}

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

userIp

Deprecated. Please use quotaUser instead.

Type: string

delete_comment

Deletes a comment.

Parameters

commentId (required)

The ID of the comment.

Type: string

fileId (required)

The ID of the file.

Type: string

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

userIp

Deprecated. Please use quotaUser instead.

Type: string

delete_comment_reply

Deletes a reply.

Parameters

commentId (required)

The ID of the comment.

Type: string

fileId (required)

The ID of the file.

Type: string

replyId (required)

The ID of the reply.

Type: string

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

userIp

Deprecated. Please use quotaUser instead.

Type: string

delete_drive

Permanently deletes a shared drive for which the user is an organizer. The shared drive cannot contain any untrashed items.

Parameters

driveId (required)

The ID of the shared drive.

Type: string

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

userIp

Deprecated. Please use quotaUser instead.

Type: string

delete_file

Permanently deletes a file owned by the user without moving it to the trash. If the file belongs to a shared drive the user must be an organizer on the parent. If the target is a folder, all descendants owned by the user are also deleted.

Parameters

fileId (required)

The ID of the file.

Type: string

alt

Data format for the response.

Type: string

Potential values: json

enforceSingleParent

Deprecated. If an item is not in a shared drive and its last parent is deleted but the item itself is not, the item will be placed under its owner's root.

Type: boolean

fields

Selector specifying which fields to include in a partial response.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

supportsAllDrives

Whether the requesting application supports both My Drives and shared drives.

Type: boolean

supportsTeamDrives

Deprecated use supportsAllDrives instead.

Type: boolean

userIp

Deprecated. Please use quotaUser instead.

Type: string

delete_permission

Deletes a permission.

Parameters

fileId (required)

The ID of the file or shared drive.

Type: string

permissionId (required)

The ID of the permission.

Type: string

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

supportsAllDrives

Whether the requesting application supports both My Drives and shared drives.

Type: boolean

supportsTeamDrives

Deprecated use supportsAllDrives instead.

Type: boolean

useDomainAdminAccess

Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.

Type: boolean

userIp

Deprecated. Please use quotaUser instead.

Type: string

delete_revision

Permanently deletes a file version. You can only delete revisions for files with binary content in Google Drive, like images or videos. Revisions for other files, like Google Docs or Sheets, and the last remaining file version can't be deleted.

Parameters

fileId (required)

The ID of the file.

Type: string

revisionId (required)

The ID of the revision.

Type: string

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

userIp

Deprecated. Please use quotaUser instead.

Type: string

delete_team_drive

Deprecated use drives.delete instead.

Parameters

teamDriveId (required)

The ID of the Team Drive

Type: string

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

userIp

Deprecated. Please use quotaUser instead.

Type: string

empty_trash

Permanently deletes all of the user's trashed files.

Parameters

alt

Data format for the response.

Type: string

Potential values: json

enforceSingleParent

Deprecated. If an item is not in a shared drive and its last parent is deleted but the item itself is not, the item will be placed under its owner's root.

Type: boolean

fields

Selector specifying which fields to include in a partial response.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

userIp

Deprecated. Please use quotaUser instead.

Type: string

export_file

Exports a Google Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB.

Parameters

fileId (required)

The ID of the file.

Type: string

mimeType (required)

The MIME type of the format requested for this export.

Type: string

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

userIp

Deprecated. Please use quotaUser instead.

Type: string

generate_ids

Generates a set of file IDs which can be provided in create or copy requests.

Parameters

alt

Data format for the response.

Type: string

Potential values: json

count

The number of IDs to return.

Type: integer

fields

Selector specifying which fields to include in a partial response.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

space

The space in which the IDs can be used to create new files. Supported values are 'drive' and 'appDataFolder'.

Type: string

userIp

Deprecated. Please use quotaUser instead.

Type: string

get_about_drive

Gets information about the user, the user's Drive, and system capabilities.

Parameters

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

userIp

Deprecated. Please use quotaUser instead.

Type: string

get_comment

Gets a comment by ID.

Parameters

commentId (required)

The ID of the comment.

Type: string

fileId (required)

The ID of the file.

Type: string

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

includeDeleted

Whether to return deleted comments. Deleted comments will not include their original content.

Type: boolean

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

userIp

Deprecated. Please use quotaUser instead.

Type: string

get_comment_reply

Gets a reply by ID.

Parameters

commentId (required)

The ID of the comment.

Type: string

fileId (required)

The ID of the file.

Type: string

replyId (required)

The ID of the reply.

Type: string

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

includeDeleted

Whether to return deleted replies. Deleted replies will not include their original content.

Type: boolean

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

userIp

Deprecated. Please use quotaUser instead.

Type: string

get_drive

Gets a shared drive's metadata by ID.

Parameters

driveId (required)

The ID of the shared drive.

Type: string

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

useDomainAdminAccess

Issue the request as a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the shared drive belongs.

Type: boolean

userIp

Deprecated. Please use quotaUser instead.

Type: string

get_file

Gets a file's metadata or content by ID.

Parameters

fileId (required)

The ID of the file.

Type: string

acknowledgeAbuse

Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.

Type: boolean

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

includePermissionsForView

Specifies which additional view's permissions to include in the response. Only 'published' is supported.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

supportsAllDrives

Whether the requesting application supports both My Drives and shared drives.

Type: boolean

supportsTeamDrives

Deprecated use supportsAllDrives instead.

Type: boolean

userIp

Deprecated. Please use quotaUser instead.

Type: string

get_permission

Gets a permission by ID.

Parameters

fileId (required)

The ID of the file.

Type: string

permissionId (required)

The ID of the permission.

Type: string

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

supportsAllDrives

Whether the requesting application supports both My Drives and shared drives.

Type: boolean

supportsTeamDrives

Deprecated use supportsAllDrives instead.

Type: boolean

useDomainAdminAccess

Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.

Type: boolean

userIp

Deprecated. Please use quotaUser instead.

Type: string

get_revision

Gets a revision's metadata or content by ID.

Parameters

fileId (required)

The ID of the file.

Type: string

revisionId (required)

The ID of the revision.

Type: string

acknowledgeAbuse

Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.

Type: boolean

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

userIp

Deprecated. Please use quotaUser instead.

Type: string

get_start_page_token

Gets the starting pageToken for listing future changes.

Parameters

alt

Data format for the response.

Type: string

Potential values: json

driveId

The ID of the shared drive for which the starting pageToken for listing future changes from that shared drive is returned.

Type: string

fields

Selector specifying which fields to include in a partial response.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

supportsAllDrives

Whether the requesting application supports both My Drives and shared drives.

Type: boolean

supportsTeamDrives

Deprecated use supportsAllDrives instead.

Type: boolean

teamDriveId

Deprecated use driveId instead.

Type: string

userIp

Deprecated. Please use quotaUser instead.

Type: string

get_team_drive

Deprecated use drives.get instead.

Parameters

teamDriveId (required)

The ID of the Team Drive

Type: string

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

useDomainAdminAccess

Issue the request as a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the Team Drive belongs.

Type: boolean

userIp

Deprecated. Please use quotaUser instead.

Type: string

hide_drive

Hides a shared drive from the default view.

Parameters

driveId (required)

The ID of the shared drive.

Type: string

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

userIp

Deprecated. Please use quotaUser instead.

Type: string

list_changes

Lists the changes for a user or shared drive.

Parameters

pageToken (required)

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 or to the response from the getStartPageToken method.

Type: string

alt

Data format for the response.

Type: string

Potential values: json

driveId

The shared drive from which changes are returned. If specified the change IDs will be reflective of the shared drive; use the combined drive ID and change ID as an identifier.

Type: string

fields

Selector specifying which fields to include in a partial response.

Type: string

includeCorpusRemovals

Whether changes should include the file resource if the file is still accessible by the user at the time of the request, even when a file was removed from the list of changes and there will be no further change entries for this file.

Type: boolean

includeItemsFromAllDrives

Whether both My Drive and shared drive items should be included in results.

Type: boolean

includePermissionsForView

Specifies which additional view's permissions to include in the response. Only 'published' is supported.

Type: string

includeRemoved

Whether to include changes indicating that items have been removed from the list of changes, for example by deletion or loss of access.

Type: boolean

includeTeamDriveItems

Deprecated use includeItemsFromAllDrives instead.

Type: boolean

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

restrictToMyDrive

Whether to restrict the results to changes inside the My Drive hierarchy. This omits changes to files such as those in the Application Data folder or shared files which have not been added to My Drive.

Type: boolean

spaces

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

Type: string

supportsAllDrives

Whether the requesting application supports both My Drives and shared drives.

Type: boolean

supportsTeamDrives

Deprecated use supportsAllDrives instead.

Type: boolean

teamDriveId

Deprecated use driveId instead.

Type: string

userIp

Deprecated. Please use quotaUser instead.

Type: string

list_comment_replies

Lists a comment's replies.

Parameters

commentId (required)

The ID of the comment.

Type: string

fileId (required)

The ID of the file.

Type: string

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

includeDeleted

Whether to include deleted replies. Deleted replies will not include their original content.

Type: boolean

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

userIp

Deprecated. Please use quotaUser instead.

Type: string

list_comments

Lists a file's comments.

Parameters

fileId (required)

The ID of the file.

Type: string

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

includeDeleted

Whether to include deleted comments. Deleted comments will not include their original content.

Type: boolean

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

startModifiedTime

The minimum value of 'modifiedTime' for the result comments (RFC 3339 date-time).

Type: string

userIp

Deprecated. Please use quotaUser instead.

Type: string

list_drives

Lists the user's shared drives.

Parameters

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

pageSize

Maximum number of shared drives to return.

Type: integer

pageToken

Page token for shared drives.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

q

Query string for searching shared drives.

Type: string

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

useDomainAdminAccess

Issue the request as a domain administrator; if set to true, then all shared drives of the domain in which the requester is an administrator are returned.

Type: boolean

userIp

Deprecated. Please use quotaUser instead.

Type: string

list_files

Lists or searches files.

Parameters

alt

Data format for the response.

Type: string

Potential values: json

corpora

Groupings of files to which the query applies. Supported groupings are: 'user' (files created by, opened by, or shared directly with the user), 'drive' (files in the specified shared drive as indicated by the 'driveId'), 'domain' (files shared to the user's domain), and 'allDrives' (A combination of 'user' and 'drive' for all drives where the user is a member). When able, use 'user' or 'drive', instead of 'allDrives', for efficiency.

Type: string

corpus

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

Type: string

Potential values: domain, user

driveId

ID of the shared drive to search.

Type: string

fields

Selector specifying which fields to include in a partial response.

Type: string

includeItemsFromAllDrives

Whether both My Drive and shared drive items should be included in results.

Type: boolean

includePermissionsForView

Specifies which additional view's permissions to include in the response. Only 'published' is supported.

Type: string

includeTeamDriveItems

Deprecated use includeItemsFromAllDrives instead.

Type: boolean

orderBy

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.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

q

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

Type: string

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

spaces

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

Type: string

supportsAllDrives

Whether the requesting application supports both My Drives and shared drives.

Type: boolean

supportsTeamDrives

Deprecated use supportsAllDrives instead.

Type: boolean

teamDriveId

Deprecated use driveId instead.

Type: string

userIp

Deprecated. Please use quotaUser instead.

Type: string

list_permissions

Lists a file's or shared drive's permissions.

Parameters

fileId (required)

The ID of the file or shared drive.

Type: string

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

includePermissionsForView

Specifies which additional view's permissions to include in the response. Only 'published' is supported.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

supportsAllDrives

Whether the requesting application supports both My Drives and shared drives.

Type: boolean

supportsTeamDrives

Deprecated use supportsAllDrives instead.

Type: boolean

useDomainAdminAccess

Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.

Type: boolean

userIp

Deprecated. Please use quotaUser instead.

Type: string

list_revisions

Lists a file's revisions.

Parameters

fileId (required)

The ID of the file.

Type: string

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

userIp

Deprecated. Please use quotaUser instead.

Type: string

list_team_drives

Deprecated use drives.list instead.

Parameters

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

q

Query string for searching Team Drives.

Type: string

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

useDomainAdminAccess

Issue the request as a domain administrator; if set to true, then all Team Drives of the domain in which the requester is an administrator are returned.

Type: boolean

userIp

Deprecated. Please use quotaUser instead.

Type: string

stop_channels

Stop watching resources through this channel

Parameters

$body

An notification channel used to watch for resource changes.

Type: object

{
  "resourceId" : "An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.",
  "address" : "The address where notifications are delivered for this channel.",
  "payload" : "A Boolean value to indicate whether payload is wanted. Optional.",
  "kind" : "Identifies this as a notification channel used to watch for changes to a resource, which is \"api#channel\".",
  "expiration" : "Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.",
  "id" : "A UUID or similar unique string that identifies this channel.",
  "resourceUri" : "A version-specific identifier for the watched resource.",
  "params" : "Additional parameters controlling delivery channel behavior. Optional.",
  "type" : "The type of delivery mechanism used for this channel. Valid values are \"web_hook\" (or \"webhook\"). Both values refer to a channel where Http requests are used to deliver messages.",
  "token" : "An arbitrary string delivered to the target address with each notification delivered over this channel. Optional."
}

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

userIp

Deprecated. Please use quotaUser instead.

Type: string

unhide_drive

Restores a shared drive to the default view.

Parameters

driveId (required)

The ID of the shared drive.

Type: string

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

userIp

Deprecated. Please use quotaUser instead.

Type: string

update_comment

Updates a comment with patch semantics.

Parameters

commentId (required)

The ID of the comment.

Type: string

fileId (required)

The ID of the file.

Type: string

$body

A comment on a file.

Type: object

{
  "modifiedTime" : "The last time the comment or any of its replies was modified (RFC 3339 date-time).",
  "deleted" : "Whether the comment has been deleted. A deleted comment has no content.",
  "replies" : [ {
    "modifiedTime" : "The last time the reply was modified (RFC 3339 date-time).",
    "deleted" : "Whether the reply has been deleted. A deleted reply has no content.",
    "author" : {
      "permissionId" : "The user's ID as visible in Permission resources.",
      "emailAddress" : "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.",
      "displayName" : "A plain text displayable name for this user.",
      "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#user\".",
      "me" : "Whether this user is the requesting user.",
      "photoLink" : "A link to the user's profile photo, if available."
    },
    "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#reply\".",
    "action" : "The action the reply performed to the parent comment. Valid values are:  \n- resolve \n- reopen",
    "createdTime" : "The time at which the reply was created (RFC 3339 date-time).",
    "id" : "The ID of the reply.",
    "content" : "The plain text content of the reply. This field is used for setting the content, while htmlContent should be displayed. This is required on creates if no action is specified.",
    "htmlContent" : "The content of the reply with HTML formatting."
  } ],
  "author" : {
    "permissionId" : "The user's ID as visible in Permission resources.",
    "emailAddress" : "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.",
    "displayName" : "A plain text displayable name for this user.",
    "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#user\".",
    "me" : "Whether this user is the requesting user.",
    "photoLink" : "A link to the user's profile photo, if available."
  },
  "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#comment\".",
  "anchor" : "A region of the document represented as a JSON string. See anchor documentation for details on how to define and interpret anchor properties.",
  "createdTime" : "The time at which the comment was created (RFC 3339 date-time).",
  "id" : "The ID of the comment.",
  "content" : "The plain text content of the comment. This field is used for setting the content, while htmlContent should be displayed.",
  "quotedFileContent" : {
    "mimeType" : "The MIME type of the quoted content.",
    "value" : "The quoted content itself. This is interpreted as plain text if set through the API."
  },
  "htmlContent" : "The content of the comment with HTML formatting.",
  "resolved" : "Whether the comment has been resolved by one of its replies."
}

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

userIp

Deprecated. Please use quotaUser instead.

Type: string

update_comment_reply

Updates a reply with patch semantics.

Parameters

commentId (required)

The ID of the comment.

Type: string

fileId (required)

The ID of the file.

Type: string

replyId (required)

The ID of the reply.

Type: string

$body

A reply to a comment on a file.

Type: object

{
  "modifiedTime" : "The last time the reply was modified (RFC 3339 date-time).",
  "deleted" : "Whether the reply has been deleted. A deleted reply has no content.",
  "author" : {
    "permissionId" : "The user's ID as visible in Permission resources.",
    "emailAddress" : "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.",
    "displayName" : "A plain text displayable name for this user.",
    "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#user\".",
    "me" : "Whether this user is the requesting user.",
    "photoLink" : "A link to the user's profile photo, if available."
  },
  "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#reply\".",
  "action" : "The action the reply performed to the parent comment. Valid values are:  \n- resolve \n- reopen",
  "createdTime" : "The time at which the reply was created (RFC 3339 date-time).",
  "id" : "The ID of the reply.",
  "content" : "The plain text content of the reply. This field is used for setting the content, while htmlContent should be displayed. This is required on creates if no action is specified.",
  "htmlContent" : "The content of the reply with HTML formatting."
}

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

userIp

Deprecated. Please use quotaUser instead.

Type: string

update_drive

Updates the metadate for a shared drive.

Parameters

driveId (required)

The ID of the shared drive.

Type: string

$body

Representation of a shared drive.

Type: object

{
  "capabilities" : {
    "canDeleteDrive" : "Whether the current user can delete this shared drive. Attempting to delete the shared drive may still fail if there are untrashed items inside the shared drive.",
    "canReadRevisions" : "Whether the current user can read the revisions resource of files in this shared drive.",
    "canEdit" : "Whether the current user can edit files in this shared drive",
    "canShare" : "Whether the current user can share files or folders in this shared drive.",
    "canRename" : "Whether the current user can rename files or folders in this shared drive.",
    "canDeleteChildren" : "Whether the current user can delete children from folders in this shared drive.",
    "canChangeCopyRequiresWriterPermissionRestriction" : "Whether the current user can change the copyRequiresWriterPermission restriction of this shared drive.",
    "canChangeDriveBackground" : "Whether the current user can change the background of this shared drive.",
    "canTrashChildren" : "Whether the current user can trash children from folders in this shared drive.",
    "canAddChildren" : "Whether the current user can add children to folders in this shared drive.",
    "canChangeDriveMembersOnlyRestriction" : "Whether the current user can change the driveMembersOnly restriction of this shared drive.",
    "canListChildren" : "Whether the current user can list the children of folders in this shared drive.",
    "canChangeDomainUsersOnlyRestriction" : "Whether the current user can change the domainUsersOnly restriction of this shared drive.",
    "canManageMembers" : "Whether the current user can add members to this shared drive or remove them or change their role.",
    "canRenameDrive" : "Whether the current user can rename this shared drive.",
    "canCopy" : "Whether the current user can copy files in this shared drive.",
    "canDownload" : "Whether the current user can download files in this shared drive.",
    "canComment" : "Whether the current user can comment on files in this shared drive."
  },
  "backgroundImageFile" : {
    "xCoordinate" : "The X coordinate of the upper left corner of the cropping area in the background image. This is a value in the closed range of 0 to 1. This value represents the horizontal distance from the left side of the entire image to the left side of the cropping area divided by the width of the entire image.",
    "yCoordinate" : "The Y coordinate of the upper left corner of the cropping area in the background image. This is a value in the closed range of 0 to 1. This value represents the vertical distance from the top side of the entire image to the top side of the cropping area divided by the height of the entire image.",
    "width" : "The width of the cropped image in the closed range of 0 to 1. This value represents the width of the cropped image divided by the width of the entire image. The height is computed by applying a width to height aspect ratio of 80 to 9. The resulting image must be at least 1280 pixels wide and 144 pixels high.",
    "id" : "The ID of an image file in Google Drive to use for the background image."
  },
  "hidden" : "Whether the shared drive is hidden from default view.",
  "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#drive\".",
  "backgroundImageLink" : "A short-lived link to this shared drive's background image.",
  "name" : "The name of this shared drive.",
  "createdTime" : "The time at which the shared drive was created (RFC 3339 date-time).",
  "restrictions" : {
    "adminManagedRestrictions" : "Whether administrative privileges on this shared drive are required to modify restrictions.",
    "copyRequiresWriterPermission" : "Whether the options to copy, print, or download files inside this shared drive, should be disabled for readers and commenters. When this restriction is set to true, it will override the similarly named field to true for any file inside this shared drive.",
    "domainUsersOnly" : "Whether access to this shared drive and items inside this shared drive is restricted to users of the domain to which this shared drive belongs. This restriction may be overridden by other sharing policies controlled outside of this shared drive.",
    "driveMembersOnly" : "Whether access to items inside this shared drive is restricted to its members."
  },
  "themeId" : "The ID of the theme from which the background image and color will be set. The set of possible driveThemes can be retrieved from a drive.about.get response. When not specified on a drive.drives.create request, a random theme is chosen from which the background image and color are set. This is a write-only field; it can only be set on requests that don't set colorRgb or backgroundImageFile.",
  "id" : "The ID of this shared drive which is also the ID of the top level folder of this shared drive.",
  "colorRgb" : "The color of this shared drive as an RGB hex string. It can only be set on a drive.drives.update request that does not set themeId."
}

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

useDomainAdminAccess

Issue the request as a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the shared drive belongs.

Type: boolean

userIp

Deprecated. Please use quotaUser instead.

Type: string

update_file_content

Updates a file's content. Only simple uploads are supported. https://developers.google.com/drive/api/v2/reference/files/update

Parameters

fileId (required)

The ID of the file.

Type: string

uploadType (required)

Must be set to 'media'

Type: string

Potential values: media

$body

Type: string

Content-Type

Set to the MIME media type of the object being uploaded.

Type: string

update_file_metadata

Updates a file's metadata and/or content. This method supports patch semantics.

Parameters

fileId (required)

The ID of the file.

Type: string

$body

The metadata for a file.

Type: object

{
  "modifiedTime" : "The last time the file was modified by anyone (RFC 3339 date-time).\nNote that setting modifiedTime will also update modifiedByMeTime for the user.",
  "copyRequiresWriterPermission" : "Whether the options to copy, print, or download this file, should be disabled for readers and commenters.",
  "owners" : [ {
    "permissionId" : "The user's ID as visible in Permission resources.",
    "emailAddress" : "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.",
    "displayName" : "A plain text displayable name for this user.",
    "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#user\".",
    "me" : "Whether this user is the requesting user.",
    "photoLink" : "A link to the user's profile photo, if available."
  } ],
  "mimeType" : "The MIME type of the file.\nGoogle 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.\nIf 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.",
  "contentRestrictions" : [ {
    "reason" : "Reason for why the content of the file is restricted. This is only mutable on requests that also set readOnly=true.",
    "readOnly" : "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.",
    "restrictionTime" : "The time at which the content restriction was set (formatted RFC 3339 timestamp). Only populated if readOnly is true.",
    "type" : "The type of the content restriction. Currently the only possible value is globalContentRestriction.",
    "restrictingUser" : {
      "permissionId" : "The user's ID as visible in Permission resources.",
      "emailAddress" : "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.",
      "displayName" : "A plain text displayable name for this user.",
      "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#user\".",
      "me" : "Whether this user is the requesting user.",
      "photoLink" : "A link to the user's profile photo, if available."
    }
  } ],
  "iconLink" : "A static, unauthenticated link to the file's icon.",
  "starred" : "Whether the user has starred the file.",
  "permissions" : [ {
    "teamDrivePermissionDetails" : [ {
      "role" : "Deprecated - use permissionDetails/role instead.",
      "inherited" : "Deprecated - use permissionDetails/inherited instead.",
      "inheritedFrom" : "Deprecated - use permissionDetails/inheritedFrom instead.",
      "teamDrivePermissionType" : "Deprecated - use permissionDetails/permissionType instead."
    } ],
    "role" : "The role granted by this permission. While new values may be supported in the future, the following are currently allowed:  \n- owner \n- organizer \n- fileOrganizer \n- writer \n- commenter \n- reader",
    "displayName" : "The \"pretty\" name of the value of the permission. The following is a list of examples for each type of permission:  \n- user - User's full name, as defined for their Google account, such as \"Joe Smith.\" \n- group - Name of the Google Group, such as \"The Company Administrators.\" \n- domain - String domain name, such as \"thecompany.com.\" \n- anyone - No displayName is present.",
    "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#permission\".",
    "type" : "The type of the grantee. Valid values are:  \n- user \n- group \n- domain \n- anyone  When creating a permission, if type is user or group, you must provide an emailAddress for the user or group. When type is domain, you must provide a domain. There isn't extra information required for a anyone type.",
    "emailAddress" : "The email address of the user or group to which this permission refers.",
    "view" : "Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value.",
    "deleted" : "Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.",
    "permissionDetails" : [ {
      "permissionType" : "The permission type for this user. While new values may be added in future, the following are currently possible:  \n- file \n- member",
      "role" : "The primary role for this user. While new values may be added in the future, the following are currently possible:  \n- organizer \n- fileOrganizer \n- writer \n- commenter \n- reader",
      "inherited" : "Whether this permission is inherited. This field is always populated. This is an output-only field.",
      "inheritedFrom" : "The ID of the item from which this permission is inherited. This is an output-only field."
    } ],
    "expirationTime" : "The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions:  \n- They can only be set on user and group permissions \n- The time must be in the future \n- The time cannot be more than a year in the future",
    "domain" : "The domain to which this permission refers.",
    "id" : "The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. IDs should be treated as opaque values.",
    "photoLink" : "A link to the user's profile photo, if available.",
    "allowFileDiscovery" : "Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone."
  } ],
  "modifiedByMe" : "Whether the file has been modified by this user.",
  "contentHints" : {
    "thumbnail" : {
      "image" : "The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).",
      "mimeType" : "The MIME type of the thumbnail."
    },
    "indexableText" : "Text to be indexed for the file to improve fullText queries. This is limited to 128KB in length and may contain HTML elements."
  },
  "isAppAuthorized" : "Whether the file was created or opened by the requesting app.",
  "createdTime" : "The time at which the file was created (RFC 3339 date-time).",
  "id" : "The ID of the file.",
  "sharedWithMeTime" : "The time at which the file was shared with the user, if applicable (RFC 3339 date-time).",
  "writersCanShare" : "Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives.",
  "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#file\".",
  "viewersCanCopyContent" : "Deprecated - use copyRequiresWriterPermission instead.",
  "webViewLink" : "A link for opening the file in a relevant Google editor or viewer in a browser.",
  "ownedByMe" : "Whether the user owns the file. Not populated for items in shared drives.",
  "version" : "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.",
  "explicitlyTrashed" : "Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder.",
  "trashedTime" : "The time that the item was trashed (RFC 3339 date-time). Only populated for items in shared drives.",
  "viewedByMe" : "Whether the file has been viewed by this user.",
  "driveId" : "ID of the shared drive the file resides in. Only populated for items in shared drives.",
  "size" : "The size of the file's content in bytes. This is applicable to binary files in Google Drive and Google Docs files.",
  "imageMediaMetadata" : {
    "meteringMode" : "The metering mode used to create the photo.",
    "exposureTime" : "The length of the exposure, in seconds.",
    "whiteBalance" : "The white balance mode used to create the photo.",
    "rotation" : "The number of clockwise 90 degree rotations applied from the image's original orientation.",
    "maxApertureValue" : "The smallest f-number of the lens at the focal length used to create the photo (APEX value).",
    "lens" : "The lens used to create the photo.",
    "exposureBias" : "The exposure bias of the photo (APEX value).",
    "colorSpace" : "The color space of the photo.",
    "aperture" : "The aperture used to create the photo (f-number).",
    "flashUsed" : "Whether a flash was used to create the photo.",
    "subjectDistance" : "The distance to the subject of the photo, in meters.",
    "cameraModel" : "The model of the camera used to create the photo.",
    "width" : "The width of the image in pixels.",
    "isoSpeed" : "The ISO speed used to create the photo.",
    "location" : {
      "altitude" : "The altitude stored in the image.",
      "latitude" : "The latitude stored in the image.",
      "longitude" : "The longitude stored in the image."
    },
    "sensor" : "The type of sensor used to create the photo.",
    "time" : "The date and time the photo was taken (EXIF DateTime).",
    "cameraMake" : "The make of the camera used to create the photo.",
    "exposureMode" : "The exposure mode used to create the photo.",
    "focalLength" : "The focal length used to create the photo, in millimeters.",
    "height" : "The height of the image in pixels."
  },
  "name" : "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.",
  "spaces" : [ "string" ],
  "appProperties" : "A collection of arbitrary key-value pairs which are private to the requesting app.\nEntries with null values are cleared in update and copy requests. These properties can only be retrieved using an authenticated request. An authenticated request uses an access token obtained with a OAuth 2 client ID. You cannot use an API key to retrieve private properties.",
  "folderColorRgb" : "The color for a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource.\nIf an unsupported color is specified, the closest color in the palette will be used instead.",
  "headRevisionId" : "The ID of the file's head revision. This is currently only available for files with binary content in Google Drive.",
  "parents" : [ "string" ],
  "teamDriveId" : "Deprecated - use driveId instead.",
  "trashed" : "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.",
  "modifiedByMeTime" : "The last time the file was modified by the user (RFC 3339 date-time).",
  "shared" : "Whether the file has been shared. Not populated for items in shared drives.",
  "hasAugmentedPermissions" : "Whether there are permissions directly on this file. This field is only populated for items in shared drives.",
  "description" : "A short description of the file.",
  "trashingUser" : {
    "permissionId" : "The user's ID as visible in Permission resources.",
    "emailAddress" : "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.",
    "displayName" : "A plain text displayable name for this user.",
    "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#user\".",
    "me" : "Whether this user is the requesting user.",
    "photoLink" : "A link to the user's profile photo, if available."
  },
  "permissionIds" : [ "string" ],
  "thumbnailLink" : "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. If the file isn't shared publicly, the URL returned in Files.thumbnailLink must be fetched using a credentialed request.",
  "quotaBytesUsed" : "The number of storage quota bytes used by the file. This includes the head revision as well as previous revisions with keepForever enabled.",
  "lastModifyingUser" : {
    "permissionId" : "The user's ID as visible in Permission resources.",
    "emailAddress" : "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.",
    "displayName" : "A plain text displayable name for this user.",
    "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#user\".",
    "me" : "Whether this user is the requesting user.",
    "photoLink" : "A link to the user's profile photo, if available."
  },
  "md5Checksum" : "The MD5 checksum for the content of the file. This is only applicable to files with binary content in Google Drive.",
  "fileExtension" : "The final component of fullFileExtension. This is only available for files with binary content in Google Drive.",
  "fullFileExtension" : "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.\nThis is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.",
  "webContentLink" : "A link for downloading the content of the file in a browser. This is only available for files with binary content in Google Drive.",
  "shortcutDetails" : {
    "targetId" : "The ID of the file that this shortcut points to.",
    "targetMimeType" : "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" : {
    "canReadRevisions" : "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.",
    "canMoveItemOutOfDrive" : "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.",
    "canEdit" : "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.",
    "canRename" : "Whether the current user can rename this file.",
    "canAddMyDriveParent" : "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.",
    "canMoveChildrenWithinTeamDrive" : "Deprecated - use canMoveChildrenWithinDrive instead.",
    "canTrashChildren" : "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.",
    "canAddChildren" : "Whether the current user can add children to this folder. This is always false when the item is not a folder.",
    "canListChildren" : "Whether the current user can list the children of this folder. This is always false when the item is not a folder.",
    "canTrash" : "Whether the current user can move this file to trash.",
    "canMoveItemIntoTeamDrive" : "Deprecated - use canMoveItemOutOfDrive instead.",
    "canRemoveMyDriveParent" : "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.",
    "canCopy" : "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.",
    "canDownload" : "Whether the current user can download this file.",
    "canDelete" : "Whether the current user can delete this file.",
    "canAddFolderFromAnotherDrive" : "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.",
    "canComment" : "Whether the current user can comment on this file.",
    "canUntrash" : "Whether the current user can restore this file from trash.",
    "canMoveItemOutOfTeamDrive" : "Deprecated - use canMoveItemOutOfDrive instead.",
    "canMoveChildrenWithinDrive" : "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.",
    "canModifyContentRestriction" : "Whether the current user can modify restrictions on content of this file.",
    "canMoveTeamDriveItem" : "Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead.",
    "canChangeCopyRequiresWriterPermission" : "Whether the current user can change the copyRequiresWriterPermission restriction of this file.",
    "canMoveChildrenOutOfDrive" : "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.",
    "canReadDrive" : "Whether the current user can read the shared drive to which this file belongs. Only populated for items in shared drives.",
    "canShare" : "Whether the current user can modify the sharing settings for this file.",
    "canDeleteChildren" : "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.",
    "canMoveItemWithinDrive" : "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.",
    "canMoveChildrenOutOfTeamDrive" : "Deprecated - use canMoveChildrenOutOfDrive instead.",
    "canMoveItemWithinTeamDrive" : "Deprecated - use canMoveItemWithinDrive instead.",
    "canModifyContent" : "Whether the current user can modify the content of this file.",
    "canRemoveChildren" : "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.",
    "canChangeViewersCanCopyContent" : "Deprecated",
    "canReadTeamDrive" : "Deprecated - use canReadDrive instead."
  },
  "hasThumbnail" : "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.",
  "viewedByMeTime" : "The last time the file was viewed by the user (RFC 3339 date-time).",
  "videoMediaMetadata" : {
    "width" : "The width of the video in pixels.",
    "durationMillis" : "The duration of the video in milliseconds.",
    "height" : "The height of the video in pixels."
  },
  "exportLinks" : "Links for exporting Docs Editors files to specific formats.",
  "thumbnailVersion" : "The thumbnail version for use in thumbnail cache invalidation.",
  "sharingUser" : {
    "permissionId" : "The user's ID as visible in Permission resources.",
    "emailAddress" : "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.",
    "displayName" : "A plain text displayable name for this user.",
    "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#user\".",
    "me" : "Whether this user is the requesting user.",
    "photoLink" : "A link to the user's profile photo, if available."
  },
  "originalFilename" : "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.",
  "properties" : "A collection of arbitrary key-value pairs which are visible to all apps.\nEntries with null values are cleared in update and copy requests."
}

addParents

A comma-separated list of parent IDs to add.

Type: string

alt

Data format for the response.

Type: string

Potential values: json

enforceSingleParent

Deprecated. Adding files to multiple folders is no longer supported. Use shortcuts instead.

Type: boolean

fields

Selector specifying which fields to include in a partial response.

Type: string

includePermissionsForView

Specifies which additional view's permissions to include in the response. Only 'published' is supported.

Type: string

keepRevisionForever

Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Google Drive. Only 200 revisions for the file can be kept forever. If the limit is reached, try deleting pinned revisions.

Type: boolean

oauth_token

OAuth 2.0 token for the current user.

Type: string

ocrLanguage

A language hint for OCR processing during image import (ISO 639-1 code).

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

removeParents

A comma-separated list of parent IDs to remove.

Type: string

supportsAllDrives

Whether the requesting application supports both My Drives and shared drives.

Type: boolean

supportsTeamDrives

Deprecated use supportsAllDrives instead.

Type: boolean

useContentAsIndexableText

Whether to use the uploaded content as indexable text.

Type: boolean

userIp

Deprecated. Please use quotaUser instead.

Type: string

update_permission

Updates a permission with patch semantics.

Parameters

fileId (required)

The ID of the file or shared drive.

Type: string

permissionId (required)

The ID of the permission.

Type: string

$body

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

Type: object

{
  "teamDrivePermissionDetails" : [ {
    "role" : "Deprecated - use permissionDetails/role instead.",
    "inherited" : "Deprecated - use permissionDetails/inherited instead.",
    "inheritedFrom" : "Deprecated - use permissionDetails/inheritedFrom instead.",
    "teamDrivePermissionType" : "Deprecated - use permissionDetails/permissionType instead."
  } ],
  "role" : "The role granted by this permission. While new values may be supported in the future, the following are currently allowed:  \n- owner \n- organizer \n- fileOrganizer \n- writer \n- commenter \n- reader",
  "displayName" : "The \"pretty\" name of the value of the permission. The following is a list of examples for each type of permission:  \n- user - User's full name, as defined for their Google account, such as \"Joe Smith.\" \n- group - Name of the Google Group, such as \"The Company Administrators.\" \n- domain - String domain name, such as \"thecompany.com.\" \n- anyone - No displayName is present.",
  "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#permission\".",
  "type" : "The type of the grantee. Valid values are:  \n- user \n- group \n- domain \n- anyone  When creating a permission, if type is user or group, you must provide an emailAddress for the user or group. When type is domain, you must provide a domain. There isn't extra information required for a anyone type.",
  "emailAddress" : "The email address of the user or group to which this permission refers.",
  "view" : "Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value.",
  "deleted" : "Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.",
  "permissionDetails" : [ {
    "permissionType" : "The permission type for this user. While new values may be added in future, the following are currently possible:  \n- file \n- member",
    "role" : "The primary role for this user. While new values may be added in the future, the following are currently possible:  \n- organizer \n- fileOrganizer \n- writer \n- commenter \n- reader",
    "inherited" : "Whether this permission is inherited. This field is always populated. This is an output-only field.",
    "inheritedFrom" : "The ID of the item from which this permission is inherited. This is an output-only field."
  } ],
  "expirationTime" : "The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions:  \n- They can only be set on user and group permissions \n- The time must be in the future \n- The time cannot be more than a year in the future",
  "domain" : "The domain to which this permission refers.",
  "id" : "The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. IDs should be treated as opaque values.",
  "photoLink" : "A link to the user's profile photo, if available.",
  "allowFileDiscovery" : "Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone."
}

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

removeExpiration

Whether to remove the expiration date.

Type: boolean

supportsAllDrives

Whether the requesting application supports both My Drives and shared drives.

Type: boolean

supportsTeamDrives

Deprecated use supportsAllDrives instead.

Type: boolean

transferOwnership

Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of the side effect.

Type: boolean

useDomainAdminAccess

Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.

Type: boolean

userIp

Deprecated. Please use quotaUser instead.

Type: string

update_revision

Updates a revision with patch semantics.

Parameters

fileId (required)

The ID of the file.

Type: string

revisionId (required)

The ID of the revision.

Type: string

$body

The metadata for a revision to a file.

Type: object

{
  "modifiedTime" : "The last time the revision was modified (RFC 3339 date-time).",
  "publishedLink" : "A link to the published revision. This is only populated for Google Sites files.",
  "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#revision\".",
  "keepForever" : "Whether to keep this revision forever, even if it is no longer the head revision. If not set, the revision will be automatically purged 30 days after newer content is uploaded. This can be set on a maximum of 200 revisions for a file.\nThis field is only applicable to files with binary content in Drive.",
  "publishAuto" : "Whether subsequent revisions will be automatically republished. This is only applicable to Docs Editors files.",
  "mimeType" : "The MIME type of the revision.",
  "published" : "Whether this revision is published. This is only applicable to Docs Editors files.",
  "lastModifyingUser" : {
    "permissionId" : "The user's ID as visible in Permission resources.",
    "emailAddress" : "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.",
    "displayName" : "A plain text displayable name for this user.",
    "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#user\".",
    "me" : "Whether this user is the requesting user.",
    "photoLink" : "A link to the user's profile photo, if available."
  },
  "md5Checksum" : "The MD5 checksum of the revision's content. This is only applicable to files with binary content in Drive.",
  "size" : "The size of the revision's content in bytes. This is only applicable to files with binary content in Drive.",
  "exportLinks" : "Links for exporting Docs Editors files to specific formats.",
  "publishedOutsideDomain" : "Whether this revision is published outside the domain. This is only applicable to Docs Editors files.",
  "id" : "The ID of the revision.",
  "originalFilename" : "The original filename used to create this revision. This is only applicable to files with binary content in Drive."
}

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

userIp

Deprecated. Please use quotaUser instead.

Type: string

update_team_drive

Deprecated use drives.update instead

Parameters

teamDriveId (required)

The ID of the Team Drive

Type: string

$body

Deprecated: use the drive collection instead.

Type: object

{
  "capabilities" : {
    "canChangeTeamDriveBackground" : "Whether the current user can change the background of this Team Drive.",
    "canReadRevisions" : "Whether the current user can read the revisions resource of files in this Team Drive.",
    "canDeleteTeamDrive" : "Whether the current user can delete this Team Drive. Attempting to delete the Team Drive may still fail if there are untrashed items inside the Team Drive.",
    "canEdit" : "Whether the current user can edit files in this Team Drive",
    "canShare" : "Whether the current user can share files or folders in this Team Drive.",
    "canRename" : "Whether the current user can rename files or folders in this Team Drive.",
    "canDeleteChildren" : "Whether the current user can delete children from folders in this Team Drive.",
    "canChangeCopyRequiresWriterPermissionRestriction" : "Whether the current user can change the copyRequiresWriterPermission restriction of this Team Drive.",
    "canTrashChildren" : "Whether the current user can trash children from folders in this Team Drive.",
    "canRenameTeamDrive" : "Whether the current user can rename this Team Drive.",
    "canAddChildren" : "Whether the current user can add children to folders in this Team Drive.",
    "canChangeTeamMembersOnlyRestriction" : "Whether the current user can change the teamMembersOnly restriction of this Team Drive.",
    "canListChildren" : "Whether the current user can list the children of folders in this Team Drive.",
    "canChangeDomainUsersOnlyRestriction" : "Whether the current user can change the domainUsersOnly restriction of this Team Drive.",
    "canManageMembers" : "Whether the current user can add members to this Team Drive or remove them or change their role.",
    "canRemoveChildren" : "Deprecated - use canDeleteChildren or canTrashChildren instead.",
    "canCopy" : "Whether the current user can copy files in this Team Drive.",
    "canDownload" : "Whether the current user can download files in this Team Drive.",
    "canComment" : "Whether the current user can comment on files in this Team Drive."
  },
  "backgroundImageFile" : {
    "xCoordinate" : "The X coordinate of the upper left corner of the cropping area in the background image. This is a value in the closed range of 0 to 1. This value represents the horizontal distance from the left side of the entire image to the left side of the cropping area divided by the width of the entire image.",
    "yCoordinate" : "The Y coordinate of the upper left corner of the cropping area in the background image. This is a value in the closed range of 0 to 1. This value represents the vertical distance from the top side of the entire image to the top side of the cropping area divided by the height of the entire image.",
    "width" : "The width of the cropped image in the closed range of 0 to 1. This value represents the width of the cropped image divided by the width of the entire image. The height is computed by applying a width to height aspect ratio of 80 to 9. The resulting image must be at least 1280 pixels wide and 144 pixels high.",
    "id" : "The ID of an image file in Drive to use for the background image."
  },
  "kind" : "Identifies what kind of resource this is. Value: the fixed string \"drive#teamDrive\".",
  "backgroundImageLink" : "A short-lived link to this Team Drive's background image.",
  "name" : "The name of this Team Drive.",
  "createdTime" : "The time at which the Team Drive was created (RFC 3339 date-time).",
  "restrictions" : {
    "adminManagedRestrictions" : "Whether administrative privileges on this Team Drive are required to modify restrictions.",
    "copyRequiresWriterPermission" : "Whether the options to copy, print, or download files inside this Team Drive, should be disabled for readers and commenters. When this restriction is set to true, it will override the similarly named field to true for any file inside this Team Drive.",
    "domainUsersOnly" : "Whether access to this Team Drive and items inside this Team Drive is restricted to users of the domain to which this Team Drive belongs. This restriction may be overridden by other sharing policies controlled outside of this Team Drive.",
    "teamMembersOnly" : "Whether access to items inside this Team Drive is restricted to members of this Team Drive."
  },
  "themeId" : "The ID of the theme from which the background image and color will be set. The set of possible teamDriveThemes can be retrieved from a drive.about.get response. When not specified on a drive.teamdrives.create request, a random theme is chosen from which the background image and color are set. This is a write-only field; it can only be set on requests that don't set colorRgb or backgroundImageFile.",
  "id" : "The ID of this Team Drive which is also the ID of the top level folder of this Team Drive.",
  "colorRgb" : "The color of this Team Drive as an RGB hex string. It can only be set on a drive.teamdrives.update request that does not set themeId."
}

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

useDomainAdminAccess

Issue the request as a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the Team Drive belongs.

Type: boolean

userIp

Deprecated. Please use quotaUser instead.

Type: string

watch_changes

Subscribes to changes for a user.

Parameters

pageToken (required)

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 or to the response from the getStartPageToken method.

Type: string

$body

An notification channel used to watch for resource changes.

Type: object

{
  "resourceId" : "An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.",
  "address" : "The address where notifications are delivered for this channel.",
  "payload" : "A Boolean value to indicate whether payload is wanted. Optional.",
  "kind" : "Identifies this as a notification channel used to watch for changes to a resource, which is \"api#channel\".",
  "expiration" : "Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.",
  "id" : "A UUID or similar unique string that identifies this channel.",
  "resourceUri" : "A version-specific identifier for the watched resource.",
  "params" : "Additional parameters controlling delivery channel behavior. Optional.",
  "type" : "The type of delivery mechanism used for this channel. Valid values are \"web_hook\" (or \"webhook\"). Both values refer to a channel where Http requests are used to deliver messages.",
  "token" : "An arbitrary string delivered to the target address with each notification delivered over this channel. Optional."
}

alt

Data format for the response.

Type: string

Potential values: json

driveId

The shared drive from which changes are returned. If specified the change IDs will be reflective of the shared drive; use the combined drive ID and change ID as an identifier.

Type: string

fields

Selector specifying which fields to include in a partial response.

Type: string

includeCorpusRemovals

Whether changes should include the file resource if the file is still accessible by the user at the time of the request, even when a file was removed from the list of changes and there will be no further change entries for this file.

Type: boolean

includeItemsFromAllDrives

Whether both My Drive and shared drive items should be included in results.

Type: boolean

includePermissionsForView

Specifies which additional view's permissions to include in the response. Only 'published' is supported.

Type: string

includeRemoved

Whether to include changes indicating that items have been removed from the list of changes, for example by deletion or loss of access.

Type: boolean

includeTeamDriveItems

Deprecated use includeItemsFromAllDrives instead.

Type: boolean

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

restrictToMyDrive

Whether to restrict the results to changes inside the My Drive hierarchy. This omits changes to files such as those in the Application Data folder or shared files which have not been added to My Drive.

Type: boolean

spaces

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

Type: string

supportsAllDrives

Whether the requesting application supports both My Drives and shared drives.

Type: boolean

supportsTeamDrives

Deprecated use supportsAllDrives instead.

Type: boolean

teamDriveId

Deprecated use driveId instead.

Type: string

userIp

Deprecated. Please use quotaUser instead.

Type: string

watch_drive_files

Subscribes to changes to a file

Parameters

fileId (required)

The ID of the file.

Type: string

$body

An notification channel used to watch for resource changes.

Type: object

{
  "resourceId" : "An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.",
  "address" : "The address where notifications are delivered for this channel.",
  "payload" : "A Boolean value to indicate whether payload is wanted. Optional.",
  "kind" : "Identifies this as a notification channel used to watch for changes to a resource, which is \"api#channel\".",
  "expiration" : "Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.",
  "id" : "A UUID or similar unique string that identifies this channel.",
  "resourceUri" : "A version-specific identifier for the watched resource.",
  "params" : "Additional parameters controlling delivery channel behavior. Optional.",
  "type" : "The type of delivery mechanism used for this channel. Valid values are \"web_hook\" (or \"webhook\"). Both values refer to a channel where Http requests are used to deliver messages.",
  "token" : "An arbitrary string delivered to the target address with each notification delivered over this channel. Optional."
}

acknowledgeAbuse

Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.

Type: boolean

alt

Data format for the response.

Type: string

Potential values: json

fields

Selector specifying which fields to include in a partial response.

Type: string

includePermissionsForView

Specifies which additional view's permissions to include in the response. Only 'published' is supported.

Type: string

prettyPrint

Returns response with indentations and line breaks.

Type: boolean

quotaUser

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Type: string

supportsAllDrives

Whether the requesting application supports both My Drives and shared drives.

Type: boolean

supportsTeamDrives

Deprecated use supportsAllDrives instead.

Type: boolean

userIp

Deprecated. Please use quotaUser instead.

Type: string