blob: 2c5fdc58ebbc7854f5e0f5d41265b8b9ab4fc1e9 [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">
87 <code><a href="#list">list(userId, pageToken=None, maxResults=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)</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">
257 <code class="details" id="list">list(userId, pageToken=None, maxResults=None)</code>
258 <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.
264
265Returns:
266 An object of the form:
267
268 {
269 "nextPageToken": "A String", # Token to retrieve the next page of results in the list.
270 "resultSizeEstimate": 42, # Estimated total number of results.
271 "drafts": [ # List of drafts.
272 { # A draft email in the user's mailbox.
273 "message": { # An email message. # The message content of the draft.
Takashi Matsuo06694102015-09-11 13:55:40 -0700274 "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 -0700275 "historyId": "A String", # The ID of the last history record that modified this message.
276 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
277 "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.
278 "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.
279 "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.
280 "size": 42, # Total number of bytes in the body of the message part.
281 },
282 "mimeType": "A String", # The MIME type of the message part.
283 "partId": "A String", # The immutable ID of the message part.
284 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
285 "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.
286 {
287 "name": "A String", # The name of the header before the : separator. For example, To.
288 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
289 },
290 ],
291 "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.
292 # Object with schema name: MessagePart
293 ],
294 },
295 "snippet": "A String", # A short part of the message text.
Craig Citroe633be12015-03-02 13:40:36 -0800296 "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 -0700297 "sizeEstimate": 42, # Estimated size in bytes of the message.
298 "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:
299 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700300 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
Craig Citro065b5302014-08-14 00:47:23 -0700301 # - The Subject headers must match.
302 "labelIds": [ # List of IDs of labels applied to this message.
303 "A String",
304 ],
305 "id": "A String", # The immutable ID of the message.
306 },
307 "id": "A String", # The immutable ID of the draft.
308 },
309 ],
310 }</pre>
311</div>
312
313<div class="method">
314 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
315 <pre>Retrieves the next page of results.
316
317Args:
318 previous_request: The request for the previous page. (required)
319 previous_response: The response from the request for the previous page. (required)
320
321Returns:
322 A request object that you can call 'execute()' on to request the next
323 page. Returns None if there are no more items in the collection.
324 </pre>
325</div>
326
327<div class="method">
328 <code class="details" id="send">send(userId, body=None, media_body=None)</code>
329 <pre>Sends the specified, existing draft to the recipients in the To, Cc, and Bcc headers.
330
331Args:
332 userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
333 body: object, The request body.
334 The object takes the form of:
335
336{ # A draft email in the user's mailbox.
337 "message": { # An email message. # The message content of the draft.
Takashi Matsuo06694102015-09-11 13:55:40 -0700338 "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 -0700339 "historyId": "A String", # The ID of the last history record that modified this message.
340 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
341 "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.
342 "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.
343 "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.
344 "size": 42, # Total number of bytes in the body of the message part.
345 },
346 "mimeType": "A String", # The MIME type of the message part.
347 "partId": "A String", # The immutable ID of the message part.
348 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
349 "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.
350 {
351 "name": "A String", # The name of the header before the : separator. For example, To.
352 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
353 },
354 ],
355 "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.
356 # Object with schema name: MessagePart
357 ],
358 },
359 "snippet": "A String", # A short part of the message text.
Craig Citroe633be12015-03-02 13:40:36 -0800360 "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 -0700361 "sizeEstimate": 42, # Estimated size in bytes of the message.
362 "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:
363 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700364 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
Craig Citro065b5302014-08-14 00:47:23 -0700365 # - The Subject headers must match.
366 "labelIds": [ # List of IDs of labels applied to this message.
367 "A String",
368 ],
369 "id": "A String", # The immutable ID of the message.
370 },
371 "id": "A String", # The immutable ID of the draft.
372}
373
374 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
375
376Returns:
377 An object of the form:
378
379 { # An email message.
Takashi Matsuo06694102015-09-11 13:55:40 -0700380 "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 -0700381 "historyId": "A String", # The ID of the last history record that modified this message.
382 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
383 "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.
384 "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.
385 "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.
386 "size": 42, # Total number of bytes in the body of the message part.
387 },
388 "mimeType": "A String", # The MIME type of the message part.
389 "partId": "A String", # The immutable ID of the message part.
390 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
391 "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.
392 {
393 "name": "A String", # The name of the header before the : separator. For example, To.
394 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
395 },
396 ],
397 "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.
398 # Object with schema name: MessagePart
399 ],
400 },
401 "snippet": "A String", # A short part of the message text.
Craig Citroe633be12015-03-02 13:40:36 -0800402 "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 -0700403 "sizeEstimate": 42, # Estimated size in bytes of the message.
404 "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:
405 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700406 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
Craig Citro065b5302014-08-14 00:47:23 -0700407 # - The Subject headers must match.
408 "labelIds": [ # List of IDs of labels applied to this message.
409 "A String",
410 ],
411 "id": "A String", # The immutable ID of the message.
412 }</pre>
413</div>
414
415<div class="method">
416 <code class="details" id="update">update(userId, id, body=None, media_body=None)</code>
417 <pre>Replaces a draft's content.
418
419Args:
420 userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
421 id: string, The ID of the draft to update. (required)
422 body: object, The request body.
423 The object takes the form of:
424
425{ # A draft email in the user's mailbox.
426 "message": { # An email message. # The message content of the draft.
Takashi Matsuo06694102015-09-11 13:55:40 -0700427 "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 -0700428 "historyId": "A String", # The ID of the last history record that modified this message.
429 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
430 "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.
431 "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.
432 "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.
433 "size": 42, # Total number of bytes in the body of the message part.
434 },
435 "mimeType": "A String", # The MIME type of the message part.
436 "partId": "A String", # The immutable ID of the message part.
437 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
438 "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.
439 {
440 "name": "A String", # The name of the header before the : separator. For example, To.
441 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
442 },
443 ],
444 "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.
445 # Object with schema name: MessagePart
446 ],
447 },
448 "snippet": "A String", # A short part of the message text.
Craig Citroe633be12015-03-02 13:40:36 -0800449 "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 -0700450 "sizeEstimate": 42, # Estimated size in bytes of the message.
451 "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:
452 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700453 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
Craig Citro065b5302014-08-14 00:47:23 -0700454 # - The Subject headers must match.
455 "labelIds": [ # List of IDs of labels applied to this message.
456 "A String",
457 ],
458 "id": "A String", # The immutable ID of the message.
459 },
460 "id": "A String", # The immutable ID of the draft.
461}
462
463 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
464
465Returns:
466 An object of the form:
467
468 { # A draft email in the user's mailbox.
469 "message": { # An email message. # The message content of the draft.
Takashi Matsuo06694102015-09-11 13:55:40 -0700470 "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 -0700471 "historyId": "A String", # The ID of the last history record that modified this message.
472 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
473 "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.
474 "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.
475 "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.
476 "size": 42, # Total number of bytes in the body of the message part.
477 },
478 "mimeType": "A String", # The MIME type of the message part.
479 "partId": "A String", # The immutable ID of the message part.
480 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
481 "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.
482 {
483 "name": "A String", # The name of the header before the : separator. For example, To.
484 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
485 },
486 ],
487 "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.
488 # Object with schema name: MessagePart
489 ],
490 },
491 "snippet": "A String", # A short part of the message text.
Craig Citroe633be12015-03-02 13:40:36 -0800492 "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 -0700493 "sizeEstimate": 42, # Estimated size in bytes of the message.
494 "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:
495 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700496 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
Craig Citro065b5302014-08-14 00:47:23 -0700497 # - The Subject headers must match.
498 "labelIds": [ # List of IDs of labels applied to this message.
499 "A String",
500 ],
501 "id": "A String", # The immutable ID of the message.
502 },
503 "id": "A String", # The immutable ID of the draft.
504 }</pre>
505</div>
506
507</body></html>