1<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5  margin: 0;
6  padding: 0;
7  border: 0;
8  font-weight: inherit;
9  font-style: inherit;
10  font-size: 100%;
11  font-family: inherit;
12  vertical-align: baseline;
13}
14
15body {
16  font-size: 13px;
17  padding: 1em;
18}
19
20h1 {
21  font-size: 26px;
22  margin-bottom: 1em;
23}
24
25h2 {
26  font-size: 24px;
27  margin-bottom: 1em;
28}
29
30h3 {
31  font-size: 20px;
32  margin-bottom: 1em;
33  margin-top: 1em;
34}
35
36pre, code {
37  line-height: 1.5;
38  font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42  margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46  font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50  border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54  margin-top: 0.5em;
55}
56
57.firstline {
58  margin-left: 2 em;
59}
60
61.method  {
62  margin-top: 1em;
63  border: solid 1px #CCC;
64  padding: 1em;
65  background: #EEE;
66}
67
68.details {
69  font-weight: bold;
70  font-size: 14px;
71}
72
73</style>
74
75<h1><a href="gmail_v1.html">Gmail API</a> . <a href="gmail_v1.users.html">users</a> . <a href="gmail_v1.users.drafts.html">drafts</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78  <code><a href="#create">create(userId, body=None, media_body=None, media_mime_type=None)</a></code></p>
79<p class="firstline">Creates a new draft with the DRAFT label.</p>
80<p class="toc_element">
81  <code><a href="#delete">delete(userId, id)</a></code></p>
82<p class="firstline">Immediately and permanently deletes the specified draft. Does not simply trash it.</p>
83<p class="toc_element">
84  <code><a href="#get">get(userId, id, format=None)</a></code></p>
85<p class="firstline">Gets the specified draft.</p>
86<p class="toc_element">
87  <code><a href="#list">list(userId, q=None, pageToken=None, maxResults=None, includeSpamTrash=None)</a></code></p>
88<p class="firstline">Lists the drafts in the user's mailbox.</p>
89<p class="toc_element">
90  <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
91<p class="firstline">Retrieves the next page of results.</p>
92<p class="toc_element">
93  <code><a href="#send">send(userId, body=None, media_body=None, media_mime_type=None)</a></code></p>
94<p class="firstline">Sends the specified, existing draft to the recipients in the To, Cc, and Bcc headers.</p>
95<p class="toc_element">
96  <code><a href="#update">update(userId, id, body=None, media_body=None, media_mime_type=None)</a></code></p>
97<p class="firstline">Replaces a draft's content.</p>
98<h3>Method Details</h3>
99<div class="method">
100    <code class="details" id="create">create(userId, body=None, media_body=None, media_mime_type=None)</code>
101  <pre>Creates a new draft with the DRAFT label.
102
103Args:
104  userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
105  body: object, The request body.
106    The object takes the form of:
107
108{ # A draft email in the user's mailbox.
109  "message": { # An email message. # The message content of the draft.
110    "internalDate": "A String", # 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.
111    "historyId": "A String", # The ID of the last history record that modified this message.
112    "payload": { # A single MIME message part. # The parsed email structure in the message parts.
113      "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for container MIME message parts.
114        "data": "A String", # 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.
115        "attachmentId": "A 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.
116        "size": 42, # Number of bytes for the message part data (encoding notwithstanding).
117      },
118      "mimeType": "A String", # The MIME type of the message part.
119      "partId": "A String", # The immutable ID of the message part.
120      "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
121      "headers": [ # List of headers on this message part. For the top-level message part, representing the entire message payload, it will contain the standard RFC 2822 email headers such as To, From, and Subject.
122        {
123          "name": "A String", # The name of the header before the : separator. For example, To.
124          "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
125        },
126      ],
127      "parts": [ # The child MIME message parts of this part. This only applies to container MIME message parts, for example multipart/*. For non- container MIME message part types, such as text/plain, this field is empty. For more information, see RFC 1521.
128        # Object with schema name: MessagePart
129      ],
130    },
131    "snippet": "A String", # A short part of the message text.
132    "raw": "A String", # 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.
133    "sizeEstimate": 42, # Estimated size in bytes of the message.
134    "threadId": "A 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:
135        # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
136        # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
137        # - The Subject headers must match.
138    "labelIds": [ # List of IDs of labels applied to this message.
139      "A String",
140    ],
141    "id": "A String", # The immutable ID of the message.
142  },
143  "id": "A String", # The immutable ID of the draft.
144}
145
146  media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
147  media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object.
148
149Returns:
150  An object of the form:
151
152    { # A draft email in the user's mailbox.
153    "message": { # An email message. # The message content of the draft.
154      "internalDate": "A String", # 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.
155      "historyId": "A String", # The ID of the last history record that modified this message.
156      "payload": { # A single MIME message part. # The parsed email structure in the message parts.
157        "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for container MIME message parts.
158          "data": "A String", # 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.
159          "attachmentId": "A 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.
160          "size": 42, # Number of bytes for the message part data (encoding notwithstanding).
161        },
162        "mimeType": "A String", # The MIME type of the message part.
163        "partId": "A String", # The immutable ID of the message part.
164        "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
165        "headers": [ # List of headers on this message part. For the top-level message part, representing the entire message payload, it will contain the standard RFC 2822 email headers such as To, From, and Subject.
166          {
167            "name": "A String", # The name of the header before the : separator. For example, To.
168            "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
169          },
170        ],
171        "parts": [ # The child MIME message parts of this part. This only applies to container MIME message parts, for example multipart/*. For non- container MIME message part types, such as text/plain, this field is empty. For more information, see RFC 1521.
172          # Object with schema name: MessagePart
173        ],
174      },
175      "snippet": "A String", # A short part of the message text.
176      "raw": "A String", # 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.
177      "sizeEstimate": 42, # Estimated size in bytes of the message.
178      "threadId": "A 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:
179          # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
180          # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
181          # - The Subject headers must match.
182      "labelIds": [ # List of IDs of labels applied to this message.
183        "A String",
184      ],
185      "id": "A String", # The immutable ID of the message.
186    },
187    "id": "A String", # The immutable ID of the draft.
188  }</pre>
189</div>
190
191<div class="method">
192    <code class="details" id="delete">delete(userId, id)</code>
193  <pre>Immediately and permanently deletes the specified draft. Does not simply trash it.
194
195Args:
196  userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
197  id: string, The ID of the draft to delete. (required)
198</pre>
199</div>
200
201<div class="method">
202    <code class="details" id="get">get(userId, id, format=None)</code>
203  <pre>Gets the specified draft.
204
205Args:
206  userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
207  id: string, The ID of the draft to retrieve. (required)
208  format: string, The format to return the draft in.
209    Allowed values
210      full -
211      metadata -
212      minimal -
213      raw -
214
215Returns:
216  An object of the form:
217
218    { # A draft email in the user's mailbox.
219    "message": { # An email message. # The message content of the draft.
220      "internalDate": "A String", # 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.
221      "historyId": "A String", # The ID of the last history record that modified this message.
222      "payload": { # A single MIME message part. # The parsed email structure in the message parts.
223        "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for container MIME message parts.
224          "data": "A String", # 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.
225          "attachmentId": "A 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.
226          "size": 42, # Number of bytes for the message part data (encoding notwithstanding).
227        },
228        "mimeType": "A String", # The MIME type of the message part.
229        "partId": "A String", # The immutable ID of the message part.
230        "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
231        "headers": [ # List of headers on this message part. For the top-level message part, representing the entire message payload, it will contain the standard RFC 2822 email headers such as To, From, and Subject.
232          {
233            "name": "A String", # The name of the header before the : separator. For example, To.
234            "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
235          },
236        ],
237        "parts": [ # The child MIME message parts of this part. This only applies to container MIME message parts, for example multipart/*. For non- container MIME message part types, such as text/plain, this field is empty. For more information, see RFC 1521.
238          # Object with schema name: MessagePart
239        ],
240      },
241      "snippet": "A String", # A short part of the message text.
242      "raw": "A String", # 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.
243      "sizeEstimate": 42, # Estimated size in bytes of the message.
244      "threadId": "A 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:
245          # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
246          # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
247          # - The Subject headers must match.
248      "labelIds": [ # List of IDs of labels applied to this message.
249        "A String",
250      ],
251      "id": "A String", # The immutable ID of the message.
252    },
253    "id": "A String", # The immutable ID of the draft.
254  }</pre>
255</div>
256
257<div class="method">
258    <code class="details" id="list">list(userId, q=None, pageToken=None, maxResults=None, includeSpamTrash=None)</code>
259  <pre>Lists the drafts in the user's mailbox.
260
261Args:
262  userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
263  q: string, Only return draft messages matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread".
264  pageToken: string, Page token to retrieve a specific page of results in the list.
265  maxResults: integer, Maximum number of drafts to return.
266  includeSpamTrash: boolean, Include drafts from SPAM and TRASH in the results.
267
268Returns:
269  An object of the form:
270
271    {
272    "nextPageToken": "A String", # Token to retrieve the next page of results in the list.
273    "resultSizeEstimate": 42, # Estimated total number of results.
274    "drafts": [ # List of drafts.
275      { # A draft email in the user's mailbox.
276        "message": { # An email message. # The message content of the draft.
277          "internalDate": "A String", # 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.
278          "historyId": "A String", # The ID of the last history record that modified this message.
279          "payload": { # A single MIME message part. # The parsed email structure in the message parts.
280            "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for container MIME message parts.
281              "data": "A String", # 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.
282              "attachmentId": "A 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.
283              "size": 42, # Number of bytes for the message part data (encoding notwithstanding).
284            },
285            "mimeType": "A String", # The MIME type of the message part.
286            "partId": "A String", # The immutable ID of the message part.
287            "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
288            "headers": [ # List of headers on this message part. For the top-level message part, representing the entire message payload, it will contain the standard RFC 2822 email headers such as To, From, and Subject.
289              {
290                "name": "A String", # The name of the header before the : separator. For example, To.
291                "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
292              },
293            ],
294            "parts": [ # The child MIME message parts of this part. This only applies to container MIME message parts, for example multipart/*. For non- container MIME message part types, such as text/plain, this field is empty. For more information, see RFC 1521.
295              # Object with schema name: MessagePart
296            ],
297          },
298          "snippet": "A String", # A short part of the message text.
299          "raw": "A String", # 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.
300          "sizeEstimate": 42, # Estimated size in bytes of the message.
301          "threadId": "A 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:
302              # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
303              # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
304              # - The Subject headers must match.
305          "labelIds": [ # List of IDs of labels applied to this message.
306            "A String",
307          ],
308          "id": "A String", # The immutable ID of the message.
309        },
310        "id": "A String", # The immutable ID of the draft.
311      },
312    ],
313  }</pre>
314</div>
315
316<div class="method">
317    <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
318  <pre>Retrieves the next page of results.
319
320Args:
321  previous_request: The request for the previous page. (required)
322  previous_response: The response from the request for the previous page. (required)
323
324Returns:
325  A request object that you can call 'execute()' on to request the next
326  page. Returns None if there are no more items in the collection.
327    </pre>
328</div>
329
330<div class="method">
331    <code class="details" id="send">send(userId, body=None, media_body=None, media_mime_type=None)</code>
332  <pre>Sends the specified, existing draft to the recipients in the To, Cc, and Bcc headers.
333
334Args:
335  userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
336  body: object, The request body.
337    The object takes the form of:
338
339{ # A draft email in the user's mailbox.
340  "message": { # An email message. # The message content of the draft.
341    "internalDate": "A String", # 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.
342    "historyId": "A String", # The ID of the last history record that modified this message.
343    "payload": { # A single MIME message part. # The parsed email structure in the message parts.
344      "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for container MIME message parts.
345        "data": "A String", # 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.
346        "attachmentId": "A 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.
347        "size": 42, # Number of bytes for the message part data (encoding notwithstanding).
348      },
349      "mimeType": "A String", # The MIME type of the message part.
350      "partId": "A String", # The immutable ID of the message part.
351      "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
352      "headers": [ # List of headers on this message part. For the top-level message part, representing the entire message payload, it will contain the standard RFC 2822 email headers such as To, From, and Subject.
353        {
354          "name": "A String", # The name of the header before the : separator. For example, To.
355          "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
356        },
357      ],
358      "parts": [ # The child MIME message parts of this part. This only applies to container MIME message parts, for example multipart/*. For non- container MIME message part types, such as text/plain, this field is empty. For more information, see RFC 1521.
359        # Object with schema name: MessagePart
360      ],
361    },
362    "snippet": "A String", # A short part of the message text.
363    "raw": "A String", # 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.
364    "sizeEstimate": 42, # Estimated size in bytes of the message.
365    "threadId": "A 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:
366        # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
367        # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
368        # - The Subject headers must match.
369    "labelIds": [ # List of IDs of labels applied to this message.
370      "A String",
371    ],
372    "id": "A String", # The immutable ID of the message.
373  },
374  "id": "A String", # The immutable ID of the draft.
375}
376
377  media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
378  media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object.
379
380Returns:
381  An object of the form:
382
383    { # An email message.
384    "internalDate": "A String", # 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.
385    "historyId": "A String", # The ID of the last history record that modified this message.
386    "payload": { # A single MIME message part. # The parsed email structure in the message parts.
387      "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for container MIME message parts.
388        "data": "A String", # 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.
389        "attachmentId": "A 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.
390        "size": 42, # Number of bytes for the message part data (encoding notwithstanding).
391      },
392      "mimeType": "A String", # The MIME type of the message part.
393      "partId": "A String", # The immutable ID of the message part.
394      "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
395      "headers": [ # List of headers on this message part. For the top-level message part, representing the entire message payload, it will contain the standard RFC 2822 email headers such as To, From, and Subject.
396        {
397          "name": "A String", # The name of the header before the : separator. For example, To.
398          "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
399        },
400      ],
401      "parts": [ # The child MIME message parts of this part. This only applies to container MIME message parts, for example multipart/*. For non- container MIME message part types, such as text/plain, this field is empty. For more information, see RFC 1521.
402        # Object with schema name: MessagePart
403      ],
404    },
405    "snippet": "A String", # A short part of the message text.
406    "raw": "A String", # 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.
407    "sizeEstimate": 42, # Estimated size in bytes of the message.
408    "threadId": "A 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:
409        # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
410        # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
411        # - The Subject headers must match.
412    "labelIds": [ # List of IDs of labels applied to this message.
413      "A String",
414    ],
415    "id": "A String", # The immutable ID of the message.
416  }</pre>
417</div>
418
419<div class="method">
420    <code class="details" id="update">update(userId, id, body=None, media_body=None, media_mime_type=None)</code>
421  <pre>Replaces a draft's content.
422
423Args:
424  userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
425  id: string, The ID of the draft to update. (required)
426  body: object, The request body.
427    The object takes the form of:
428
429{ # A draft email in the user's mailbox.
430  "message": { # An email message. # The message content of the draft.
431    "internalDate": "A String", # 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.
432    "historyId": "A String", # The ID of the last history record that modified this message.
433    "payload": { # A single MIME message part. # The parsed email structure in the message parts.
434      "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for container MIME message parts.
435        "data": "A String", # 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.
436        "attachmentId": "A 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.
437        "size": 42, # Number of bytes for the message part data (encoding notwithstanding).
438      },
439      "mimeType": "A String", # The MIME type of the message part.
440      "partId": "A String", # The immutable ID of the message part.
441      "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
442      "headers": [ # List of headers on this message part. For the top-level message part, representing the entire message payload, it will contain the standard RFC 2822 email headers such as To, From, and Subject.
443        {
444          "name": "A String", # The name of the header before the : separator. For example, To.
445          "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
446        },
447      ],
448      "parts": [ # The child MIME message parts of this part. This only applies to container MIME message parts, for example multipart/*. For non- container MIME message part types, such as text/plain, this field is empty. For more information, see RFC 1521.
449        # Object with schema name: MessagePart
450      ],
451    },
452    "snippet": "A String", # A short part of the message text.
453    "raw": "A String", # 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.
454    "sizeEstimate": 42, # Estimated size in bytes of the message.
455    "threadId": "A 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:
456        # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
457        # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
458        # - The Subject headers must match.
459    "labelIds": [ # List of IDs of labels applied to this message.
460      "A String",
461    ],
462    "id": "A String", # The immutable ID of the message.
463  },
464  "id": "A String", # The immutable ID of the draft.
465}
466
467  media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
468  media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object.
469
470Returns:
471  An object of the form:
472
473    { # A draft email in the user's mailbox.
474    "message": { # An email message. # The message content of the draft.
475      "internalDate": "A String", # 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.
476      "historyId": "A String", # The ID of the last history record that modified this message.
477      "payload": { # A single MIME message part. # The parsed email structure in the message parts.
478        "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for container MIME message parts.
479          "data": "A String", # 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.
480          "attachmentId": "A 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.
481          "size": 42, # Number of bytes for the message part data (encoding notwithstanding).
482        },
483        "mimeType": "A String", # The MIME type of the message part.
484        "partId": "A String", # The immutable ID of the message part.
485        "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
486        "headers": [ # List of headers on this message part. For the top-level message part, representing the entire message payload, it will contain the standard RFC 2822 email headers such as To, From, and Subject.
487          {
488            "name": "A String", # The name of the header before the : separator. For example, To.
489            "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
490          },
491        ],
492        "parts": [ # The child MIME message parts of this part. This only applies to container MIME message parts, for example multipart/*. For non- container MIME message part types, such as text/plain, this field is empty. For more information, see RFC 1521.
493          # Object with schema name: MessagePart
494        ],
495      },
496      "snippet": "A String", # A short part of the message text.
497      "raw": "A String", # 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.
498      "sizeEstimate": 42, # Estimated size in bytes of the message.
499      "threadId": "A 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:
500          # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
501          # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
502          # - The Subject headers must match.
503      "labelIds": [ # List of IDs of labels applied to this message.
504        "A String",
505      ],
506      "id": "A String", # The immutable ID of the message.
507    },
508    "id": "A String", # The immutable ID of the draft.
509  }</pre>
510</div>
511
512</body></html>