Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 1 | <html><body> |
| 2 | <style> |
| 3 | |
| 4 | body, 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 | |
| 15 | body { |
| 16 | font-size: 13px; |
| 17 | padding: 1em; |
| 18 | } |
| 19 | |
| 20 | h1 { |
| 21 | font-size: 26px; |
| 22 | margin-bottom: 1em; |
| 23 | } |
| 24 | |
| 25 | h2 { |
| 26 | font-size: 24px; |
| 27 | margin-bottom: 1em; |
| 28 | } |
| 29 | |
| 30 | h3 { |
| 31 | font-size: 20px; |
| 32 | margin-bottom: 1em; |
| 33 | margin-top: 1em; |
| 34 | } |
| 35 | |
| 36 | pre, code { |
| 37 | line-height: 1.5; |
| 38 | font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; |
| 39 | } |
| 40 | |
| 41 | pre { |
| 42 | margin-top: 0.5em; |
| 43 | } |
| 44 | |
| 45 | h1, h2, h3, p { |
| 46 | font-family: Arial, sans serif; |
| 47 | } |
| 48 | |
| 49 | h1, 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"> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 78 | <code><a href="#close">close()</a></code></p> |
| 79 | <p class="firstline">Close httplib2 connections.</p> |
| 80 | <p class="toc_element"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 81 | <code><a href="#delete">delete(userId, id, x__xgafv=None)</a></code></p> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 82 | <p class="firstline">Immediately and permanently deletes the specified thread. This operation cannot be undone. Prefer `threads.trash` instead.</p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 83 | <p class="toc_element"> |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 84 | <code><a href="#get">get(userId, id, format=None, metadataHeaders=None, x__xgafv=None)</a></code></p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 85 | <p class="firstline">Gets the specified thread.</p> |
| 86 | <p class="toc_element"> |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 87 | <code><a href="#list">list(userId, pageToken=None, includeSpamTrash=None, q=None, maxResults=None, labelIds=None, x__xgafv=None)</a></code></p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 88 | <p class="firstline">Lists the threads in the user's mailbox.</p> |
| 89 | <p class="toc_element"> |
| 90 | <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> |
| 91 | <p class="firstline">Retrieves the next page of results.</p> |
| 92 | <p class="toc_element"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 93 | <code><a href="#modify">modify(userId, id, body=None, x__xgafv=None)</a></code></p> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 94 | <p class="firstline">Modifies the labels applied to the thread. This applies to all messages in the thread.</p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 95 | <p class="toc_element"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 96 | <code><a href="#trash">trash(userId, id, x__xgafv=None)</a></code></p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 97 | <p class="firstline">Moves the specified thread to the trash.</p> |
| 98 | <p class="toc_element"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 99 | <code><a href="#untrash">untrash(userId, id, x__xgafv=None)</a></code></p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 100 | <p class="firstline">Removes the specified thread from the trash.</p> |
| 101 | <h3>Method Details</h3> |
| 102 | <div class="method"> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 103 | <code class="details" id="close">close()</code> |
| 104 | <pre>Close httplib2 connections.</pre> |
| 105 | </div> |
| 106 | |
| 107 | <div class="method"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 108 | <code class="details" id="delete">delete(userId, id, x__xgafv=None)</code> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 109 | <pre>Immediately and permanently deletes the specified thread. This operation cannot be undone. Prefer `threads.trash` instead. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 110 | |
| 111 | Args: |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 112 | userId: string, The user's email address. The special value `me` can be used to indicate the authenticated user. (required) |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 113 | id: string, ID of the Thread to delete. (required) |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 114 | x__xgafv: string, V1 error format. |
| 115 | Allowed values |
| 116 | 1 - v1 error format |
| 117 | 2 - v2 error format |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 118 | </pre> |
| 119 | </div> |
| 120 | |
| 121 | <div class="method"> |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 122 | <code class="details" id="get">get(userId, id, format=None, metadataHeaders=None, x__xgafv=None)</code> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 123 | <pre>Gets the specified thread. |
| 124 | |
| 125 | Args: |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 126 | userId: string, The user's email address. The special value `me` can be used to indicate the authenticated user. (required) |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 127 | id: string, The ID of the thread to retrieve. (required) |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 128 | format: string, The format to return the messages in. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 129 | Allowed values |
| 130 | full - Returns the full email message data with body content parsed in the `payload` field; the `raw` field is not used. Format cannot be used when accessing the api using the gmail.metadata scope. |
| 131 | metadata - Returns only email message IDs, labels, and email headers. |
| 132 | minimal - Returns only email message IDs and labels; does not return the email headers, body, or payload. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 133 | metadataHeaders: string, When given and format is METADATA, only include headers specified. (repeated) |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 134 | x__xgafv: string, V1 error format. |
| 135 | Allowed values |
| 136 | 1 - v1 error format |
| 137 | 2 - v2 error format |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 138 | |
| 139 | Returns: |
| 140 | An object of the form: |
| 141 | |
| 142 | { # A collection of messages representing a conversation. |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame] | 143 | "id": "A String", # The unique ID of the thread. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 144 | "messages": [ # The list of messages in the thread. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 145 | { # An email message. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 146 | "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: 1. The requested `threadId` must be specified on the `Message` or `Draft.Message` you supply with your request. 2. The `References` and `In-Reply-To` headers must be set in compliance with the [RFC 2822](https://tools.ietf.org/html/rfc2822) standard. 3. The `Subject` headers must match. |
Yoshi Automation Bot | 0d561ef | 2020-11-25 07:50:41 -0800 | [diff] [blame] | 147 | "labelIds": [ # List of IDs of labels applied to this message. |
| 148 | "A String", |
| 149 | ], |
Yoshi Automation Bot | 0d561ef | 2020-11-25 07:50:41 -0800 | [diff] [blame] | 150 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 151 | "id": "A String", # The immutable ID of the message. |
| 152 | "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. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 153 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 154 | "mimeType": "A String", # The MIME type of the message part. |
| 155 | "partId": "A String", # The immutable ID of the message part. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 156 | "parts": [ # The child MIME message parts of this part. This only applies to container MIME message parts, for example `multipart/*`. For non- container MIME message part types, such as `text/plain`, this field is empty. For more information, see RFC 1521. |
| 157 | # Object with schema name: MessagePart |
| 158 | ], |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 159 | "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`. |
| 160 | { |
| 161 | "name": "A String", # The name of the header before the `:` separator. For example, `To`. |
| 162 | "value": "A String", # The value of the header after the `:` separator. For example, `someuser@example.com`. |
| 163 | }, |
| 164 | ], |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 165 | "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. |
| 166 | "data": "A String", # The body data of a MIME message part as a base64url encoded string. 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. |
| 167 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
| 168 | "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. |
| 169 | }, |
| 170 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 171 | }, |
Yoshi Automation Bot | 0d561ef | 2020-11-25 07:50:41 -0800 | [diff] [blame] | 172 | "snippet": "A String", # A short part of the message text. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 173 | "historyId": "A String", # The ID of the last history record that modified this message. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 174 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the `Date` header. However, for API-migrated mail, it can be configured by client to be based on the `Date` header. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 175 | }, |
| 176 | ], |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 177 | "historyId": "A String", # The ID of the last history record that modified this thread. |
| 178 | "snippet": "A String", # A short part of the message text. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 179 | }</pre> |
| 180 | </div> |
| 181 | |
| 182 | <div class="method"> |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 183 | <code class="details" id="list">list(userId, pageToken=None, includeSpamTrash=None, q=None, maxResults=None, labelIds=None, x__xgafv=None)</code> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 184 | <pre>Lists the threads in the user's mailbox. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 185 | |
| 186 | Args: |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 187 | userId: string, The user's email address. The special value `me` can be used to indicate the authenticated user. (required) |
Yoshi Automation Bot | 0d561ef | 2020-11-25 07:50:41 -0800 | [diff] [blame] | 188 | pageToken: string, Page token to retrieve a specific page of results in the list. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 189 | includeSpamTrash: boolean, Include threads from `SPAM` and `TRASH` in the results. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 190 | 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"`. Parameter cannot be used when accessing the api using the gmail.metadata scope. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 191 | maxResults: integer, Maximum number of threads to return. |
| 192 | labelIds: string, Only return threads with labels that match all of the specified label IDs. (repeated) |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 193 | x__xgafv: string, V1 error format. |
| 194 | Allowed values |
| 195 | 1 - v1 error format |
| 196 | 2 - v2 error format |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 197 | |
| 198 | Returns: |
| 199 | An object of the form: |
| 200 | |
| 201 | { |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 202 | "nextPageToken": "A String", # Page token to retrieve the next page of results in the list. |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame] | 203 | "resultSizeEstimate": 42, # Estimated total number of results. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 204 | "threads": [ # List of threads. Note that each thread resource does not contain a list of `messages`. The list of `messages` for a given thread can be fetched using the threads.get method. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 205 | { # A collection of messages representing a conversation. |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame] | 206 | "id": "A String", # The unique ID of the thread. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 207 | "messages": [ # The list of messages in the thread. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 208 | { # An email message. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 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: 1. The requested `threadId` must be specified on the `Message` or `Draft.Message` you supply with your request. 2. The `References` and `In-Reply-To` headers must be set in compliance with the [RFC 2822](https://tools.ietf.org/html/rfc2822) standard. 3. The `Subject` headers must match. |
Yoshi Automation Bot | 0d561ef | 2020-11-25 07:50:41 -0800 | [diff] [blame] | 210 | "labelIds": [ # List of IDs of labels applied to this message. |
| 211 | "A String", |
| 212 | ], |
Yoshi Automation Bot | 0d561ef | 2020-11-25 07:50:41 -0800 | [diff] [blame] | 213 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 214 | "id": "A String", # The immutable ID of the message. |
| 215 | "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. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 216 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 217 | "mimeType": "A String", # The MIME type of the message part. |
| 218 | "partId": "A String", # The immutable ID of the message part. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 219 | "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. |
| 220 | # Object with schema name: MessagePart |
| 221 | ], |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 222 | "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`. |
| 223 | { |
| 224 | "name": "A String", # The name of the header before the `:` separator. For example, `To`. |
| 225 | "value": "A String", # The value of the header after the `:` separator. For example, `someuser@example.com`. |
| 226 | }, |
| 227 | ], |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 228 | "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. |
| 229 | "data": "A String", # The body data of a MIME message part as a base64url encoded string. 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. |
| 230 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
| 231 | "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. |
| 232 | }, |
| 233 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 234 | }, |
Yoshi Automation Bot | 0d561ef | 2020-11-25 07:50:41 -0800 | [diff] [blame] | 235 | "snippet": "A String", # A short part of the message text. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 236 | "historyId": "A String", # The ID of the last history record that modified this message. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 237 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the `Date` header. However, for API-migrated mail, it can be configured by client to be based on the `Date` header. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 238 | }, |
| 239 | ], |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 240 | "historyId": "A String", # The ID of the last history record that modified this thread. |
| 241 | "snippet": "A String", # A short part of the message text. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 242 | }, |
| 243 | ], |
| 244 | }</pre> |
| 245 | </div> |
| 246 | |
| 247 | <div class="method"> |
| 248 | <code class="details" id="list_next">list_next(previous_request, previous_response)</code> |
| 249 | <pre>Retrieves the next page of results. |
| 250 | |
| 251 | Args: |
| 252 | previous_request: The request for the previous page. (required) |
| 253 | previous_response: The response from the request for the previous page. (required) |
| 254 | |
| 255 | Returns: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 256 | A request object that you can call 'execute()' on to request the next |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 257 | page. Returns None if there are no more items in the collection. |
| 258 | </pre> |
| 259 | </div> |
| 260 | |
| 261 | <div class="method"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 262 | <code class="details" id="modify">modify(userId, id, body=None, x__xgafv=None)</code> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 263 | <pre>Modifies the labels applied to the thread. This applies to all messages in the thread. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 264 | |
| 265 | Args: |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 266 | userId: string, The user's email address. The special value `me` can be used to indicate the authenticated user. (required) |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 267 | id: string, The ID of the thread to modify. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 268 | body: object, The request body. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 269 | The object takes the form of: |
| 270 | |
| 271 | { |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 272 | "removeLabelIds": [ # A list of IDs of labels to remove from this thread. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 273 | "A String", |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 274 | ], |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 275 | "addLabelIds": [ # A list of IDs of labels to add to this thread. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 276 | "A String", |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 277 | ], |
| 278 | } |
| 279 | |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 280 | x__xgafv: string, V1 error format. |
| 281 | Allowed values |
| 282 | 1 - v1 error format |
| 283 | 2 - v2 error format |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 284 | |
| 285 | Returns: |
| 286 | An object of the form: |
| 287 | |
| 288 | { # A collection of messages representing a conversation. |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame] | 289 | "id": "A String", # The unique ID of the thread. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 290 | "messages": [ # The list of messages in the thread. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 291 | { # An email message. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 292 | "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: 1. The requested `threadId` must be specified on the `Message` or `Draft.Message` you supply with your request. 2. The `References` and `In-Reply-To` headers must be set in compliance with the [RFC 2822](https://tools.ietf.org/html/rfc2822) standard. 3. The `Subject` headers must match. |
Yoshi Automation Bot | 0d561ef | 2020-11-25 07:50:41 -0800 | [diff] [blame] | 293 | "labelIds": [ # List of IDs of labels applied to this message. |
| 294 | "A String", |
| 295 | ], |
Yoshi Automation Bot | 0d561ef | 2020-11-25 07:50:41 -0800 | [diff] [blame] | 296 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 297 | "id": "A String", # The immutable ID of the message. |
| 298 | "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. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 299 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 300 | "mimeType": "A String", # The MIME type of the message part. |
| 301 | "partId": "A String", # The immutable ID of the message part. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 302 | "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. |
| 303 | # Object with schema name: MessagePart |
| 304 | ], |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 305 | "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`. |
| 306 | { |
| 307 | "name": "A String", # The name of the header before the `:` separator. For example, `To`. |
| 308 | "value": "A String", # The value of the header after the `:` separator. For example, `someuser@example.com`. |
| 309 | }, |
| 310 | ], |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 311 | "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. |
| 312 | "data": "A String", # The body data of a MIME message part as a base64url encoded string. 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. |
| 313 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
| 314 | "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. |
| 315 | }, |
| 316 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 317 | }, |
Yoshi Automation Bot | 0d561ef | 2020-11-25 07:50:41 -0800 | [diff] [blame] | 318 | "snippet": "A String", # A short part of the message text. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 319 | "historyId": "A String", # The ID of the last history record that modified this message. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 320 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the `Date` header. However, for API-migrated mail, it can be configured by client to be based on the `Date` header. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 321 | }, |
| 322 | ], |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 323 | "historyId": "A String", # The ID of the last history record that modified this thread. |
| 324 | "snippet": "A String", # A short part of the message text. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 325 | }</pre> |
| 326 | </div> |
| 327 | |
| 328 | <div class="method"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 329 | <code class="details" id="trash">trash(userId, id, x__xgafv=None)</code> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 330 | <pre>Moves the specified thread to the trash. |
| 331 | |
| 332 | Args: |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 333 | userId: string, The user's email address. The special value `me` can be used to indicate the authenticated user. (required) |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 334 | id: string, The ID of the thread to Trash. (required) |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 335 | x__xgafv: string, V1 error format. |
| 336 | Allowed values |
| 337 | 1 - v1 error format |
| 338 | 2 - v2 error format |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 339 | |
| 340 | Returns: |
| 341 | An object of the form: |
| 342 | |
| 343 | { # A collection of messages representing a conversation. |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame] | 344 | "id": "A String", # The unique ID of the thread. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 345 | "messages": [ # The list of messages in the thread. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 346 | { # An email message. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 347 | "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: 1. The requested `threadId` must be specified on the `Message` or `Draft.Message` you supply with your request. 2. The `References` and `In-Reply-To` headers must be set in compliance with the [RFC 2822](https://tools.ietf.org/html/rfc2822) standard. 3. The `Subject` headers must match. |
Yoshi Automation Bot | 0d561ef | 2020-11-25 07:50:41 -0800 | [diff] [blame] | 348 | "labelIds": [ # List of IDs of labels applied to this message. |
| 349 | "A String", |
| 350 | ], |
Yoshi Automation Bot | 0d561ef | 2020-11-25 07:50:41 -0800 | [diff] [blame] | 351 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 352 | "id": "A String", # The immutable ID of the message. |
| 353 | "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. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 354 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 355 | "mimeType": "A String", # The MIME type of the message part. |
| 356 | "partId": "A String", # The immutable ID of the message part. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 357 | "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. |
| 358 | # Object with schema name: MessagePart |
| 359 | ], |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 360 | "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`. |
| 361 | { |
| 362 | "name": "A String", # The name of the header before the `:` separator. For example, `To`. |
| 363 | "value": "A String", # The value of the header after the `:` separator. For example, `someuser@example.com`. |
| 364 | }, |
| 365 | ], |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 366 | "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. |
| 367 | "data": "A String", # The body data of a MIME message part as a base64url encoded string. 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. |
| 368 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
| 369 | "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. |
| 370 | }, |
| 371 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 372 | }, |
Yoshi Automation Bot | 0d561ef | 2020-11-25 07:50:41 -0800 | [diff] [blame] | 373 | "snippet": "A String", # A short part of the message text. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 374 | "historyId": "A String", # The ID of the last history record that modified this message. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 375 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the `Date` header. However, for API-migrated mail, it can be configured by client to be based on the `Date` header. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 376 | }, |
| 377 | ], |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 378 | "historyId": "A String", # The ID of the last history record that modified this thread. |
| 379 | "snippet": "A String", # A short part of the message text. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 380 | }</pre> |
| 381 | </div> |
| 382 | |
| 383 | <div class="method"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 384 | <code class="details" id="untrash">untrash(userId, id, x__xgafv=None)</code> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 385 | <pre>Removes the specified thread from the trash. |
| 386 | |
| 387 | Args: |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 388 | userId: string, The user's email address. The special value `me` can be used to indicate the authenticated user. (required) |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 389 | id: string, The ID of the thread to remove from Trash. (required) |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 390 | x__xgafv: string, V1 error format. |
| 391 | Allowed values |
| 392 | 1 - v1 error format |
| 393 | 2 - v2 error format |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 394 | |
| 395 | Returns: |
| 396 | An object of the form: |
| 397 | |
| 398 | { # A collection of messages representing a conversation. |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame] | 399 | "id": "A String", # The unique ID of the thread. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 400 | "messages": [ # The list of messages in the thread. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 401 | { # An email message. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 402 | "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: 1. The requested `threadId` must be specified on the `Message` or `Draft.Message` you supply with your request. 2. The `References` and `In-Reply-To` headers must be set in compliance with the [RFC 2822](https://tools.ietf.org/html/rfc2822) standard. 3. The `Subject` headers must match. |
Yoshi Automation Bot | 0d561ef | 2020-11-25 07:50:41 -0800 | [diff] [blame] | 403 | "labelIds": [ # List of IDs of labels applied to this message. |
| 404 | "A String", |
| 405 | ], |
Yoshi Automation Bot | 0d561ef | 2020-11-25 07:50:41 -0800 | [diff] [blame] | 406 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 407 | "id": "A String", # The immutable ID of the message. |
| 408 | "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. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 409 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 410 | "mimeType": "A String", # The MIME type of the message part. |
| 411 | "partId": "A String", # The immutable ID of the message part. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 412 | "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. |
| 413 | # Object with schema name: MessagePart |
| 414 | ], |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 415 | "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`. |
| 416 | { |
| 417 | "name": "A String", # The name of the header before the `:` separator. For example, `To`. |
| 418 | "value": "A String", # The value of the header after the `:` separator. For example, `someuser@example.com`. |
| 419 | }, |
| 420 | ], |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 421 | "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. |
| 422 | "data": "A String", # The body data of a MIME message part as a base64url encoded string. 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. |
| 423 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
| 424 | "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. |
| 425 | }, |
| 426 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 427 | }, |
Yoshi Automation Bot | 0d561ef | 2020-11-25 07:50:41 -0800 | [diff] [blame] | 428 | "snippet": "A String", # A short part of the message text. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 429 | "historyId": "A String", # The ID of the last history record that modified this message. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 430 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the `Date` header. However, for API-migrated mail, it can be configured by client to be based on the `Date` header. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 431 | }, |
| 432 | ], |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame] | 433 | "historyId": "A String", # The ID of the last history record that modified this thread. |
| 434 | "snippet": "A String", # A short part of the message text. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 435 | }</pre> |
| 436 | </div> |
| 437 | |
| 438 | </body></html> |