Guide to Drive API v2

Stay organized with collections Save and categorize content based on your preferences.

If you use Google Drive API version 2, most of the content in the Google Drive API Guide v3 pertains to v2 as well. This section contains all of the information that is v2-specific, and different from what is shown in specific pages of the v3 guide. To get full context, each sub-section contains the link to the corresponding guide page.

For a complete list of differences, see V2 to v3 reference.

Download and publish file revisions

On the Download and publish file revisions page, the following information is specific to v2, and replaces these sections shown for v3:

List and download individual revisions

Once you get a list of a file's revisions, you can download the content of any revision by sending an authorized GET request to its downloadUrl property. Google Drive generates this short-lived URL when you request the revision — don't rely on it for later use.

You can also export the revision in one of the supported formats by checking the exportLinks property.

Custom file properties

In addition to the information on the Custom file properties page, the following information is specific to v2:

Properties are accessed using the properties resource.

This is the structure of a typical property that might be used to store your database's ID for a Drive file on the file itself.

{
  'key':        'additionalID',
  'value':      '8e8aceg2af2ge72e78',
  'visibility': 'PRIVATE'
}

For more information about usage limits, see properties in the reference documentation.

Enable shared drive support

In addition to the information on the Enable shared drive support page, replace this additional field trashedDate for v2.

In Enable shared drive support, the following methods require supportsAllDrives=true when working with shared drives content:

  • files.get
  • files.list
  • files.insert
  • files.update
  • files.patch
  • files.copy
  • files.trash
  • files.untrash
  • files.delete
  • files.touch
  • children.insert
  • parents.insert
  • changes.list
  • changes.getStartPageToken
  • changes.get
  • permissions.list
  • permissions.get
  • permissions.insert
  • permissions.update
  • permissions.patch
  • permissions.delete

The changes.get and changes.list methods have several parameters specific to shared drives: See Track changes on a shared drive section for a list of parameters.

Upload files

On the Upload files page, notice this information is specific to v2:

Import to Google Docs types

When you create a file in Google Drive, you can convert some types file into a Google Docs, Sheets or Slides document. Include the convert query parameters and set the mimeType property of the file. See Upload files for context and more information.

Share files, folders and drives

Notice on the Share files, folders and drives page, in v3 only one field, role, specifies effective roles for user, group, or domain. In v2, you need both role and additionalRoles fields of a permission reflect the effective roles the user, group, or domain have for a given item.

Search query differences for v2

The v2 title field is name in v3. For examples, see Search for files and folders.

The v2 createdDate field is createdTime in v3. For examples, see Search for shared drives.

The v2 modifiedDate field is modifiedTime in v3. The v2 lastViewedByMeDate field is viewedByMeTime in v3. For more details, see Search query terms.