Method: files.download

Downloads content of a file. Operations are valid for 24 hours from the time of creation.

HTTP request

POST https://www.googleapis.com/drive/v3/files/{fileId}/download

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
fileId

string

Required. The ID of the file to download.

Query parameters

Parameters
mimeType

string

Optional. The MIME type the file should be downloaded as. This field can only be set when downloading Google Workspace documents. See files.export MIME types for Google Workspace documents for the list of supported MIME types. If not set, a Google Workspace document is downloaded with a default MIME type. The default MIME type might change in the future.

revisionId

string

Optional. The revision ID of the file to download. This field can only be set when downloading blob files, Google Docs, and Google Sheets. Returns INVALID_ARGUMENT if downloading a specific revision on the file is unsupported.

Request body

The request body must be empty.

Response body

If successful, the response body contains an instance of Operation.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/drive
  • https://www.googleapis.com/auth/drive.file
  • https://www.googleapis.com/auth/drive.readonly

Some scopes are restricted and require a security assessment for your app to use them. For more information, see the Authorization guide.