blob: b748a070f139748484bb6aacf2af0e79584ed8c2 [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.threads.html">threads</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#delete">delete(userId, id)</a></code></p>
79<p class="firstline">Immediately and permanently deletes the specified thread. This operation cannot be undone. Prefer threads.trash instead.</p>
80<p class="toc_element">
Craig Citroe633be12015-03-02 13:40:36 -080081 <code><a href="#get">get(userId, id, format=None, metadataHeaders=None)</a></code></p>
Craig Citro065b5302014-08-14 00:47:23 -070082<p class="firstline">Gets the specified thread.</p>
83<p class="toc_element">
84 <code><a href="#list">list(userId, labelIds=None, q=None, pageToken=None, maxResults=None, includeSpamTrash=None)</a></code></p>
85<p class="firstline">Lists the threads in the user's mailbox.</p>
86<p class="toc_element">
87 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
88<p class="firstline">Retrieves the next page of results.</p>
89<p class="toc_element">
90 <code><a href="#modify">modify(userId, id, body)</a></code></p>
91<p class="firstline">Modifies the labels applied to the thread. This applies to all messages in the thread.</p>
92<p class="toc_element">
93 <code><a href="#trash">trash(userId, id)</a></code></p>
94<p class="firstline">Moves the specified thread to the trash.</p>
95<p class="toc_element">
96 <code><a href="#untrash">untrash(userId, id)</a></code></p>
97<p class="firstline">Removes the specified thread from the trash.</p>
98<h3>Method Details</h3>
99<div class="method">
100 <code class="details" id="delete">delete(userId, id)</code>
101 <pre>Immediately and permanently deletes the specified thread. This operation cannot be undone. Prefer threads.trash instead.
102
103Args:
104 userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
105 id: string, ID of the Thread to delete. (required)
106</pre>
107</div>
108
109<div class="method">
Craig Citroe633be12015-03-02 13:40:36 -0800110 <code class="details" id="get">get(userId, id, format=None, metadataHeaders=None)</code>
Craig Citro065b5302014-08-14 00:47:23 -0700111 <pre>Gets the specified thread.
112
113Args:
114 userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
115 id: string, The ID of the thread to retrieve. (required)
Craig Citroe633be12015-03-02 13:40:36 -0800116 format: string, The format to return the messages in.
117 Allowed values
118 full -
119 metadata -
120 minimal -
121 metadataHeaders: string, When given and format is METADATA, only include headers specified. (repeated)
Craig Citro065b5302014-08-14 00:47:23 -0700122
123Returns:
124 An object of the form:
125
126 { # A collection of messages representing a conversation.
127 "snippet": "A String", # A short part of the message text.
128 "messages": [ # The list of messages in the thread.
129 { # An email message.
130 "historyId": "A String", # The ID of the last history record that modified this message.
131 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
132 "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.
133 "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.
134 "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.
135 "size": 42, # Total number of bytes in the body of the message part.
136 },
137 "mimeType": "A String", # The MIME type of the message part.
138 "partId": "A String", # The immutable ID of the message part.
139 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
140 "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.
141 {
142 "name": "A String", # The name of the header before the : separator. For example, To.
143 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
144 },
145 ],
146 "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.
147 # Object with schema name: MessagePart
148 ],
149 },
150 "snippet": "A String", # A short part of the message text.
Craig Citroe633be12015-03-02 13:40:36 -0800151 "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 -0700152 "sizeEstimate": 42, # Estimated size in bytes of the message.
153 "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:
154 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700155 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
Craig Citro065b5302014-08-14 00:47:23 -0700156 # - The Subject headers must match.
157 "labelIds": [ # List of IDs of labels applied to this message.
158 "A String",
159 ],
160 "id": "A String", # The immutable ID of the message.
161 },
162 ],
163 "id": "A String", # The unique ID of the thread.
164 "historyId": "A String", # The ID of the last history record that modified this thread.
165 }</pre>
166</div>
167
168<div class="method">
169 <code class="details" id="list">list(userId, labelIds=None, q=None, pageToken=None, maxResults=None, includeSpamTrash=None)</code>
170 <pre>Lists the threads in the user's mailbox.
171
172Args:
173 userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
174 labelIds: string, Only return threads with labels that match all of the specified label IDs. (repeated)
175 q: string, Only return threads matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread".
176 pageToken: string, Page token to retrieve a specific page of results in the list.
177 maxResults: integer, Maximum number of threads to return.
178 includeSpamTrash: boolean, Include threads from SPAM and TRASH in the results.
179
180Returns:
181 An object of the form:
182
183 {
184 "nextPageToken": "A String", # Page token to retrieve the next page of results in the list.
185 "resultSizeEstimate": 42, # Estimated total number of results.
186 "threads": [ # List of threads.
187 { # A collection of messages representing a conversation.
188 "snippet": "A String", # A short part of the message text.
189 "messages": [ # The list of messages in the thread.
190 { # An email message.
191 "historyId": "A String", # The ID of the last history record that modified this message.
192 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
193 "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.
194 "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.
195 "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.
196 "size": 42, # Total number of bytes in the body of the message part.
197 },
198 "mimeType": "A String", # The MIME type of the message part.
199 "partId": "A String", # The immutable ID of the message part.
200 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
201 "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.
202 {
203 "name": "A String", # The name of the header before the : separator. For example, To.
204 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
205 },
206 ],
207 "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.
208 # Object with schema name: MessagePart
209 ],
210 },
211 "snippet": "A String", # A short part of the message text.
Craig Citroe633be12015-03-02 13:40:36 -0800212 "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 -0700213 "sizeEstimate": 42, # Estimated size in bytes of the message.
214 "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:
215 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700216 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
Craig Citro065b5302014-08-14 00:47:23 -0700217 # - The Subject headers must match.
218 "labelIds": [ # List of IDs of labels applied to this message.
219 "A String",
220 ],
221 "id": "A String", # The immutable ID of the message.
222 },
223 ],
224 "id": "A String", # The unique ID of the thread.
225 "historyId": "A String", # The ID of the last history record that modified this thread.
226 },
227 ],
228 }</pre>
229</div>
230
231<div class="method">
232 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
233 <pre>Retrieves the next page of results.
234
235Args:
236 previous_request: The request for the previous page. (required)
237 previous_response: The response from the request for the previous page. (required)
238
239Returns:
240 A request object that you can call 'execute()' on to request the next
241 page. Returns None if there are no more items in the collection.
242 </pre>
243</div>
244
245<div class="method">
246 <code class="details" id="modify">modify(userId, id, body)</code>
247 <pre>Modifies the labels applied to the thread. This applies to all messages in the thread.
248
249Args:
250 userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
251 id: string, The ID of the thread to modify. (required)
252 body: object, The request body. (required)
253 The object takes the form of:
254
255{
256 "removeLabelIds": [ # A list of IDs of labels to remove from this thread.
257 "A String",
258 ],
259 "addLabelIds": [ # A list of IDs of labels to add to this thread.
260 "A String",
261 ],
262 }
263
264
265Returns:
266 An object of the form:
267
268 { # A collection of messages representing a conversation.
269 "snippet": "A String", # A short part of the message text.
270 "messages": [ # The list of messages in the thread.
271 { # An email message.
272 "historyId": "A String", # The ID of the last history record that modified this message.
273 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
274 "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.
275 "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.
276 "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.
277 "size": 42, # Total number of bytes in the body of the message part.
278 },
279 "mimeType": "A String", # The MIME type of the message part.
280 "partId": "A String", # The immutable ID of the message part.
281 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
282 "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.
283 {
284 "name": "A String", # The name of the header before the : separator. For example, To.
285 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
286 },
287 ],
288 "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.
289 # Object with schema name: MessagePart
290 ],
291 },
292 "snippet": "A String", # A short part of the message text.
Craig Citroe633be12015-03-02 13:40:36 -0800293 "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 -0700294 "sizeEstimate": 42, # Estimated size in bytes of the message.
295 "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:
296 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700297 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
Craig Citro065b5302014-08-14 00:47:23 -0700298 # - The Subject headers must match.
299 "labelIds": [ # List of IDs of labels applied to this message.
300 "A String",
301 ],
302 "id": "A String", # The immutable ID of the message.
303 },
304 ],
305 "id": "A String", # The unique ID of the thread.
306 "historyId": "A String", # The ID of the last history record that modified this thread.
307 }</pre>
308</div>
309
310<div class="method">
311 <code class="details" id="trash">trash(userId, id)</code>
312 <pre>Moves the specified thread to the trash.
313
314Args:
315 userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
316 id: string, The ID of the thread to Trash. (required)
317
318Returns:
319 An object of the form:
320
321 { # A collection of messages representing a conversation.
322 "snippet": "A String", # A short part of the message text.
323 "messages": [ # The list of messages in the thread.
324 { # An email message.
325 "historyId": "A String", # The ID of the last history record that modified this message.
326 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
327 "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.
328 "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.
329 "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.
330 "size": 42, # Total number of bytes in the body of the message part.
331 },
332 "mimeType": "A String", # The MIME type of the message part.
333 "partId": "A String", # The immutable ID of the message part.
334 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
335 "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.
336 {
337 "name": "A String", # The name of the header before the : separator. For example, To.
338 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
339 },
340 ],
341 "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.
342 # Object with schema name: MessagePart
343 ],
344 },
345 "snippet": "A String", # A short part of the message text.
Craig Citroe633be12015-03-02 13:40:36 -0800346 "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 -0700347 "sizeEstimate": 42, # Estimated size in bytes of the message.
348 "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:
349 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700350 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
Craig Citro065b5302014-08-14 00:47:23 -0700351 # - The Subject headers must match.
352 "labelIds": [ # List of IDs of labels applied to this message.
353 "A String",
354 ],
355 "id": "A String", # The immutable ID of the message.
356 },
357 ],
358 "id": "A String", # The unique ID of the thread.
359 "historyId": "A String", # The ID of the last history record that modified this thread.
360 }</pre>
361</div>
362
363<div class="method">
364 <code class="details" id="untrash">untrash(userId, id)</code>
365 <pre>Removes the specified thread from the trash.
366
367Args:
368 userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
369 id: string, The ID of the thread to remove from Trash. (required)
370
371Returns:
372 An object of the form:
373
374 { # A collection of messages representing a conversation.
375 "snippet": "A String", # A short part of the message text.
376 "messages": [ # The list of messages in the thread.
377 { # An email message.
378 "historyId": "A String", # The ID of the last history record that modified this message.
379 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
380 "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.
381 "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.
382 "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.
383 "size": 42, # Total number of bytes in the body of the message part.
384 },
385 "mimeType": "A String", # The MIME type of the message part.
386 "partId": "A String", # The immutable ID of the message part.
387 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
388 "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.
389 {
390 "name": "A String", # The name of the header before the : separator. For example, To.
391 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
392 },
393 ],
394 "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.
395 # Object with schema name: MessagePart
396 ],
397 },
398 "snippet": "A String", # A short part of the message text.
Craig Citroe633be12015-03-02 13:40:36 -0800399 "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 -0700400 "sizeEstimate": 42, # Estimated size in bytes of the message.
401 "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:
402 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700403 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
Craig Citro065b5302014-08-14 00:47:23 -0700404 # - The Subject headers must match.
405 "labelIds": [ # List of IDs of labels applied to this message.
406 "A String",
407 ],
408 "id": "A String", # The immutable ID of the message.
409 },
410 ],
411 "id": "A String", # The unique ID of the thread.
412 "historyId": "A String", # The ID of the last history record that modified this thread.
413 }</pre>
414</div>
415
416</body></html>