blob: b712e94c115abbe1921114fea98c5e97d029bfc8 [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">
Craig Citro0e5b9bf2014-10-15 10:26:14 -070086 <code><a href="#get">get(userId, id, format=None, metadataHeaders=None)</a></code></p>
Craig Citro065b5302014-08-14 00:47:23 -070087<p class="firstline">Gets the specified message.</p>
88<p class="toc_element">
Craig Citroe633be12015-03-02 13:40:36 -080089 <code><a href="#import_">import_(userId, body=None, media_body=None, internalDateSource=None, neverMarkSpam=None, processForCalendar=None, deleted=None)</a></code></p>
Craig Citro0e5b9bf2014-10-15 10:26:14 -070090<p class="firstline">Imports a message into only this user's mailbox, with standard email delivery scanning and classification similar to receiving via SMTP. Does not send a message.</p>
Craig Citro065b5302014-08-14 00:47:23 -070091<p class="toc_element">
Nathaniel Manista4f877e52015-06-15 16:44:50 +000092 <code><a href="#insert">insert(userId, body=None, media_body=None, internalDateSource=None, deleted=None)</a></code></p>
Craig Citro0e5b9bf2014-10-15 10:26:14 -070093<p class="firstline">Directly inserts a message into only this user's mailbox similar to IMAP APPEND, bypassing most scanning and classification. Does not send a message.</p>
Craig Citro065b5302014-08-14 00:47:23 -070094<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">
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700124 <code class="details" id="get">get(userId, id, format=None, metadataHeaders=None)</code>
Craig Citro065b5302014-08-14 00:47:23 -0700125 <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 -
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700133 metadata -
Craig Citro065b5302014-08-14 00:47:23 -0700134 minimal -
135 raw -
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700136 metadataHeaders: string, When given and format is METADATA, only include headers specified. (repeated)
Craig Citro065b5302014-08-14 00:47:23 -0700137
138Returns:
139 An object of the form:
140
141 { # An email message.
142 "historyId": "A String", # The ID of the last history record that modified this message.
143 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
144 "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.
145 "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.
146 "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.
147 "size": 42, # Total number of bytes in the body of the message part.
148 },
149 "mimeType": "A String", # The MIME type of the message part.
150 "partId": "A String", # The immutable ID of the message part.
151 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
152 "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.
153 {
154 "name": "A String", # The name of the header before the : separator. For example, To.
155 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
156 },
157 ],
158 "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.
159 # Object with schema name: MessagePart
160 ],
161 },
162 "snippet": "A String", # A short part of the message text.
Craig Citroe633be12015-03-02 13:40:36 -0800163 "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 -0700164 "sizeEstimate": 42, # Estimated size in bytes of the message.
165 "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:
166 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700167 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
Craig Citro065b5302014-08-14 00:47:23 -0700168 # - The Subject headers must match.
169 "labelIds": [ # List of IDs of labels applied to this message.
170 "A String",
171 ],
172 "id": "A String", # The immutable ID of the message.
173 }</pre>
174</div>
175
176<div class="method">
Craig Citroe633be12015-03-02 13:40:36 -0800177 <code class="details" id="import_">import_(userId, body=None, media_body=None, internalDateSource=None, neverMarkSpam=None, processForCalendar=None, deleted=None)</code>
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700178 <pre>Imports a message into only this user's mailbox, with standard email delivery scanning and classification similar to receiving via SMTP. Does not send a message.
Craig Citro065b5302014-08-14 00:47:23 -0700179
180Args:
181 userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
182 body: object, The request body.
183 The object takes the form of:
184
185{ # An email message.
186 "historyId": "A String", # The ID of the last history record that modified this message.
187 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
188 "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.
189 "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.
190 "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.
191 "size": 42, # Total number of bytes in the body of the message part.
192 },
193 "mimeType": "A String", # The MIME type of the message part.
194 "partId": "A String", # The immutable ID of the message part.
195 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
196 "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.
197 {
198 "name": "A String", # The name of the header before the : separator. For example, To.
199 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
200 },
201 ],
202 "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.
203 # Object with schema name: MessagePart
204 ],
205 },
206 "snippet": "A String", # A short part of the message text.
Craig Citroe633be12015-03-02 13:40:36 -0800207 "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 -0700208 "sizeEstimate": 42, # Estimated size in bytes of the message.
209 "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:
210 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700211 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
Craig Citro065b5302014-08-14 00:47:23 -0700212 # - The Subject headers must match.
213 "labelIds": [ # List of IDs of labels applied to this message.
214 "A String",
215 ],
216 "id": "A String", # The immutable ID of the message.
217}
218
219 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700220 internalDateSource: string, Source for Gmail's internal date of the message.
221 Allowed values
222 dateHeader -
223 receivedTime -
Craig Citroe633be12015-03-02 13:40:36 -0800224 neverMarkSpam: boolean, Ignore the Gmail spam classifier decision and never mark this email as SPAM in the mailbox.
225 processForCalendar: boolean, Process calendar invites in the email and add any extracted meetings to the Google Calendar for this user.
226 deleted: boolean, Mark the email as permanently deleted (not TRASH) and only visible in Google Apps Vault to a Vault administrator. Only used for Google Apps for Work accounts.
Craig Citro065b5302014-08-14 00:47:23 -0700227
228Returns:
229 An object of the form:
230
231 { # An email message.
232 "historyId": "A String", # The ID of the last history record that modified this message.
233 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
234 "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.
235 "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.
236 "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.
237 "size": 42, # Total number of bytes in the body of the message part.
238 },
239 "mimeType": "A String", # The MIME type of the message part.
240 "partId": "A String", # The immutable ID of the message part.
241 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
242 "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.
243 {
244 "name": "A String", # The name of the header before the : separator. For example, To.
245 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
246 },
247 ],
248 "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.
249 # Object with schema name: MessagePart
250 ],
251 },
252 "snippet": "A String", # A short part of the message text.
Craig Citroe633be12015-03-02 13:40:36 -0800253 "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 -0700254 "sizeEstimate": 42, # Estimated size in bytes of the message.
255 "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:
256 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700257 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
Craig Citro065b5302014-08-14 00:47:23 -0700258 # - The Subject headers must match.
259 "labelIds": [ # List of IDs of labels applied to this message.
260 "A String",
261 ],
262 "id": "A String", # The immutable ID of the message.
263 }</pre>
264</div>
265
266<div class="method">
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000267 <code class="details" id="insert">insert(userId, body=None, media_body=None, internalDateSource=None, deleted=None)</code>
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700268 <pre>Directly inserts a message into only this user's mailbox similar to IMAP APPEND, bypassing most scanning and classification. Does not send a message.
Craig Citro065b5302014-08-14 00:47:23 -0700269
270Args:
271 userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
272 body: object, The request body.
273 The object takes the form of:
274
275{ # An email message.
276 "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
309 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700310 internalDateSource: string, Source for Gmail's internal date of the message.
311 Allowed values
312 dateHeader -
313 receivedTime -
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000314 deleted: boolean, Mark the email as permanently deleted (not TRASH) and only visible in Google Apps Vault to a Vault administrator. Only used for Google Apps for Work accounts.
Craig Citro065b5302014-08-14 00:47:23 -0700315
316Returns:
317 An object of the form:
318
319 { # An email message.
320 "historyId": "A String", # The ID of the last history record that modified this message.
321 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
322 "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.
323 "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.
324 "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.
325 "size": 42, # Total number of bytes in the body of the message part.
326 },
327 "mimeType": "A String", # The MIME type of the message part.
328 "partId": "A String", # The immutable ID of the message part.
329 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
330 "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.
331 {
332 "name": "A String", # The name of the header before the : separator. For example, To.
333 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
334 },
335 ],
336 "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.
337 # Object with schema name: MessagePart
338 ],
339 },
340 "snippet": "A String", # A short part of the message text.
Craig Citroe633be12015-03-02 13:40:36 -0800341 "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 -0700342 "sizeEstimate": 42, # Estimated size in bytes of the message.
343 "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:
344 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700345 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
Craig Citro065b5302014-08-14 00:47:23 -0700346 # - The Subject headers must match.
347 "labelIds": [ # List of IDs of labels applied to this message.
348 "A String",
349 ],
350 "id": "A String", # The immutable ID of the message.
351 }</pre>
352</div>
353
354<div class="method">
355 <code class="details" id="list">list(userId, labelIds=None, q=None, pageToken=None, maxResults=None, includeSpamTrash=None)</code>
356 <pre>Lists the messages in the user's mailbox.
357
358Args:
359 userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
360 labelIds: string, Only return messages with labels that match all of the specified label IDs. (repeated)
361 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".
362 pageToken: string, Page token to retrieve a specific page of results in the list.
363 maxResults: integer, Maximum number of messages to return.
364 includeSpamTrash: boolean, Include messages from SPAM and TRASH in the results.
365
366Returns:
367 An object of the form:
368
369 {
370 "nextPageToken": "A String", # Token to retrieve the next page of results in the list.
371 "resultSizeEstimate": 42, # Estimated total number of results.
372 "messages": [ # List of messages.
373 { # An email message.
374 "historyId": "A String", # The ID of the last history record that modified this message.
375 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
376 "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.
377 "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.
378 "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.
379 "size": 42, # Total number of bytes in the body of the message part.
380 },
381 "mimeType": "A String", # The MIME type of the message part.
382 "partId": "A String", # The immutable ID of the message part.
383 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
384 "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.
385 {
386 "name": "A String", # The name of the header before the : separator. For example, To.
387 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
388 },
389 ],
390 "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.
391 # Object with schema name: MessagePart
392 ],
393 },
394 "snippet": "A String", # A short part of the message text.
Craig Citroe633be12015-03-02 13:40:36 -0800395 "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 -0700396 "sizeEstimate": 42, # Estimated size in bytes of the message.
397 "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:
398 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700399 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
Craig Citro065b5302014-08-14 00:47:23 -0700400 # - The Subject headers must match.
401 "labelIds": [ # List of IDs of labels applied to this message.
402 "A String",
403 ],
404 "id": "A String", # The immutable ID of the message.
405 },
406 ],
407 }</pre>
408</div>
409
410<div class="method">
411 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
412 <pre>Retrieves the next page of results.
413
414Args:
415 previous_request: The request for the previous page. (required)
416 previous_response: The response from the request for the previous page. (required)
417
418Returns:
419 A request object that you can call 'execute()' on to request the next
420 page. Returns None if there are no more items in the collection.
421 </pre>
422</div>
423
424<div class="method">
425 <code class="details" id="modify">modify(userId, id, body)</code>
426 <pre>Modifies the labels on the specified message.
427
428Args:
429 userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
430 id: string, The ID of the message to modify. (required)
431 body: object, The request body. (required)
432 The object takes the form of:
433
434{
435 "removeLabelIds": [ # A list IDs of labels to remove from this message.
436 "A String",
437 ],
438 "addLabelIds": [ # A list of IDs of labels to add to this message.
439 "A String",
440 ],
441 }
442
443
444Returns:
445 An object of the form:
446
447 { # An email message.
448 "historyId": "A String", # The ID of the last history record that modified this message.
449 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
450 "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.
451 "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.
452 "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.
453 "size": 42, # Total number of bytes in the body of the message part.
454 },
455 "mimeType": "A String", # The MIME type of the message part.
456 "partId": "A String", # The immutable ID of the message part.
457 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
458 "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.
459 {
460 "name": "A String", # The name of the header before the : separator. For example, To.
461 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
462 },
463 ],
464 "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.
465 # Object with schema name: MessagePart
466 ],
467 },
468 "snippet": "A String", # A short part of the message text.
Craig Citroe633be12015-03-02 13:40:36 -0800469 "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 -0700470 "sizeEstimate": 42, # Estimated size in bytes of the message.
471 "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:
472 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700473 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
Craig Citro065b5302014-08-14 00:47:23 -0700474 # - The Subject headers must match.
475 "labelIds": [ # List of IDs of labels applied to this message.
476 "A String",
477 ],
478 "id": "A String", # The immutable ID of the message.
479 }</pre>
480</div>
481
482<div class="method">
483 <code class="details" id="send">send(userId, body=None, media_body=None)</code>
484 <pre>Sends the specified message to the recipients in the To, Cc, and Bcc headers.
485
486Args:
487 userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
488 body: object, The request body.
489 The object takes the form of:
490
491{ # An email message.
492 "historyId": "A String", # The ID of the last history record that modified this message.
493 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
494 "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.
495 "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.
496 "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.
497 "size": 42, # Total number of bytes in the body of the message part.
498 },
499 "mimeType": "A String", # The MIME type of the message part.
500 "partId": "A String", # The immutable ID of the message part.
501 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
502 "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.
503 {
504 "name": "A String", # The name of the header before the : separator. For example, To.
505 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
506 },
507 ],
508 "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.
509 # Object with schema name: MessagePart
510 ],
511 },
512 "snippet": "A String", # A short part of the message text.
Craig Citroe633be12015-03-02 13:40:36 -0800513 "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 -0700514 "sizeEstimate": 42, # Estimated size in bytes of the message.
515 "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:
516 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700517 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
Craig Citro065b5302014-08-14 00:47:23 -0700518 # - The Subject headers must match.
519 "labelIds": [ # List of IDs of labels applied to this message.
520 "A String",
521 ],
522 "id": "A String", # The immutable ID of the message.
523}
524
525 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
526
527Returns:
528 An object of the form:
529
530 { # An email message.
531 "historyId": "A String", # The ID of the last history record that modified this message.
532 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
533 "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.
534 "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.
535 "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.
536 "size": 42, # Total number of bytes in the body of the message part.
537 },
538 "mimeType": "A String", # The MIME type of the message part.
539 "partId": "A String", # The immutable ID of the message part.
540 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
541 "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.
542 {
543 "name": "A String", # The name of the header before the : separator. For example, To.
544 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
545 },
546 ],
547 "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.
548 # Object with schema name: MessagePart
549 ],
550 },
551 "snippet": "A String", # A short part of the message text.
Craig Citroe633be12015-03-02 13:40:36 -0800552 "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 -0700553 "sizeEstimate": 42, # Estimated size in bytes of the message.
554 "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:
555 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700556 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
Craig Citro065b5302014-08-14 00:47:23 -0700557 # - The Subject headers must match.
558 "labelIds": [ # List of IDs of labels applied to this message.
559 "A String",
560 ],
561 "id": "A String", # The immutable ID of the message.
562 }</pre>
563</div>
564
565<div class="method">
566 <code class="details" id="trash">trash(userId, id)</code>
567 <pre>Moves the specified message to the trash.
568
569Args:
570 userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
571 id: string, The ID of the message to Trash. (required)
572
573Returns:
574 An object of the form:
575
576 { # An email message.
577 "historyId": "A String", # The ID of the last history record that modified this message.
578 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
579 "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.
580 "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.
581 "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.
582 "size": 42, # Total number of bytes in the body of the message part.
583 },
584 "mimeType": "A String", # The MIME type of the message part.
585 "partId": "A String", # The immutable ID of the message part.
586 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
587 "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.
588 {
589 "name": "A String", # The name of the header before the : separator. For example, To.
590 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
591 },
592 ],
593 "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.
594 # Object with schema name: MessagePart
595 ],
596 },
597 "snippet": "A String", # A short part of the message text.
Craig Citroe633be12015-03-02 13:40:36 -0800598 "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 -0700599 "sizeEstimate": 42, # Estimated size in bytes of the message.
600 "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:
601 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700602 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
Craig Citro065b5302014-08-14 00:47:23 -0700603 # - The Subject headers must match.
604 "labelIds": [ # List of IDs of labels applied to this message.
605 "A String",
606 ],
607 "id": "A String", # The immutable ID of the message.
608 }</pre>
609</div>
610
611<div class="method">
612 <code class="details" id="untrash">untrash(userId, id)</code>
613 <pre>Removes the specified message from the trash.
614
615Args:
616 userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
617 id: string, The ID of the message to remove from Trash. (required)
618
619Returns:
620 An object of the form:
621
622 { # An email message.
623 "historyId": "A String", # The ID of the last history record that modified this message.
624 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
625 "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.
626 "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.
627 "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.
628 "size": 42, # Total number of bytes in the body of the message part.
629 },
630 "mimeType": "A String", # The MIME type of the message part.
631 "partId": "A String", # The immutable ID of the message part.
632 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
633 "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.
634 {
635 "name": "A String", # The name of the header before the : separator. For example, To.
636 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
637 },
638 ],
639 "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.
640 # Object with schema name: MessagePart
641 ],
642 },
643 "snippet": "A String", # A short part of the message text.
Craig Citroe633be12015-03-02 13:40:36 -0800644 "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 -0700645 "sizeEstimate": 42, # Estimated size in bytes of the message.
646 "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:
647 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700648 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
Craig Citro065b5302014-08-14 00:47:23 -0700649 # - The Subject headers must match.
650 "labelIds": [ # List of IDs of labels applied to this message.
651 "A String",
652 ],
653 "id": "A String", # The immutable ID of the message.
654 }</pre>
655</div>
656
657</body></html>