Downloads uploaded media, but not Google Drive files. Download is supported on the URI /v1/media/{+name}?alt=media. To export bytes from a Google Drive file, see the files.export method in Google Drive.

HTTP request


The URL uses gRPC Transcoding syntax.

Path parameters



Name of the media that you are downloading. For more information, see spaces.messages.attachments.attachmentDataRef.

Request body

The request body must be empty.

Response body

If successful, this method returns the file content as bytes.

To download only part of a file, use the Range header with a byte range. For example: Range: bytes=500-999.

Authorization scopes

Requires one of the following OAuth scopes:


For more information, see the Authorization guide.