
The most straightforward method for uploading a file is by making a simple upload request. POST /gmail/v1/users/ userId/messages/send You can use this URI when creating or updating metadata values. If the resource contains anyĭata fields, those fields are used to store metadata describing the uploadedįile. The standard resource URI, for the metadata. Use this URI whenĮxample: POST /upload/gmail/v1/users/ userId/messages/send Standard resource URI with an “/upload” prefix. In fact, methods that support media uploads have two URI endpoints: When you upload media, you use a special URI. This is a good strategy to use for most applications, since it also works for smaller files at the cost of one additional HTTP request per upload. With this method, you use a session initiating request, which optionally can include metadata. For reliable transfer, especially important with larger files.
Resumable upload: uploadType=resumable. For quick transfer of smaller files and metadata transfers the file along with metadata that describes it, all in a single request. Multipart upload: uploadType=multipart. For quick transfer of smaller files, for example, 5 MB or less. Specify the method you are using with the uploadType request parameter. You can make upload requests in any of the following ways. Accepted media MIME types: The types of binary data you can store using this method. Maximum upload file size: The maximum amount of data you can store with this method. The specific characteristics of the data you can upload are specified on the reference page for any method that supports media uploads: The Gmail API allows you to upload certain types of binary data, or media. The Gmail API allows you to upload file data when creating or updating a draft or when inserting or sending a message.