blob: aaecfb60b78848b7069384cc0b310c5fa7581cf9 [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">
81 <code><a href="#get">get(userId, id)</a></code></p>
82<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">
110 <code class="details" id="get">get(userId, id)</code>
111 <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)
116
117Returns:
118 An object of the form:
119
120 { # A collection of messages representing a conversation.
121 "snippet": "A String", # A short part of the message text.
122 "messages": [ # The list of messages in the thread.
123 { # An email message.
124 "historyId": "A String", # The ID of the last history record that modified this message.
125 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
126 "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.
127 "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.
128 "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.
129 "size": 42, # Total number of bytes in the body of the message part.
130 },
131 "mimeType": "A String", # The MIME type of the message part.
132 "partId": "A String", # The immutable ID of the message part.
133 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
134 "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.
135 {
136 "name": "A String", # The name of the header before the : separator. For example, To.
137 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
138 },
139 ],
140 "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.
141 # Object with schema name: MessagePart
142 ],
143 },
144 "snippet": "A String", # A short part of the message text.
145 "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.
146 "sizeEstimate": 42, # Estimated size in bytes of the message.
147 "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:
148 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700149 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
Craig Citro065b5302014-08-14 00:47:23 -0700150 # - The Subject headers must match.
151 "labelIds": [ # List of IDs of labels applied to this message.
152 "A String",
153 ],
154 "id": "A String", # The immutable ID of the message.
155 },
156 ],
157 "id": "A String", # The unique ID of the thread.
158 "historyId": "A String", # The ID of the last history record that modified this thread.
159 }</pre>
160</div>
161
162<div class="method">
163 <code class="details" id="list">list(userId, labelIds=None, q=None, pageToken=None, maxResults=None, includeSpamTrash=None)</code>
164 <pre>Lists the threads in the user's mailbox.
165
166Args:
167 userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
168 labelIds: string, Only return threads with labels that match all of the specified label IDs. (repeated)
169 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".
170 pageToken: string, Page token to retrieve a specific page of results in the list.
171 maxResults: integer, Maximum number of threads to return.
172 includeSpamTrash: boolean, Include threads from SPAM and TRASH in the results.
173
174Returns:
175 An object of the form:
176
177 {
178 "nextPageToken": "A String", # Page token to retrieve the next page of results in the list.
179 "resultSizeEstimate": 42, # Estimated total number of results.
180 "threads": [ # List of threads.
181 { # A collection of messages representing a conversation.
182 "snippet": "A String", # A short part of the message text.
183 "messages": [ # The list of messages in the thread.
184 { # An email message.
185 "historyId": "A String", # The ID of the last history record that modified this message.
186 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
187 "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.
188 "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.
189 "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.
190 "size": 42, # Total number of bytes in the body of the message part.
191 },
192 "mimeType": "A String", # The MIME type of the message part.
193 "partId": "A String", # The immutable ID of the message part.
194 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
195 "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.
196 {
197 "name": "A String", # The name of the header before the : separator. For example, To.
198 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
199 },
200 ],
201 "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.
202 # Object with schema name: MessagePart
203 ],
204 },
205 "snippet": "A String", # A short part of the message text.
206 "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.
207 "sizeEstimate": 42, # Estimated size in bytes of the message.
208 "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:
209 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700210 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
Craig Citro065b5302014-08-14 00:47:23 -0700211 # - The Subject headers must match.
212 "labelIds": [ # List of IDs of labels applied to this message.
213 "A String",
214 ],
215 "id": "A String", # The immutable ID of the message.
216 },
217 ],
218 "id": "A String", # The unique ID of the thread.
219 "historyId": "A String", # The ID of the last history record that modified this thread.
220 },
221 ],
222 }</pre>
223</div>
224
225<div class="method">
226 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
227 <pre>Retrieves the next page of results.
228
229Args:
230 previous_request: The request for the previous page. (required)
231 previous_response: The response from the request for the previous page. (required)
232
233Returns:
234 A request object that you can call 'execute()' on to request the next
235 page. Returns None if there are no more items in the collection.
236 </pre>
237</div>
238
239<div class="method">
240 <code class="details" id="modify">modify(userId, id, body)</code>
241 <pre>Modifies the labels applied to the thread. This applies to all messages in the thread.
242
243Args:
244 userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
245 id: string, The ID of the thread to modify. (required)
246 body: object, The request body. (required)
247 The object takes the form of:
248
249{
250 "removeLabelIds": [ # A list of IDs of labels to remove from this thread.
251 "A String",
252 ],
253 "addLabelIds": [ # A list of IDs of labels to add to this thread.
254 "A String",
255 ],
256 }
257
258
259Returns:
260 An object of the form:
261
262 { # A collection of messages representing a conversation.
263 "snippet": "A String", # A short part of the message text.
264 "messages": [ # The list of messages in the thread.
265 { # An email message.
266 "historyId": "A String", # The ID of the last history record that modified this message.
267 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
268 "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.
269 "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.
270 "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.
271 "size": 42, # Total number of bytes in the body of the message part.
272 },
273 "mimeType": "A String", # The MIME type of the message part.
274 "partId": "A String", # The immutable ID of the message part.
275 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
276 "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.
277 {
278 "name": "A String", # The name of the header before the : separator. For example, To.
279 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
280 },
281 ],
282 "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.
283 # Object with schema name: MessagePart
284 ],
285 },
286 "snippet": "A String", # A short part of the message text.
287 "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.
288 "sizeEstimate": 42, # Estimated size in bytes of the message.
289 "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:
290 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700291 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
Craig Citro065b5302014-08-14 00:47:23 -0700292 # - The Subject headers must match.
293 "labelIds": [ # List of IDs of labels applied to this message.
294 "A String",
295 ],
296 "id": "A String", # The immutable ID of the message.
297 },
298 ],
299 "id": "A String", # The unique ID of the thread.
300 "historyId": "A String", # The ID of the last history record that modified this thread.
301 }</pre>
302</div>
303
304<div class="method">
305 <code class="details" id="trash">trash(userId, id)</code>
306 <pre>Moves the specified thread to the trash.
307
308Args:
309 userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
310 id: string, The ID of the thread to Trash. (required)
311
312Returns:
313 An object of the form:
314
315 { # A collection of messages representing a conversation.
316 "snippet": "A String", # A short part of the message text.
317 "messages": [ # The list of messages in the thread.
318 { # An email message.
319 "historyId": "A String", # The ID of the last history record that modified this message.
320 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
321 "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.
322 "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.
323 "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.
324 "size": 42, # Total number of bytes in the body of the message part.
325 },
326 "mimeType": "A String", # The MIME type of the message part.
327 "partId": "A String", # The immutable ID of the message part.
328 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
329 "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.
330 {
331 "name": "A String", # The name of the header before the : separator. For example, To.
332 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
333 },
334 ],
335 "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.
336 # Object with schema name: MessagePart
337 ],
338 },
339 "snippet": "A String", # A short part of the message text.
340 "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.
341 "sizeEstimate": 42, # Estimated size in bytes of the message.
342 "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:
343 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700344 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
Craig Citro065b5302014-08-14 00:47:23 -0700345 # - The Subject headers must match.
346 "labelIds": [ # List of IDs of labels applied to this message.
347 "A String",
348 ],
349 "id": "A String", # The immutable ID of the message.
350 },
351 ],
352 "id": "A String", # The unique ID of the thread.
353 "historyId": "A String", # The ID of the last history record that modified this thread.
354 }</pre>
355</div>
356
357<div class="method">
358 <code class="details" id="untrash">untrash(userId, id)</code>
359 <pre>Removes the specified thread from the trash.
360
361Args:
362 userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
363 id: string, The ID of the thread to remove from Trash. (required)
364
365Returns:
366 An object of the form:
367
368 { # A collection of messages representing a conversation.
369 "snippet": "A String", # A short part of the message text.
370 "messages": [ # The list of messages in the thread.
371 { # An email message.
372 "historyId": "A String", # The ID of the last history record that modified this message.
373 "payload": { # A single MIME message part. # The parsed email structure in the message parts.
374 "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.
375 "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.
376 "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.
377 "size": 42, # Total number of bytes in the body of the message part.
378 },
379 "mimeType": "A String", # The MIME type of the message part.
380 "partId": "A String", # The immutable ID of the message part.
381 "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment.
382 "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.
383 {
384 "name": "A String", # The name of the header before the : separator. For example, To.
385 "value": "A String", # The value of the header after the : separator. For example, someuser@example.com.
386 },
387 ],
388 "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.
389 # Object with schema name: MessagePart
390 ],
391 },
392 "snippet": "A String", # A short part of the message text.
393 "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.
394 "sizeEstimate": 42, # Estimated size in bytes of the message.
395 "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:
396 # - The requested threadId must be specified on the Message or Draft.Message you supply with your request.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700397 # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
Craig Citro065b5302014-08-14 00:47:23 -0700398 # - The Subject headers must match.
399 "labelIds": [ # List of IDs of labels applied to this message.
400 "A String",
401 ],
402 "id": "A String", # The immutable ID of the message.
403 },
404 ],
405 "id": "A String", # The unique ID of the thread.
406 "historyId": "A String", # The ID of the last history record that modified this thread.
407 }</pre>
408</div>
409
410</body></html>