Create
|
|||||
|
|
Creates a new draft with the DRAFT label
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
Input
This building block consumes 26 input parameters
Name | Format | Description |
---|---|---|
userId Required |
STRING |
The user's email address. The special value me can be used to indicate the authenticated user |
id |
STRING |
The immutable ID of the draft |
message |
OBJECT |
An email message |
message.historyId |
INTEGER |
The ID of the last history record that modified this message |
message.id |
STRING |
The immutable ID of the message |
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 |
message.labelIds[] |
STRING |
|
message.payload |
OBJECT |
A single MIME message part |
message.payload.body |
OBJECT |
The body of a single MIME message part |
message.payload.body.attachmentId |
STRING |
When present, contains the ID of an external attachment that can be retrieved in a separate messages.attachments.get request. When not present, the entire content of the message part body is contained in the data field |
message.payload.body.data |
BINARY |
The body data of a MIME message part as a base64url encoded string. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment |
message.payload.body.size |
INTEGER |
Number of bytes for the message part data (encoding notwithstanding) |
message.payload.filename |
STRING |
The filename of the attachment. Only present if this message part represents an attachment |
message.payload.headers[] |
OBJECT |
|
message.payload.headers[].name |
STRING |
The name of the header before the : separator. For example, To |
message.payload.headers[].value |
STRING |
The value of the header after the : separator. For example, [email protected] |
message.payload.mimeType |
STRING |
The MIME type of the message part |
message.payload.partId |
STRING |
The immutable ID of the message part |
message.payload.parts[] |
OBJECT |
A single MIME message part |
message.payload.parts[].filename |
STRING |
The filename of the attachment. Only present if this message part represents an attachment |
message.payload.parts[].mimeType |
STRING |
The MIME type of the message part |
message.payload.parts[].partId |
STRING |
The immutable ID of the message part |
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 |
message.sizeEstimate |
INTEGER |
Estimated size in bytes of the message |
message.snippet |
STRING |
A short part of the message text |
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:
|
= Parameter name
= Format
userId STRING Required The user's email address. The special value me can be used to indicate the authenticated user |
id STRING The immutable ID of the draft |
message OBJECT An email message |
message.historyId INTEGER The ID of the last history record that modified this message |
message.id STRING The immutable ID of the message |
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 |
message.labelIds[] STRING |
message.payload OBJECT A single MIME message part |
message.payload.body OBJECT The body of a single MIME message part |
message.payload.body.attachmentId STRING When present, contains the ID of an external attachment that can be retrieved in a separate messages.attachments.get request. When not present, the entire content of the message part body is contained in the data field |
message.payload.body.data BINARY The body data of a MIME message part as a base64url encoded string. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment |
message.payload.body.size INTEGER Number of bytes for the message part data (encoding notwithstanding) |
message.payload.filename STRING The filename of the attachment. Only present if this message part represents an attachment |
message.payload.headers[] OBJECT |
message.payload.headers[].name STRING The name of the header before the : separator. For example, To |
message.payload.headers[].value STRING The value of the header after the : separator. For example, [email protected] |
message.payload.mimeType STRING The MIME type of the message part |
message.payload.partId STRING The immutable ID of the message part |
message.payload.parts[] OBJECT A single MIME message part |
message.payload.parts[].filename STRING The filename of the attachment. Only present if this message part represents an attachment |
message.payload.parts[].mimeType STRING The MIME type of the message part |
message.payload.parts[].partId STRING The immutable ID of the message part |
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 |
message.sizeEstimate INTEGER Estimated size in bytes of the message |
message.snippet STRING A short part of the message text |
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:
|
Output
This building block provides 25 output parameters
Name | Format | Description |
---|---|---|
id |
STRING |
The immutable ID of the draft |
message |
OBJECT |
An email message |
message.historyId |
INTEGER |
The ID of the last history record that modified this message |
message.id |
STRING |
The immutable ID of the message |
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 |
message.labelIds[] |
STRING |
|
message.payload |
OBJECT |
A single MIME message part |
message.payload.body |
OBJECT |
The body of a single MIME message part |
message.payload.body.attachmentId |
STRING |
When present, contains the ID of an external attachment that can be retrieved in a separate messages.attachments.get request. When not present, the entire content of the message part body is contained in the data field |
message.payload.body.data |
BINARY |
The body data of a MIME message part as a base64url encoded string. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment |
message.payload.body.size |
INTEGER |
Number of bytes for the message part data (encoding notwithstanding) |
message.payload.filename |
STRING |
The filename of the attachment. Only present if this message part represents an attachment |
message.payload.headers[] |
OBJECT |
|
message.payload.headers[].name |
STRING |
The name of the header before the : separator. For example, To |
message.payload.headers[].value |
STRING |
The value of the header after the : separator. For example, [email protected] |
message.payload.mimeType |
STRING |
The MIME type of the message part |
message.payload.partId |
STRING |
The immutable ID of the message part |
message.payload.parts[] |
OBJECT |
A single MIME message part |
message.payload.parts[].filename |
STRING |
The filename of the attachment. Only present if this message part represents an attachment |
message.payload.parts[].mimeType |
STRING |
The MIME type of the message part |
message.payload.parts[].partId |
STRING |
The immutable ID of the message part |
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 |
message.sizeEstimate |
INTEGER |
Estimated size in bytes of the message |
message.snippet |
STRING |
A short part of the message text |
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:
|
= Parameter name
= Format
id STRING The immutable ID of the draft |
message OBJECT An email message |
message.historyId INTEGER The ID of the last history record that modified this message |
message.id STRING The immutable ID of the message |
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 |
message.labelIds[] STRING |
message.payload OBJECT A single MIME message part |
message.payload.body OBJECT The body of a single MIME message part |
message.payload.body.attachmentId STRING When present, contains the ID of an external attachment that can be retrieved in a separate messages.attachments.get request. When not present, the entire content of the message part body is contained in the data field |
message.payload.body.data BINARY The body data of a MIME message part as a base64url encoded string. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment |
message.payload.body.size INTEGER Number of bytes for the message part data (encoding notwithstanding) |
message.payload.filename STRING The filename of the attachment. Only present if this message part represents an attachment |
message.payload.headers[] OBJECT |
message.payload.headers[].name STRING The name of the header before the : separator. For example, To |
message.payload.headers[].value STRING The value of the header after the : separator. For example, [email protected] |
message.payload.mimeType STRING The MIME type of the message part |
message.payload.partId STRING The immutable ID of the message part |
message.payload.parts[] OBJECT A single MIME message part |
message.payload.parts[].filename STRING The filename of the attachment. Only present if this message part represents an attachment |
message.payload.parts[].mimeType STRING The MIME type of the message part |
message.payload.parts[].partId STRING The immutable ID of the message part |
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 |
message.sizeEstimate INTEGER Estimated size in bytes of the message |
message.snippet STRING A short part of the message text |
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:
|