blob: 7612bd0f87c11c391cc774c8cf1442598a284fff [file] [log] [blame]
Craig Citro065b5302014-08-14 00:47:23 -07001<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)</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">
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -070087 <code><a href="#list">list(userId, pageToken=None, maxResults=None, includeSpamTrash=None)</a></code></p>
Craig Citro065b5302014-08-14 00:47:23 -070088<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)</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)</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)</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.
Takashi Matsuo06694102015-09-11 13:55:40 -0700110 "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.
Craig Citro065b5302014-08-14 00:47:23 -0700111 "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. 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, # Total number of bytes in the body of the message part.
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.
Craig Citroe633be12015-03-02 13:40:36 -0800132 "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.
Craig Citro065b5302014-08-14 00:47:23 -0700133 "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.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700136 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
Craig Citro065b5302014-08-14 00:47:23 -0700137 # - 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
148Returns:
149 An object of the form:
150
151 { # A draft email in the user's mailbox.
152 "message": { # An email message. # The message content of the draft.
Takashi Matsuo06694102015-09-11 13:55:40 -0700153 "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.
Craig Citro065b5302014-08-14 00:47:23 -0700154 "historyId": "A String", # The ID of the last history record that modified this message.
155 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
156 "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.
157 "data": "A String", # The body data of a MIME message part. 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.
158 "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.
159 "size": 42, # Total number of bytes in the body of the message part.
160 },
161 "mimeType": "A String", # The MIME type of the message part.
162 "partId": "A String", # The immutable ID of the message part.
163 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
164 "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.
165 {
166 "name": "A String", # The name of the header before the : separator. For example, To.
167 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
168 },
169 ],
170 "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.
171 # Object with schema name: MessagePart
172 ],
173 },
174 "snippet": "A String", # A short part of the message text.
Craig Citroe633be12015-03-02 13:40:36 -0800175 "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.
Craig Citro065b5302014-08-14 00:47:23 -0700176 "sizeEstimate": 42, # Estimated size in bytes of the message.
177 "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:
178 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700179 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
Craig Citro065b5302014-08-14 00:47:23 -0700180 # - The Subject headers must match.
181 "labelIds": [ # List of IDs of labels applied to this message.
182 "A String",
183 ],
184 "id": "A String", # The immutable ID of the message.
185 },
186 "id": "A String", # The immutable ID of the draft.
187 }</pre>
188</div>
189
190<div class="method">
191 <code class="details" id="delete">delete(userId, id)</code>
192 <pre>Immediately and permanently deletes the specified draft. Does not simply trash it.
193
194Args:
195 userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
196 id: string, The ID of the draft to delete. (required)
197</pre>
198</div>
199
200<div class="method">
201 <code class="details" id="get">get(userId, id, format=None)</code>
202 <pre>Gets the specified draft.
203
204Args:
205 userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
206 id: string, The ID of the draft to retrieve. (required)
207 format: string, The format to return the draft in.
208 Allowed values
209 full -
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700210 metadata -
Craig Citro065b5302014-08-14 00:47:23 -0700211 minimal -
212 raw -
213
214Returns:
215 An object of the form:
216
217 { # A draft email in the user's mailbox.
218 "message": { # An email message. # The message content of the draft.
Takashi Matsuo06694102015-09-11 13:55:40 -0700219 "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.
Craig Citro065b5302014-08-14 00:47:23 -0700220 "historyId": "A String", # The ID of the last history record that modified this message.
221 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
222 "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.
223 "data": "A String", # The body data of a MIME message part. 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.
224 "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.
225 "size": 42, # Total number of bytes in the body of the message part.
226 },
227 "mimeType": "A String", # The MIME type of the message part.
228 "partId": "A String", # The immutable ID of the message part.
229 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
230 "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.
231 {
232 "name": "A String", # The name of the header before the : separator. For example, To.
233 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
234 },
235 ],
236 "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.
237 # Object with schema name: MessagePart
238 ],
239 },
240 "snippet": "A String", # A short part of the message text.
Craig Citroe633be12015-03-02 13:40:36 -0800241 "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.
Craig Citro065b5302014-08-14 00:47:23 -0700242 "sizeEstimate": 42, # Estimated size in bytes of the message.
243 "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:
244 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700245 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
Craig Citro065b5302014-08-14 00:47:23 -0700246 # - The Subject headers must match.
247 "labelIds": [ # List of IDs of labels applied to this message.
248 "A String",
249 ],
250 "id": "A String", # The immutable ID of the message.
251 },
252 "id": "A String", # The immutable ID of the draft.
253 }</pre>
254</div>
255
256<div class="method">
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700257 <code class="details" id="list">list(userId, pageToken=None, maxResults=None, includeSpamTrash=None)</code>
Craig Citro065b5302014-08-14 00:47:23 -0700258 <pre>Lists the drafts in the user's mailbox.
259
260Args:
261 userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
262 pageToken: string, Page token to retrieve a specific page of results in the list.
263 maxResults: integer, Maximum number of drafts to return.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700264 includeSpamTrash: boolean, Include drafts from SPAM and TRASH in the results.
Craig Citro065b5302014-08-14 00:47:23 -0700265
266Returns:
267 An object of the form:
268
269 {
270 "nextPageToken": "A String", # Token to retrieve the next page of results in the list.
271 "resultSizeEstimate": 42, # Estimated total number of results.
272 "drafts": [ # List of drafts.
273 { # A draft email in the user's mailbox.
274 "message": { # An email message. # The message content of the draft.
Takashi Matsuo06694102015-09-11 13:55:40 -0700275 "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.
Craig Citro065b5302014-08-14 00:47:23 -0700276 "historyId": "A String", # The ID of the last history record that modified this message.
277 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
278 "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.
279 "data": "A String", # The body data of a MIME message part. 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.
280 "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.
281 "size": 42, # Total number of bytes in the body of the message part.
282 },
283 "mimeType": "A String", # The MIME type of the message part.
284 "partId": "A String", # The immutable ID of the message part.
285 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
286 "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.
287 {
288 "name": "A String", # The name of the header before the : separator. For example, To.
289 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
290 },
291 ],
292 "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.
293 # Object with schema name: MessagePart
294 ],
295 },
296 "snippet": "A String", # A short part of the message text.
Craig Citroe633be12015-03-02 13:40:36 -0800297 "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.
Craig Citro065b5302014-08-14 00:47:23 -0700298 "sizeEstimate": 42, # Estimated size in bytes of the message.
299 "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:
300 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700301 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
Craig Citro065b5302014-08-14 00:47:23 -0700302 # - The Subject headers must match.
303 "labelIds": [ # List of IDs of labels applied to this message.
304 "A String",
305 ],
306 "id": "A String", # The immutable ID of the message.
307 },
308 "id": "A String", # The immutable ID of the draft.
309 },
310 ],
311 }</pre>
312</div>
313
314<div class="method">
315 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
316 <pre>Retrieves the next page of results.
317
318Args:
319 previous_request: The request for the previous page. (required)
320 previous_response: The response from the request for the previous page. (required)
321
322Returns:
323 A request object that you can call 'execute()' on to request the next
324 page. Returns None if there are no more items in the collection.
325 </pre>
326</div>
327
328<div class="method">
329 <code class="details" id="send">send(userId, body=None, media_body=None)</code>
330 <pre>Sends the specified, existing draft to the recipients in the To, Cc, and Bcc headers.
331
332Args:
333 userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
334 body: object, The request body.
335 The object takes the form of:
336
337{ # A draft email in the user's mailbox.
338 "message": { # An email message. # The message content of the draft.
Takashi Matsuo06694102015-09-11 13:55:40 -0700339 "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.
Craig Citro065b5302014-08-14 00:47:23 -0700340 "historyId": "A String", # The ID of the last history record that modified this message.
341 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
342 "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.
343 "data": "A String", # The body data of a MIME message part. 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.
344 "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.
345 "size": 42, # Total number of bytes in the body of the message part.
346 },
347 "mimeType": "A String", # The MIME type of the message part.
348 "partId": "A String", # The immutable ID of the message part.
349 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
350 "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.
351 {
352 "name": "A String", # The name of the header before the : separator. For example, To.
353 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
354 },
355 ],
356 "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.
357 # Object with schema name: MessagePart
358 ],
359 },
360 "snippet": "A String", # A short part of the message text.
Craig Citroe633be12015-03-02 13:40:36 -0800361 "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.
Craig Citro065b5302014-08-14 00:47:23 -0700362 "sizeEstimate": 42, # Estimated size in bytes of the message.
363 "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:
364 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700365 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
Craig Citro065b5302014-08-14 00:47:23 -0700366 # - The Subject headers must match.
367 "labelIds": [ # List of IDs of labels applied to this message.
368 "A String",
369 ],
370 "id": "A String", # The immutable ID of the message.
371 },
372 "id": "A String", # The immutable ID of the draft.
373}
374
375 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
376
377Returns:
378 An object of the form:
379
380 { # An email message.
Takashi Matsuo06694102015-09-11 13:55:40 -0700381 "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.
Craig Citro065b5302014-08-14 00:47:23 -0700382 "historyId": "A String", # The ID of the last history record that modified this message.
383 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
384 "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.
385 "data": "A String", # The body data of a MIME message part. 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.
386 "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.
387 "size": 42, # Total number of bytes in the body of the message part.
388 },
389 "mimeType": "A String", # The MIME type of the message part.
390 "partId": "A String", # The immutable ID of the message part.
391 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
392 "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.
393 {
394 "name": "A String", # The name of the header before the : separator. For example, To.
395 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
396 },
397 ],
398 "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.
399 # Object with schema name: MessagePart
400 ],
401 },
402 "snippet": "A String", # A short part of the message text.
Craig Citroe633be12015-03-02 13:40:36 -0800403 "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.
Craig Citro065b5302014-08-14 00:47:23 -0700404 "sizeEstimate": 42, # Estimated size in bytes of the message.
405 "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:
406 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700407 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
Craig Citro065b5302014-08-14 00:47:23 -0700408 # - The Subject headers must match.
409 "labelIds": [ # List of IDs of labels applied to this message.
410 "A String",
411 ],
412 "id": "A String", # The immutable ID of the message.
413 }</pre>
414</div>
415
416<div class="method">
417 <code class="details" id="update">update(userId, id, body=None, media_body=None)</code>
418 <pre>Replaces a draft's content.
419
420Args:
421 userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
422 id: string, The ID of the draft to update. (required)
423 body: object, The request body.
424 The object takes the form of:
425
426{ # A draft email in the user's mailbox.
427 "message": { # An email message. # The message content of the draft.
Takashi Matsuo06694102015-09-11 13:55:40 -0700428 "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.
Craig Citro065b5302014-08-14 00:47:23 -0700429 "historyId": "A String", # The ID of the last history record that modified this message.
430 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
431 "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.
432 "data": "A String", # The body data of a MIME message part. 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.
433 "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.
434 "size": 42, # Total number of bytes in the body of the message part.
435 },
436 "mimeType": "A String", # The MIME type of the message part.
437 "partId": "A String", # The immutable ID of the message part.
438 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
439 "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.
440 {
441 "name": "A String", # The name of the header before the : separator. For example, To.
442 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
443 },
444 ],
445 "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.
446 # Object with schema name: MessagePart
447 ],
448 },
449 "snippet": "A String", # A short part of the message text.
Craig Citroe633be12015-03-02 13:40:36 -0800450 "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.
Craig Citro065b5302014-08-14 00:47:23 -0700451 "sizeEstimate": 42, # Estimated size in bytes of the message.
452 "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:
453 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700454 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
Craig Citro065b5302014-08-14 00:47:23 -0700455 # - The Subject headers must match.
456 "labelIds": [ # List of IDs of labels applied to this message.
457 "A String",
458 ],
459 "id": "A String", # The immutable ID of the message.
460 },
461 "id": "A String", # The immutable ID of the draft.
462}
463
464 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
465
466Returns:
467 An object of the form:
468
469 { # A draft email in the user's mailbox.
470 "message": { # An email message. # The message content of the draft.
Takashi Matsuo06694102015-09-11 13:55:40 -0700471 "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.
Craig Citro065b5302014-08-14 00:47:23 -0700472 "historyId": "A String", # The ID of the last history record that modified this message.
473 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
474 "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.
475 "data": "A String", # The body data of a MIME message part. 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.
476 "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.
477 "size": 42, # Total number of bytes in the body of the message part.
478 },
479 "mimeType": "A String", # The MIME type of the message part.
480 "partId": "A String", # The immutable ID of the message part.
481 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
482 "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.
483 {
484 "name": "A String", # The name of the header before the : separator. For example, To.
485 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
486 },
487 ],
488 "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.
489 # Object with schema name: MessagePart
490 ],
491 },
492 "snippet": "A String", # A short part of the message text.
Craig Citroe633be12015-03-02 13:40:36 -0800493 "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.
Craig Citro065b5302014-08-14 00:47:23 -0700494 "sizeEstimate": 42, # Estimated size in bytes of the message.
495 "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:
496 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700497 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
Craig Citro065b5302014-08-14 00:47:23 -0700498 # - The Subject headers must match.
499 "labelIds": [ # List of IDs of labels applied to this message.
500 "A String",
501 ],
502 "id": "A String", # The immutable ID of the message.
503 },
504 "id": "A String", # The immutable ID of the draft.
505 }</pre>
506</div>
507
508</body></html>