List

Lists the drafts in the user's mailbox

5 variables
17 variables

Lists the drafts in the user's mailbox

Authorization

To use this building block you will have to grant access to at least one of the following scopes:

  • Read, compose, send, and permanently delete all your email from Gmail
  • Manage drafts and send emails
  • View and modify but not delete your email
  • View your email messages and settings

Input

This building block consumes 5 input parameters

  = Parameter name
  = Format

userId STRING Required

The user's email address. The special value me can be used to indicate the authenticated user

includeSpamTrash BOOLEAN

Include drafts from SPAM and TRASH in the results

maxResults INTEGER

Maximum number of drafts to return

pageToken STRING

Page token to retrieve a specific page of results in the list

q STRING

Only return draft messages matching the specified query. Supports the same query format as the Gmail search box. For example, "from:[email protected] rfc822msgid: is:unread"

Output

This building block provides 17 output parameters

  = Parameter name
  = Format

drafts[] OBJECT

A draft email in the user's mailbox

drafts[].id STRING

The immutable ID of the draft

drafts[].message OBJECT

An email message

drafts[].message.historyId INTEGER

The ID of the last history record that modified this message

drafts[].message.id STRING

The immutable ID of the message

drafts[].message.internalDate INTEGER

The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header

drafts[].message.labelIds[] STRING

drafts[].message.payload OBJECT

A single MIME message part

drafts[].message.payload.filename STRING

The filename of the attachment. Only present if this message part represents an attachment

drafts[].message.payload.mimeType STRING

The MIME type of the message part

drafts[].message.payload.partId STRING

The immutable ID of the message part

drafts[].message.raw BINARY

The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied

drafts[].message.sizeEstimate INTEGER

Estimated size in bytes of the message

drafts[].message.snippet STRING

A short part of the message text

drafts[].message.threadId STRING

The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met:

  • The requested threadId must be specified on the Message or Draft.Message you supply with your request.
  • The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
  • The Subject headers must match.

nextPageToken STRING

Token to retrieve the next page of results in the list

resultSizeEstimate INTEGER

Estimated total number of results