blob: c31024d3ebb0ace177325df8894d3e081ae75d44 [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.messages.html">messages</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="gmail_v1.users.messages.attachments.html">attachments()</a></code>
79</p>
80<p class="firstline">Returns the attachments Resource.</p>
81
82<p class="toc_element">
83 <code><a href="#delete">delete(userId, id)</a></code></p>
84<p class="firstline">Immediately and permanently deletes the specified message. This operation cannot be undone. Prefer messages.trash instead.</p>
85<p class="toc_element">
86 <code><a href="#get">get(userId, id, format=None)</a></code></p>
87<p class="firstline">Gets the specified message.</p>
88<p class="toc_element">
89 <code><a href="#import_">import_(userId, body=None, media_body=None)</a></code></p>
90<p class="firstline">Directly imports a message into only this user's mailbox, similar to receiving via SMTP. Does not send a message.</p>
91<p class="toc_element">
92 <code><a href="#insert">insert(userId, body=None, media_body=None)</a></code></p>
93<p class="firstline">Directly inserts a message into only this user's mailbox. Does not send a message.</p>
94<p class="toc_element">
95 <code><a href="#list">list(userId, labelIds=None, q=None, pageToken=None, maxResults=None, includeSpamTrash=None)</a></code></p>
96<p class="firstline">Lists the messages in the user's mailbox.</p>
97<p class="toc_element">
98 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
99<p class="firstline">Retrieves the next page of results.</p>
100<p class="toc_element">
101 <code><a href="#modify">modify(userId, id, body)</a></code></p>
102<p class="firstline">Modifies the labels on the specified message.</p>
103<p class="toc_element">
104 <code><a href="#send">send(userId, body=None, media_body=None)</a></code></p>
105<p class="firstline">Sends the specified message to the recipients in the To, Cc, and Bcc headers.</p>
106<p class="toc_element">
107 <code><a href="#trash">trash(userId, id)</a></code></p>
108<p class="firstline">Moves the specified message to the trash.</p>
109<p class="toc_element">
110 <code><a href="#untrash">untrash(userId, id)</a></code></p>
111<p class="firstline">Removes the specified message from the trash.</p>
112<h3>Method Details</h3>
113<div class="method">
114 <code class="details" id="delete">delete(userId, id)</code>
115 <pre>Immediately and permanently deletes the specified message. This operation cannot be undone. Prefer messages.trash instead.
116
117Args:
118 userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
119 id: string, The ID of the message to delete. (required)
120</pre>
121</div>
122
123<div class="method">
124 <code class="details" id="get">get(userId, id, format=None)</code>
125 <pre>Gets the specified message.
126
127Args:
128 userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
129 id: string, The ID of the message to retrieve. (required)
130 format: string, The format to return the message in.
131 Allowed values
132 full -
133 minimal -
134 raw -
135
136Returns:
137 An object of the form:
138
139 { # An email message.
140 "historyId": "A String", # The ID of the last history record that modified this message.
141 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
142 "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.
143 "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.
144 "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.
145 "size": 42, # Total number of bytes in the body of the message part.
146 },
147 "mimeType": "A String", # The MIME type of the message part.
148 "partId": "A String", # The immutable ID of the message part.
149 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
150 "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.
151 {
152 "name": "A String", # The name of the header before the : separator. For example, To.
153 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
154 },
155 ],
156 "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.
157 # Object with schema name: MessagePart
158 ],
159 },
160 "snippet": "A String", # A short part of the message text.
161 "raw": "A String", # The entire email message in an RFC 2822 formatted and URL-safe base64 encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied.
162 "sizeEstimate": 42, # Estimated size in bytes of the message.
163 "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:
164 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
165 # - The References and In-Reply-To headers must be set in compliance with the <a href="https://tools.ietf.org/html/rfc2822"RFC 2822 standard.
166 # - The Subject headers must match.
167 "labelIds": [ # List of IDs of labels applied to this message.
168 "A String",
169 ],
170 "id": "A String", # The immutable ID of the message.
171 }</pre>
172</div>
173
174<div class="method">
175 <code class="details" id="import_">import_(userId, body=None, media_body=None)</code>
176 <pre>Directly imports a message into only this user's mailbox, similar to receiving via SMTP. Does not send a message.
177
178Args:
179 userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
180 body: object, The request body.
181 The object takes the form of:
182
183{ # An email message.
184 "historyId": "A String", # The ID of the last history record that modified this message.
185 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
186 "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.
187 "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.
188 "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.
189 "size": 42, # Total number of bytes in the body of the message part.
190 },
191 "mimeType": "A String", # The MIME type of the message part.
192 "partId": "A String", # The immutable ID of the message part.
193 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
194 "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.
195 {
196 "name": "A String", # The name of the header before the : separator. For example, To.
197 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
198 },
199 ],
200 "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.
201 # Object with schema name: MessagePart
202 ],
203 },
204 "snippet": "A String", # A short part of the message text.
205 "raw": "A String", # The entire email message in an RFC 2822 formatted and URL-safe base64 encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied.
206 "sizeEstimate": 42, # Estimated size in bytes of the message.
207 "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:
208 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
209 # - The References and In-Reply-To headers must be set in compliance with the <a href="https://tools.ietf.org/html/rfc2822"RFC 2822 standard.
210 # - The Subject headers must match.
211 "labelIds": [ # List of IDs of labels applied to this message.
212 "A String",
213 ],
214 "id": "A String", # The immutable ID of the message.
215}
216
217 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
218
219Returns:
220 An object of the form:
221
222 { # An email message.
223 "historyId": "A String", # The ID of the last history record that modified this message.
224 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
225 "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.
226 "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.
227 "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.
228 "size": 42, # Total number of bytes in the body of the message part.
229 },
230 "mimeType": "A String", # The MIME type of the message part.
231 "partId": "A String", # The immutable ID of the message part.
232 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
233 "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.
234 {
235 "name": "A String", # The name of the header before the : separator. For example, To.
236 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
237 },
238 ],
239 "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.
240 # Object with schema name: MessagePart
241 ],
242 },
243 "snippet": "A String", # A short part of the message text.
244 "raw": "A String", # The entire email message in an RFC 2822 formatted and URL-safe base64 encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied.
245 "sizeEstimate": 42, # Estimated size in bytes of the message.
246 "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:
247 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
248 # - The References and In-Reply-To headers must be set in compliance with the <a href="https://tools.ietf.org/html/rfc2822"RFC 2822 standard.
249 # - The Subject headers must match.
250 "labelIds": [ # List of IDs of labels applied to this message.
251 "A String",
252 ],
253 "id": "A String", # The immutable ID of the message.
254 }</pre>
255</div>
256
257<div class="method">
258 <code class="details" id="insert">insert(userId, body=None, media_body=None)</code>
259 <pre>Directly inserts a message into only this user's mailbox. Does not send a message.
260
261Args:
262 userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
263 body: object, The request body.
264 The object takes the form of:
265
266{ # An email message.
267 "historyId": "A String", # The ID of the last history record that modified this message.
268 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
269 "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.
270 "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.
271 "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.
272 "size": 42, # Total number of bytes in the body of the message part.
273 },
274 "mimeType": "A String", # The MIME type of the message part.
275 "partId": "A String", # The immutable ID of the message part.
276 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
277 "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.
278 {
279 "name": "A String", # The name of the header before the : separator. For example, To.
280 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
281 },
282 ],
283 "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.
284 # Object with schema name: MessagePart
285 ],
286 },
287 "snippet": "A String", # A short part of the message text.
288 "raw": "A String", # The entire email message in an RFC 2822 formatted and URL-safe base64 encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied.
289 "sizeEstimate": 42, # Estimated size in bytes of the message.
290 "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:
291 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
292 # - The References and In-Reply-To headers must be set in compliance with the <a href="https://tools.ietf.org/html/rfc2822"RFC 2822 standard.
293 # - The Subject headers must match.
294 "labelIds": [ # List of IDs of labels applied to this message.
295 "A String",
296 ],
297 "id": "A String", # The immutable ID of the message.
298}
299
300 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
301
302Returns:
303 An object of the form:
304
305 { # An email message.
306 "historyId": "A String", # The ID of the last history record that modified this message.
307 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
308 "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.
309 "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.
310 "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.
311 "size": 42, # Total number of bytes in the body of the message part.
312 },
313 "mimeType": "A String", # The MIME type of the message part.
314 "partId": "A String", # The immutable ID of the message part.
315 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
316 "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.
317 {
318 "name": "A String", # The name of the header before the : separator. For example, To.
319 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
320 },
321 ],
322 "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.
323 # Object with schema name: MessagePart
324 ],
325 },
326 "snippet": "A String", # A short part of the message text.
327 "raw": "A String", # The entire email message in an RFC 2822 formatted and URL-safe base64 encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied.
328 "sizeEstimate": 42, # Estimated size in bytes of the message.
329 "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:
330 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
331 # - The References and In-Reply-To headers must be set in compliance with the <a href="https://tools.ietf.org/html/rfc2822"RFC 2822 standard.
332 # - The Subject headers must match.
333 "labelIds": [ # List of IDs of labels applied to this message.
334 "A String",
335 ],
336 "id": "A String", # The immutable ID of the message.
337 }</pre>
338</div>
339
340<div class="method">
341 <code class="details" id="list">list(userId, labelIds=None, q=None, pageToken=None, maxResults=None, includeSpamTrash=None)</code>
342 <pre>Lists the messages in the user's mailbox.
343
344Args:
345 userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
346 labelIds: string, Only return messages with labels that match all of the specified label IDs. (repeated)
347 q: string, Only return messages matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread".
348 pageToken: string, Page token to retrieve a specific page of results in the list.
349 maxResults: integer, Maximum number of messages to return.
350 includeSpamTrash: boolean, Include messages from SPAM and TRASH in the results.
351
352Returns:
353 An object of the form:
354
355 {
356 "nextPageToken": "A String", # Token to retrieve the next page of results in the list.
357 "resultSizeEstimate": 42, # Estimated total number of results.
358 "messages": [ # List of messages.
359 { # An email message.
360 "historyId": "A String", # The ID of the last history record that modified this message.
361 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
362 "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.
363 "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.
364 "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.
365 "size": 42, # Total number of bytes in the body of the message part.
366 },
367 "mimeType": "A String", # The MIME type of the message part.
368 "partId": "A String", # The immutable ID of the message part.
369 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
370 "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.
371 {
372 "name": "A String", # The name of the header before the : separator. For example, To.
373 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
374 },
375 ],
376 "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.
377 # Object with schema name: MessagePart
378 ],
379 },
380 "snippet": "A String", # A short part of the message text.
381 "raw": "A String", # The entire email message in an RFC 2822 formatted and URL-safe base64 encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied.
382 "sizeEstimate": 42, # Estimated size in bytes of the message.
383 "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:
384 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
385 # - The References and In-Reply-To headers must be set in compliance with the <a href="https://tools.ietf.org/html/rfc2822"RFC 2822 standard.
386 # - The Subject headers must match.
387 "labelIds": [ # List of IDs of labels applied to this message.
388 "A String",
389 ],
390 "id": "A String", # The immutable ID of the message.
391 },
392 ],
393 }</pre>
394</div>
395
396<div class="method">
397 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
398 <pre>Retrieves the next page of results.
399
400Args:
401 previous_request: The request for the previous page. (required)
402 previous_response: The response from the request for the previous page. (required)
403
404Returns:
405 A request object that you can call 'execute()' on to request the next
406 page. Returns None if there are no more items in the collection.
407 </pre>
408</div>
409
410<div class="method">
411 <code class="details" id="modify">modify(userId, id, body)</code>
412 <pre>Modifies the labels on the specified message.
413
414Args:
415 userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
416 id: string, The ID of the message to modify. (required)
417 body: object, The request body. (required)
418 The object takes the form of:
419
420{
421 "removeLabelIds": [ # A list IDs of labels to remove from this message.
422 "A String",
423 ],
424 "addLabelIds": [ # A list of IDs of labels to add to this message.
425 "A String",
426 ],
427 }
428
429
430Returns:
431 An object of the form:
432
433 { # An email message.
434 "historyId": "A String", # The ID of the last history record that modified this message.
435 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
436 "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.
437 "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.
438 "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.
439 "size": 42, # Total number of bytes in the body of the message part.
440 },
441 "mimeType": "A String", # The MIME type of the message part.
442 "partId": "A String", # The immutable ID of the message part.
443 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
444 "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.
445 {
446 "name": "A String", # The name of the header before the : separator. For example, To.
447 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
448 },
449 ],
450 "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.
451 # Object with schema name: MessagePart
452 ],
453 },
454 "snippet": "A String", # A short part of the message text.
455 "raw": "A String", # The entire email message in an RFC 2822 formatted and URL-safe base64 encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied.
456 "sizeEstimate": 42, # Estimated size in bytes of the message.
457 "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:
458 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
459 # - The References and In-Reply-To headers must be set in compliance with the <a href="https://tools.ietf.org/html/rfc2822"RFC 2822 standard.
460 # - The Subject headers must match.
461 "labelIds": [ # List of IDs of labels applied to this message.
462 "A String",
463 ],
464 "id": "A String", # The immutable ID of the message.
465 }</pre>
466</div>
467
468<div class="method">
469 <code class="details" id="send">send(userId, body=None, media_body=None)</code>
470 <pre>Sends the specified message to the recipients in the To, Cc, and Bcc headers.
471
472Args:
473 userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
474 body: object, The request body.
475 The object takes the form of:
476
477{ # An email message.
478 "historyId": "A String", # The ID of the last history record that modified this message.
479 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
480 "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.
481 "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.
482 "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.
483 "size": 42, # Total number of bytes in the body of the message part.
484 },
485 "mimeType": "A String", # The MIME type of the message part.
486 "partId": "A String", # The immutable ID of the message part.
487 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
488 "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.
489 {
490 "name": "A String", # The name of the header before the : separator. For example, To.
491 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
492 },
493 ],
494 "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.
495 # Object with schema name: MessagePart
496 ],
497 },
498 "snippet": "A String", # A short part of the message text.
499 "raw": "A String", # The entire email message in an RFC 2822 formatted and URL-safe base64 encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied.
500 "sizeEstimate": 42, # Estimated size in bytes of the message.
501 "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:
502 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
503 # - The References and In-Reply-To headers must be set in compliance with the <a href="https://tools.ietf.org/html/rfc2822"RFC 2822 standard.
504 # - The Subject headers must match.
505 "labelIds": [ # List of IDs of labels applied to this message.
506 "A String",
507 ],
508 "id": "A String", # The immutable ID of the message.
509}
510
511 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
512
513Returns:
514 An object of the form:
515
516 { # An email message.
517 "historyId": "A String", # The ID of the last history record that modified this message.
518 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
519 "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.
520 "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.
521 "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.
522 "size": 42, # Total number of bytes in the body of the message part.
523 },
524 "mimeType": "A String", # The MIME type of the message part.
525 "partId": "A String", # The immutable ID of the message part.
526 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
527 "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.
528 {
529 "name": "A String", # The name of the header before the : separator. For example, To.
530 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
531 },
532 ],
533 "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.
534 # Object with schema name: MessagePart
535 ],
536 },
537 "snippet": "A String", # A short part of the message text.
538 "raw": "A String", # The entire email message in an RFC 2822 formatted and URL-safe base64 encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied.
539 "sizeEstimate": 42, # Estimated size in bytes of the message.
540 "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:
541 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
542 # - The References and In-Reply-To headers must be set in compliance with the <a href="https://tools.ietf.org/html/rfc2822"RFC 2822 standard.
543 # - The Subject headers must match.
544 "labelIds": [ # List of IDs of labels applied to this message.
545 "A String",
546 ],
547 "id": "A String", # The immutable ID of the message.
548 }</pre>
549</div>
550
551<div class="method">
552 <code class="details" id="trash">trash(userId, id)</code>
553 <pre>Moves the specified message to the trash.
554
555Args:
556 userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
557 id: string, The ID of the message to Trash. (required)
558
559Returns:
560 An object of the form:
561
562 { # An email message.
563 "historyId": "A String", # The ID of the last history record that modified this message.
564 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
565 "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.
566 "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.
567 "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.
568 "size": 42, # Total number of bytes in the body of the message part.
569 },
570 "mimeType": "A String", # The MIME type of the message part.
571 "partId": "A String", # The immutable ID of the message part.
572 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
573 "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.
574 {
575 "name": "A String", # The name of the header before the : separator. For example, To.
576 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
577 },
578 ],
579 "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.
580 # Object with schema name: MessagePart
581 ],
582 },
583 "snippet": "A String", # A short part of the message text.
584 "raw": "A String", # The entire email message in an RFC 2822 formatted and URL-safe base64 encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied.
585 "sizeEstimate": 42, # Estimated size in bytes of the message.
586 "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:
587 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
588 # - The References and In-Reply-To headers must be set in compliance with the <a href="https://tools.ietf.org/html/rfc2822"RFC 2822 standard.
589 # - The Subject headers must match.
590 "labelIds": [ # List of IDs of labels applied to this message.
591 "A String",
592 ],
593 "id": "A String", # The immutable ID of the message.
594 }</pre>
595</div>
596
597<div class="method">
598 <code class="details" id="untrash">untrash(userId, id)</code>
599 <pre>Removes the specified message from the trash.
600
601Args:
602 userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
603 id: string, The ID of the message to remove from Trash. (required)
604
605Returns:
606 An object of the form:
607
608 { # An email message.
609 "historyId": "A String", # The ID of the last history record that modified this message.
610 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
611 "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.
612 "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.
613 "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.
614 "size": 42, # Total number of bytes in the body of the message part.
615 },
616 "mimeType": "A String", # The MIME type of the message part.
617 "partId": "A String", # The immutable ID of the message part.
618 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
619 "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.
620 {
621 "name": "A String", # The name of the header before the : separator. For example, To.
622 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
623 },
624 ],
625 "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.
626 # Object with schema name: MessagePart
627 ],
628 },
629 "snippet": "A String", # A short part of the message text.
630 "raw": "A String", # The entire email message in an RFC 2822 formatted and URL-safe base64 encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied.
631 "sizeEstimate": 42, # Estimated size in bytes of the message.
632 "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:
633 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
634 # - The References and In-Reply-To headers must be set in compliance with the <a href="https://tools.ietf.org/html/rfc2822"RFC 2822 standard.
635 # - The Subject headers must match.
636 "labelIds": [ # List of IDs of labels applied to this message.
637 "A String",
638 ],
639 "id": "A String", # The immutable ID of the message.
640 }</pre>
641</div>
642
643</body></html>