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.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"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 83 | <code><a href="#batchDelete">batchDelete(userId, body=None, x__xgafv=None)</a></code></p> |
| 84 | <p class="firstline">Deletes many messages by message ID. Provides no guarantees that messages</p> |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 85 | <p class="toc_element"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 86 | <code><a href="#batchModify">batchModify(userId, body=None, x__xgafv=None)</a></code></p> |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 87 | <p class="firstline">Modifies the labels on the specified messages.</p> |
| 88 | <p class="toc_element"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 89 | <code><a href="#delete">delete(userId, id, x__xgafv=None)</a></code></p> |
| 90 | <p class="firstline">Immediately and permanently deletes the specified message. This operation</p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 91 | <p class="toc_element"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 92 | <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] | 93 | <p class="firstline">Gets the specified message.</p> |
| 94 | <p class="toc_element"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 95 | <code><a href="#import_">import_(userId, body=None, deleted=None, internalDateSource=None, neverMarkSpam=None, processForCalendar=None, x__xgafv=None, media_body=None, media_mime_type=None)</a></code></p> |
| 96 | <p class="firstline">Imports a message into only this user's mailbox, with standard</p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 97 | <p class="toc_element"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 98 | <code><a href="#insert">insert(userId, body=None, internalDateSource=None, deleted=None, x__xgafv=None, media_body=None, media_mime_type=None)</a></code></p> |
| 99 | <p class="firstline">Directly inserts a message into only this user's mailbox similar to</p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 100 | <p class="toc_element"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 101 | <code><a href="#list">list(userId, maxResults=None, labelIds=None, includeSpamTrash=None, pageToken=None, q=None, x__xgafv=None)</a></code></p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 102 | <p class="firstline">Lists the messages in the user's mailbox.</p> |
| 103 | <p class="toc_element"> |
| 104 | <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> |
| 105 | <p class="firstline">Retrieves the next page of results.</p> |
| 106 | <p class="toc_element"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 107 | <code><a href="#modify">modify(userId, id, body=None, x__xgafv=None)</a></code></p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 108 | <p class="firstline">Modifies the labels on the specified message.</p> |
| 109 | <p class="toc_element"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 110 | <code><a href="#send">send(userId, body=None, x__xgafv=None, media_body=None, media_mime_type=None)</a></code></p> |
| 111 | <p class="firstline">Sends the specified message to the recipients in the</p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 112 | <p class="toc_element"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 113 | <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] | 114 | <p class="firstline">Moves the specified message to the trash.</p> |
| 115 | <p class="toc_element"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 116 | <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] | 117 | <p class="firstline">Removes the specified message from the trash.</p> |
| 118 | <h3>Method Details</h3> |
| 119 | <div class="method"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 120 | <code class="details" id="batchDelete">batchDelete(userId, body=None, x__xgafv=None)</code> |
| 121 | <pre>Deletes many messages by message ID. Provides no guarantees that messages |
| 122 | were not already deleted or even existed at all. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 123 | |
| 124 | Args: |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 125 | userId: string, The user's email address. The special value `me` |
| 126 | can be used to indicate the authenticated user. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 127 | body: object, The request body. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 128 | The object takes the form of: |
| 129 | |
| 130 | { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 131 | "ids": [ # The IDs of the messages to delete. |
| 132 | "A String", |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 133 | ], |
| 134 | } |
| 135 | |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 136 | x__xgafv: string, V1 error format. |
| 137 | Allowed values |
| 138 | 1 - v1 error format |
| 139 | 2 - v2 error format |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 140 | </pre> |
| 141 | </div> |
| 142 | |
| 143 | <div class="method"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 144 | <code class="details" id="batchModify">batchModify(userId, body=None, x__xgafv=None)</code> |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 145 | <pre>Modifies the labels on the specified messages. |
| 146 | |
| 147 | Args: |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 148 | userId: string, The user's email address. The special value `me` |
| 149 | can be used to indicate the authenticated user. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 150 | body: object, The request body. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 151 | The object takes the form of: |
| 152 | |
| 153 | { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 154 | "addLabelIds": [ # A list of label IDs to add to messages. |
| 155 | "A String", |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 156 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 157 | "removeLabelIds": [ # A list of label IDs to remove from messages. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 158 | "A String", |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 159 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 160 | "ids": [ # The IDs of the messages to modify. There is a limit of 1000 ids per |
| 161 | # request. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 162 | "A String", |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 163 | ], |
| 164 | } |
| 165 | |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 166 | x__xgafv: string, V1 error format. |
| 167 | Allowed values |
| 168 | 1 - v1 error format |
| 169 | 2 - v2 error format |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 170 | </pre> |
| 171 | </div> |
| 172 | |
| 173 | <div class="method"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 174 | <code class="details" id="delete">delete(userId, id, x__xgafv=None)</code> |
| 175 | <pre>Immediately and permanently deletes the specified message. This operation |
| 176 | cannot be undone. Prefer `messages.trash` instead. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 177 | |
| 178 | Args: |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 179 | userId: string, The user's email address. The special value `me` |
| 180 | can be used to indicate the authenticated user. (required) |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 181 | id: string, The ID of the message to delete. (required) |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 182 | x__xgafv: string, V1 error format. |
| 183 | Allowed values |
| 184 | 1 - v1 error format |
| 185 | 2 - v2 error format |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 186 | </pre> |
| 187 | </div> |
| 188 | |
| 189 | <div class="method"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 190 | <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] | 191 | <pre>Gets the specified message. |
| 192 | |
| 193 | Args: |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 194 | userId: string, The user's email address. The special value `me` |
| 195 | can be used to indicate the authenticated user. (required) |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 196 | id: string, The ID of the message to retrieve. (required) |
| 197 | format: string, The format to return the message in. |
Craig Citro | 0e5b9bf | 2014-10-15 10:26:14 -0700 | [diff] [blame] | 198 | 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^] | 199 | x__xgafv: string, V1 error format. |
| 200 | Allowed values |
| 201 | 1 - v1 error format |
| 202 | 2 - v2 error format |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 203 | |
| 204 | Returns: |
| 205 | An object of the form: |
| 206 | |
| 207 | { # An email message. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 208 | "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to |
| 209 | # a thread, the following criteria must be met: |
| 210 | # <ol><li>The requested `threadId` must be specified on the |
| 211 | # `Message` or `Draft.Message` you supply with your |
| 212 | # request.</li> |
| 213 | # <li>The `References` and `In-Reply-To` headers must |
| 214 | # be set in compliance with the |
| 215 | # <a href="https://tools.ietf.org/html/rfc2822">RFC 2822</a> standard.</li> |
| 216 | # <li>The `Subject` headers must match. |
| 217 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 218 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 219 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines |
| 220 | # ordering in the inbox. For normal SMTP-received email, this represents the |
| 221 | # time the message was originally accepted by Google, which is more reliable |
| 222 | # than the `Date` header. However, for API-migrated mail, it can |
| 223 | # be configured by client to be based on the `Date` header. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 224 | "id": "A String", # The immutable ID of the message. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 225 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 226 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 227 | "mimeType": "A String", # The MIME type of the message part. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 228 | "parts": [ # The child MIME message parts of this part. This only applies to container |
| 229 | # MIME message parts, for example `multipart/*`. For non- |
| 230 | # container MIME message part types, such as `text/plain`, this |
| 231 | # field is empty. For more information, see |
| 232 | # <a href="http://www.ietf.org/rfc/rfc1521.txt">RFC 1521</a>. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 233 | # Object with schema name: MessagePart |
| 234 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 235 | "headers": [ # List of headers on this message part. For the top-level message part, |
| 236 | # representing the entire message payload, it will contain the standard |
| 237 | # RFC 2822 email headers such as `To`, `From`, and |
| 238 | # `Subject`. |
| 239 | { |
| 240 | "name": "A String", # The name of the header before the `:` separator. For |
| 241 | # example, `To`. |
| 242 | "value": "A String", # The value of the header after the `:` separator. For example, |
| 243 | # `someuser@example.com`. |
| 244 | }, |
| 245 | ], |
| 246 | "filename": "A String", # The filename of the attachment. Only present if this message part |
| 247 | # represents an attachment. |
| 248 | "partId": "A String", # The immutable ID of the message part. |
| 249 | "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for |
| 250 | # container MIME message parts. |
| 251 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
| 252 | "attachmentId": "A String", # When present, contains the ID of an external attachment that can be |
| 253 | # retrieved in a separate `messages.attachments.get` request. |
| 254 | # When not present, the entire content of the message part body is |
| 255 | # contained in the data field. |
| 256 | "data": "A String", # The body data of a MIME message part as a base64url encoded string. |
| 257 | # May be empty for MIME container |
| 258 | # types that have no message body or when the body data is sent as a |
| 259 | # separate attachment. An attachment ID is present if the body data is |
| 260 | # contained in a separate attachment. |
| 261 | }, |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 262 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 263 | "historyId": "A String", # The ID of the last history record that modified this message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 264 | "snippet": "A String", # A short part of the message text. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 265 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url |
| 266 | # encoded string. Returned in `messages.get` and |
| 267 | # `drafts.get` responses when the `format=RAW` |
| 268 | # parameter is supplied. |
| 269 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 270 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 271 | "labelIds": [ # List of IDs of labels applied to this message. |
| 272 | # @mutable gmail.users.messages.insert gmail.users.messages.modify |
| 273 | "A String", |
| 274 | ], |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 275 | }</pre> |
| 276 | </div> |
| 277 | |
| 278 | <div class="method"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 279 | <code class="details" id="import_">import_(userId, body=None, deleted=None, internalDateSource=None, neverMarkSpam=None, processForCalendar=None, x__xgafv=None, media_body=None, media_mime_type=None)</code> |
| 280 | <pre>Imports a message into only this user's mailbox, with standard |
| 281 | email delivery scanning and classification similar to receiving via SMTP. |
| 282 | Does not send a message. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 283 | |
| 284 | Args: |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 285 | userId: string, The user's email address. The special value `me` |
| 286 | can be used to indicate the authenticated user. (required) |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 287 | body: object, The request body. |
| 288 | The object takes the form of: |
| 289 | |
| 290 | { # An email message. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 291 | "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to |
| 292 | # a thread, the following criteria must be met: |
| 293 | # <ol><li>The requested `threadId` must be specified on the |
| 294 | # `Message` or `Draft.Message` you supply with your |
| 295 | # request.</li> |
| 296 | # <li>The `References` and `In-Reply-To` headers must |
| 297 | # be set in compliance with the |
| 298 | # <a href="https://tools.ietf.org/html/rfc2822">RFC 2822</a> standard.</li> |
| 299 | # <li>The `Subject` headers must match. |
| 300 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 301 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 302 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines |
| 303 | # ordering in the inbox. For normal SMTP-received email, this represents the |
| 304 | # time the message was originally accepted by Google, which is more reliable |
| 305 | # than the `Date` header. However, for API-migrated mail, it can |
| 306 | # be configured by client to be based on the `Date` header. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 307 | "id": "A String", # The immutable ID of the message. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 308 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 309 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 310 | "mimeType": "A String", # The MIME type of the message part. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 311 | "parts": [ # The child MIME message parts of this part. This only applies to container |
| 312 | # MIME message parts, for example `multipart/*`. For non- |
| 313 | # container MIME message part types, such as `text/plain`, this |
| 314 | # field is empty. For more information, see |
| 315 | # <a href="http://www.ietf.org/rfc/rfc1521.txt">RFC 1521</a>. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 316 | # Object with schema name: MessagePart |
| 317 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 318 | "headers": [ # List of headers on this message part. For the top-level message part, |
| 319 | # representing the entire message payload, it will contain the standard |
| 320 | # RFC 2822 email headers such as `To`, `From`, and |
| 321 | # `Subject`. |
| 322 | { |
| 323 | "name": "A String", # The name of the header before the `:` separator. For |
| 324 | # example, `To`. |
| 325 | "value": "A String", # The value of the header after the `:` separator. For example, |
| 326 | # `someuser@example.com`. |
| 327 | }, |
| 328 | ], |
| 329 | "filename": "A String", # The filename of the attachment. Only present if this message part |
| 330 | # represents an attachment. |
| 331 | "partId": "A String", # The immutable ID of the message part. |
| 332 | "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for |
| 333 | # container MIME message parts. |
| 334 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
| 335 | "attachmentId": "A String", # When present, contains the ID of an external attachment that can be |
| 336 | # retrieved in a separate `messages.attachments.get` request. |
| 337 | # When not present, the entire content of the message part body is |
| 338 | # contained in the data field. |
| 339 | "data": "A String", # The body data of a MIME message part as a base64url encoded string. |
| 340 | # May be empty for MIME container |
| 341 | # types that have no message body or when the body data is sent as a |
| 342 | # separate attachment. An attachment ID is present if the body data is |
| 343 | # contained in a separate attachment. |
| 344 | }, |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 345 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 346 | "historyId": "A String", # The ID of the last history record that modified this message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 347 | "snippet": "A String", # A short part of the message text. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 348 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url |
| 349 | # encoded string. Returned in `messages.get` and |
| 350 | # `drafts.get` responses when the `format=RAW` |
| 351 | # parameter is supplied. |
| 352 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 353 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 354 | "labelIds": [ # List of IDs of labels applied to this message. |
| 355 | # @mutable gmail.users.messages.insert gmail.users.messages.modify |
| 356 | "A String", |
| 357 | ], |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 358 | } |
| 359 | |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 360 | deleted: boolean, Mark the email as permanently deleted (not TRASH) and |
| 361 | only visible in |
| 362 | <a href="http://support.google.com/vault/">Google Vault</a> to |
| 363 | a Vault administrator. Only used for G Suite accounts. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 364 | internalDateSource: string, Source for Gmail's internal date of the message. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 365 | neverMarkSpam: boolean, Ignore the Gmail spam classifier decision and never mark |
| 366 | this email as SPAM in the mailbox. |
| 367 | processForCalendar: boolean, Process calendar invites in the email and add any extracted |
| 368 | meetings to the Google Calendar for this user. |
| 369 | x__xgafv: string, V1 error format. |
Craig Citro | 0e5b9bf | 2014-10-15 10:26:14 -0700 | [diff] [blame] | 370 | Allowed values |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 371 | 1 - v1 error format |
| 372 | 2 - v2 error format |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 373 | media_body: string, The filename of the media request body, or an instance of a MediaUpload object. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 374 | media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 375 | |
| 376 | Returns: |
| 377 | An object of the form: |
| 378 | |
| 379 | { # An email message. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 380 | "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to |
| 381 | # a thread, the following criteria must be met: |
| 382 | # <ol><li>The requested `threadId` must be specified on the |
| 383 | # `Message` or `Draft.Message` you supply with your |
| 384 | # request.</li> |
| 385 | # <li>The `References` and `In-Reply-To` headers must |
| 386 | # be set in compliance with the |
| 387 | # <a href="https://tools.ietf.org/html/rfc2822">RFC 2822</a> standard.</li> |
| 388 | # <li>The `Subject` headers must match. |
| 389 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 390 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 391 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines |
| 392 | # ordering in the inbox. For normal SMTP-received email, this represents the |
| 393 | # time the message was originally accepted by Google, which is more reliable |
| 394 | # than the `Date` header. However, for API-migrated mail, it can |
| 395 | # be configured by client to be based on the `Date` header. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 396 | "id": "A String", # The immutable ID of the message. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 397 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 398 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 399 | "mimeType": "A String", # The MIME type of the message part. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 400 | "parts": [ # The child MIME message parts of this part. This only applies to container |
| 401 | # MIME message parts, for example `multipart/*`. For non- |
| 402 | # container MIME message part types, such as `text/plain`, this |
| 403 | # field is empty. For more information, see |
| 404 | # <a href="http://www.ietf.org/rfc/rfc1521.txt">RFC 1521</a>. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 405 | # Object with schema name: MessagePart |
| 406 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 407 | "headers": [ # List of headers on this message part. For the top-level message part, |
| 408 | # representing the entire message payload, it will contain the standard |
| 409 | # RFC 2822 email headers such as `To`, `From`, and |
| 410 | # `Subject`. |
| 411 | { |
| 412 | "name": "A String", # The name of the header before the `:` separator. For |
| 413 | # example, `To`. |
| 414 | "value": "A String", # The value of the header after the `:` separator. For example, |
| 415 | # `someuser@example.com`. |
| 416 | }, |
| 417 | ], |
| 418 | "filename": "A String", # The filename of the attachment. Only present if this message part |
| 419 | # represents an attachment. |
| 420 | "partId": "A String", # The immutable ID of the message part. |
| 421 | "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for |
| 422 | # container MIME message parts. |
| 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 |
| 425 | # retrieved in a separate `messages.attachments.get` request. |
| 426 | # When not present, the entire content of the message part body is |
| 427 | # contained in the data field. |
| 428 | "data": "A String", # The body data of a MIME message part as a base64url encoded string. |
| 429 | # May be empty for MIME container |
| 430 | # types that have no message body or when the body data is sent as a |
| 431 | # separate attachment. An attachment ID is present if the body data is |
| 432 | # contained in a separate attachment. |
| 433 | }, |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 434 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 435 | "historyId": "A String", # The ID of the last history record that modified this message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 436 | "snippet": "A String", # A short part of the message text. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 437 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url |
| 438 | # encoded string. Returned in `messages.get` and |
| 439 | # `drafts.get` responses when the `format=RAW` |
| 440 | # parameter is supplied. |
| 441 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 442 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 443 | "labelIds": [ # List of IDs of labels applied to this message. |
| 444 | # @mutable gmail.users.messages.insert gmail.users.messages.modify |
| 445 | "A String", |
| 446 | ], |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 447 | }</pre> |
| 448 | </div> |
| 449 | |
| 450 | <div class="method"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 451 | <code class="details" id="insert">insert(userId, body=None, internalDateSource=None, deleted=None, x__xgafv=None, media_body=None, media_mime_type=None)</code> |
| 452 | <pre>Directly inserts a message into only this user's mailbox similar to |
| 453 | `IMAP APPEND`, bypassing most scanning and classification. |
| 454 | Does not send a message. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 455 | |
| 456 | Args: |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 457 | userId: string, The user's email address. The special value `me` |
| 458 | can be used to indicate the authenticated user. (required) |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 459 | body: object, The request body. |
| 460 | The object takes the form of: |
| 461 | |
| 462 | { # An email message. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 463 | "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to |
| 464 | # a thread, the following criteria must be met: |
| 465 | # <ol><li>The requested `threadId` must be specified on the |
| 466 | # `Message` or `Draft.Message` you supply with your |
| 467 | # request.</li> |
| 468 | # <li>The `References` and `In-Reply-To` headers must |
| 469 | # be set in compliance with the |
| 470 | # <a href="https://tools.ietf.org/html/rfc2822">RFC 2822</a> standard.</li> |
| 471 | # <li>The `Subject` headers must match. |
| 472 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 473 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 474 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines |
| 475 | # ordering in the inbox. For normal SMTP-received email, this represents the |
| 476 | # time the message was originally accepted by Google, which is more reliable |
| 477 | # than the `Date` header. However, for API-migrated mail, it can |
| 478 | # be configured by client to be based on the `Date` header. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 479 | "id": "A String", # The immutable ID of the message. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 480 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 481 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 482 | "mimeType": "A String", # The MIME type of the message part. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 483 | "parts": [ # The child MIME message parts of this part. This only applies to container |
| 484 | # MIME message parts, for example `multipart/*`. For non- |
| 485 | # container MIME message part types, such as `text/plain`, this |
| 486 | # field is empty. For more information, see |
| 487 | # <a href="http://www.ietf.org/rfc/rfc1521.txt">RFC 1521</a>. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 488 | # Object with schema name: MessagePart |
| 489 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 490 | "headers": [ # List of headers on this message part. For the top-level message part, |
| 491 | # representing the entire message payload, it will contain the standard |
| 492 | # RFC 2822 email headers such as `To`, `From`, and |
| 493 | # `Subject`. |
| 494 | { |
| 495 | "name": "A String", # The name of the header before the `:` separator. For |
| 496 | # example, `To`. |
| 497 | "value": "A String", # The value of the header after the `:` separator. For example, |
| 498 | # `someuser@example.com`. |
| 499 | }, |
| 500 | ], |
| 501 | "filename": "A String", # The filename of the attachment. Only present if this message part |
| 502 | # represents an attachment. |
| 503 | "partId": "A String", # The immutable ID of the message part. |
| 504 | "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for |
| 505 | # container MIME message parts. |
| 506 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
| 507 | "attachmentId": "A String", # When present, contains the ID of an external attachment that can be |
| 508 | # retrieved in a separate `messages.attachments.get` request. |
| 509 | # When not present, the entire content of the message part body is |
| 510 | # contained in the data field. |
| 511 | "data": "A String", # The body data of a MIME message part as a base64url encoded string. |
| 512 | # May be empty for MIME container |
| 513 | # types that have no message body or when the body data is sent as a |
| 514 | # separate attachment. An attachment ID is present if the body data is |
| 515 | # contained in a separate attachment. |
| 516 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 517 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 518 | "historyId": "A String", # The ID of the last history record that modified this message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 519 | "snippet": "A String", # A short part of the message text. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 520 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url |
| 521 | # encoded string. Returned in `messages.get` and |
| 522 | # `drafts.get` responses when the `format=RAW` |
| 523 | # parameter is supplied. |
| 524 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 525 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 526 | "labelIds": [ # List of IDs of labels applied to this message. |
| 527 | # @mutable gmail.users.messages.insert gmail.users.messages.modify |
| 528 | "A String", |
| 529 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 530 | } |
| 531 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 532 | internalDateSource: string, Source for Gmail's internal date of the message. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 533 | deleted: boolean, Mark the email as permanently deleted (not TRASH) and |
| 534 | only visible in |
| 535 | <a href="http://support.google.com/vault/">Google Vault</a> to |
| 536 | a Vault administrator. Only used for G Suite accounts. |
| 537 | x__xgafv: string, V1 error format. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 538 | Allowed values |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 539 | 1 - v1 error format |
| 540 | 2 - v2 error format |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 541 | media_body: string, The filename of the media request body, or an instance of a MediaUpload object. |
| 542 | media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object. |
| 543 | |
| 544 | Returns: |
| 545 | An object of the form: |
| 546 | |
| 547 | { # An email message. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 548 | "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to |
| 549 | # a thread, the following criteria must be met: |
| 550 | # <ol><li>The requested `threadId` must be specified on the |
| 551 | # `Message` or `Draft.Message` you supply with your |
| 552 | # request.</li> |
| 553 | # <li>The `References` and `In-Reply-To` headers must |
| 554 | # be set in compliance with the |
| 555 | # <a href="https://tools.ietf.org/html/rfc2822">RFC 2822</a> standard.</li> |
| 556 | # <li>The `Subject` headers must match. |
| 557 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 558 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 559 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines |
| 560 | # ordering in the inbox. For normal SMTP-received email, this represents the |
| 561 | # time the message was originally accepted by Google, which is more reliable |
| 562 | # than the `Date` header. However, for API-migrated mail, it can |
| 563 | # be configured by client to be based on the `Date` header. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 564 | "id": "A String", # The immutable ID of the message. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 565 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 566 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 567 | "mimeType": "A String", # The MIME type of the message part. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 568 | "parts": [ # The child MIME message parts of this part. This only applies to container |
| 569 | # MIME message parts, for example `multipart/*`. For non- |
| 570 | # container MIME message part types, such as `text/plain`, this |
| 571 | # field is empty. For more information, see |
| 572 | # <a href="http://www.ietf.org/rfc/rfc1521.txt">RFC 1521</a>. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 573 | # Object with schema name: MessagePart |
| 574 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 575 | "headers": [ # List of headers on this message part. For the top-level message part, |
| 576 | # representing the entire message payload, it will contain the standard |
| 577 | # RFC 2822 email headers such as `To`, `From`, and |
| 578 | # `Subject`. |
| 579 | { |
| 580 | "name": "A String", # The name of the header before the `:` separator. For |
| 581 | # example, `To`. |
| 582 | "value": "A String", # The value of the header after the `:` separator. For example, |
| 583 | # `someuser@example.com`. |
| 584 | }, |
| 585 | ], |
| 586 | "filename": "A String", # The filename of the attachment. Only present if this message part |
| 587 | # represents an attachment. |
| 588 | "partId": "A String", # The immutable ID of the message part. |
| 589 | "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for |
| 590 | # container MIME message parts. |
| 591 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
| 592 | "attachmentId": "A String", # When present, contains the ID of an external attachment that can be |
| 593 | # retrieved in a separate `messages.attachments.get` request. |
| 594 | # When not present, the entire content of the message part body is |
| 595 | # contained in the data field. |
| 596 | "data": "A String", # The body data of a MIME message part as a base64url encoded string. |
| 597 | # May be empty for MIME container |
| 598 | # types that have no message body or when the body data is sent as a |
| 599 | # separate attachment. An attachment ID is present if the body data is |
| 600 | # contained in a separate attachment. |
| 601 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 602 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 603 | "historyId": "A String", # The ID of the last history record that modified this message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 604 | "snippet": "A String", # A short part of the message text. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 605 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url |
| 606 | # encoded string. Returned in `messages.get` and |
| 607 | # `drafts.get` responses when the `format=RAW` |
| 608 | # parameter is supplied. |
| 609 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 610 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 611 | "labelIds": [ # List of IDs of labels applied to this message. |
| 612 | # @mutable gmail.users.messages.insert gmail.users.messages.modify |
| 613 | "A String", |
| 614 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 615 | }</pre> |
| 616 | </div> |
| 617 | |
| 618 | <div class="method"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 619 | <code class="details" id="list">list(userId, maxResults=None, labelIds=None, includeSpamTrash=None, pageToken=None, q=None, x__xgafv=None)</code> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 620 | <pre>Lists the messages in the user's mailbox. |
| 621 | |
| 622 | Args: |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 623 | userId: string, The user's email address. The special value `me` |
| 624 | can be used to indicate the authenticated user. (required) |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 625 | maxResults: integer, Maximum number of messages to return. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 626 | labelIds: string, Only return messages with labels that match all of the specified label IDs. (repeated) |
| 627 | includeSpamTrash: boolean, Include messages from `SPAM` and `TRASH` |
| 628 | in the results. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 629 | pageToken: string, Page token to retrieve a specific page of results in the list. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 630 | q: string, Only return messages matching the specified query. Supports the same |
| 631 | query format as the Gmail search box. For example, |
| 632 | `"from:someuser@example.com rfc822msgid:<somemsgid@example.com> |
| 633 | is:unread"`. Parameter cannot be used when accessing the api |
| 634 | using the gmail.metadata scope. |
| 635 | x__xgafv: string, V1 error format. |
| 636 | Allowed values |
| 637 | 1 - v1 error format |
| 638 | 2 - v2 error format |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 639 | |
| 640 | Returns: |
| 641 | An object of the form: |
| 642 | |
| 643 | { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 644 | "resultSizeEstimate": 42, # Estimated total number of results. |
| 645 | "nextPageToken": "A String", # Token to retrieve the next page of results in the list. |
| 646 | "messages": [ # List of messages. Note that each message resource contains only an |
| 647 | # `id` and a `threadId`. Additional message details can |
| 648 | # be fetched using the |
| 649 | # <a href="/gmail/api/v1/reference/users/messages/get">messages.get</a> |
| 650 | # method. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 651 | { # An email message. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 652 | "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to |
| 653 | # a thread, the following criteria must be met: |
| 654 | # <ol><li>The requested `threadId` must be specified on the |
| 655 | # `Message` or `Draft.Message` you supply with your |
| 656 | # request.</li> |
| 657 | # <li>The `References` and `In-Reply-To` headers must |
| 658 | # be set in compliance with the |
| 659 | # <a href="https://tools.ietf.org/html/rfc2822">RFC 2822</a> standard.</li> |
| 660 | # <li>The `Subject` headers must match. |
| 661 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 662 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 663 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines |
| 664 | # ordering in the inbox. For normal SMTP-received email, this represents the |
| 665 | # time the message was originally accepted by Google, which is more reliable |
| 666 | # than the `Date` header. However, for API-migrated mail, it can |
| 667 | # be configured by client to be based on the `Date` header. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 668 | "id": "A String", # The immutable ID of the message. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 669 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 670 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 671 | "mimeType": "A String", # The MIME type of the message part. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 672 | "parts": [ # The child MIME message parts of this part. This only applies to container |
| 673 | # MIME message parts, for example `multipart/*`. For non- |
| 674 | # container MIME message part types, such as `text/plain`, this |
| 675 | # field is empty. For more information, see |
| 676 | # <a href="http://www.ietf.org/rfc/rfc1521.txt">RFC 1521</a>. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 677 | # Object with schema name: MessagePart |
| 678 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 679 | "headers": [ # List of headers on this message part. For the top-level message part, |
| 680 | # representing the entire message payload, it will contain the standard |
| 681 | # RFC 2822 email headers such as `To`, `From`, and |
| 682 | # `Subject`. |
| 683 | { |
| 684 | "name": "A String", # The name of the header before the `:` separator. For |
| 685 | # example, `To`. |
| 686 | "value": "A String", # The value of the header after the `:` separator. For example, |
| 687 | # `someuser@example.com`. |
| 688 | }, |
| 689 | ], |
| 690 | "filename": "A String", # The filename of the attachment. Only present if this message part |
| 691 | # represents an attachment. |
| 692 | "partId": "A String", # The immutable ID of the message part. |
| 693 | "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for |
| 694 | # container MIME message parts. |
| 695 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
| 696 | "attachmentId": "A String", # When present, contains the ID of an external attachment that can be |
| 697 | # retrieved in a separate `messages.attachments.get` request. |
| 698 | # When not present, the entire content of the message part body is |
| 699 | # contained in the data field. |
| 700 | "data": "A String", # The body data of a MIME message part as a base64url encoded string. |
| 701 | # May be empty for MIME container |
| 702 | # types that have no message body or when the body data is sent as a |
| 703 | # separate attachment. An attachment ID is present if the body data is |
| 704 | # contained in a separate attachment. |
| 705 | }, |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 706 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 707 | "historyId": "A String", # The ID of the last history record that modified this message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 708 | "snippet": "A String", # A short part of the message text. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 709 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url |
| 710 | # encoded string. Returned in `messages.get` and |
| 711 | # `drafts.get` responses when the `format=RAW` |
| 712 | # parameter is supplied. |
| 713 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 714 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 715 | "labelIds": [ # List of IDs of labels applied to this message. |
| 716 | # @mutable gmail.users.messages.insert gmail.users.messages.modify |
| 717 | "A String", |
| 718 | ], |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 719 | }, |
| 720 | ], |
| 721 | }</pre> |
| 722 | </div> |
| 723 | |
| 724 | <div class="method"> |
| 725 | <code class="details" id="list_next">list_next(previous_request, previous_response)</code> |
| 726 | <pre>Retrieves the next page of results. |
| 727 | |
| 728 | Args: |
| 729 | previous_request: The request for the previous page. (required) |
| 730 | previous_response: The response from the request for the previous page. (required) |
| 731 | |
| 732 | Returns: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 733 | 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] | 734 | page. Returns None if there are no more items in the collection. |
| 735 | </pre> |
| 736 | </div> |
| 737 | |
| 738 | <div class="method"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 739 | <code class="details" id="modify">modify(userId, id, body=None, x__xgafv=None)</code> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 740 | <pre>Modifies the labels on the specified message. |
| 741 | |
| 742 | Args: |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 743 | userId: string, The user's email address. The special value `me` |
| 744 | can be used to indicate the authenticated user. (required) |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 745 | id: string, The ID of the message to modify. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 746 | body: object, The request body. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 747 | The object takes the form of: |
| 748 | |
| 749 | { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 750 | "addLabelIds": [ # A list of IDs of labels to add to this message. |
| 751 | "A String", |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 752 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 753 | "removeLabelIds": [ # A list IDs of labels to remove from this message. |
| 754 | "A String", |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 755 | ], |
| 756 | } |
| 757 | |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 758 | x__xgafv: string, V1 error format. |
| 759 | Allowed values |
| 760 | 1 - v1 error format |
| 761 | 2 - v2 error format |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 762 | |
| 763 | Returns: |
| 764 | An object of the form: |
| 765 | |
| 766 | { # An email message. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 767 | "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to |
| 768 | # a thread, the following criteria must be met: |
| 769 | # <ol><li>The requested `threadId` must be specified on the |
| 770 | # `Message` or `Draft.Message` you supply with your |
| 771 | # request.</li> |
| 772 | # <li>The `References` and `In-Reply-To` headers must |
| 773 | # be set in compliance with the |
| 774 | # <a href="https://tools.ietf.org/html/rfc2822">RFC 2822</a> standard.</li> |
| 775 | # <li>The `Subject` headers must match. |
| 776 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 777 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 778 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines |
| 779 | # ordering in the inbox. For normal SMTP-received email, this represents the |
| 780 | # time the message was originally accepted by Google, which is more reliable |
| 781 | # than the `Date` header. However, for API-migrated mail, it can |
| 782 | # be configured by client to be based on the `Date` header. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 783 | "id": "A String", # The immutable ID of the message. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 784 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 785 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 786 | "mimeType": "A String", # The MIME type of the message part. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 787 | "parts": [ # The child MIME message parts of this part. This only applies to container |
| 788 | # MIME message parts, for example `multipart/*`. For non- |
| 789 | # container MIME message part types, such as `text/plain`, this |
| 790 | # field is empty. For more information, see |
| 791 | # <a href="http://www.ietf.org/rfc/rfc1521.txt">RFC 1521</a>. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 792 | # Object with schema name: MessagePart |
| 793 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 794 | "headers": [ # List of headers on this message part. For the top-level message part, |
| 795 | # representing the entire message payload, it will contain the standard |
| 796 | # RFC 2822 email headers such as `To`, `From`, and |
| 797 | # `Subject`. |
| 798 | { |
| 799 | "name": "A String", # The name of the header before the `:` separator. For |
| 800 | # example, `To`. |
| 801 | "value": "A String", # The value of the header after the `:` separator. For example, |
| 802 | # `someuser@example.com`. |
| 803 | }, |
| 804 | ], |
| 805 | "filename": "A String", # The filename of the attachment. Only present if this message part |
| 806 | # represents an attachment. |
| 807 | "partId": "A String", # The immutable ID of the message part. |
| 808 | "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for |
| 809 | # container MIME message parts. |
| 810 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
| 811 | "attachmentId": "A String", # When present, contains the ID of an external attachment that can be |
| 812 | # retrieved in a separate `messages.attachments.get` request. |
| 813 | # When not present, the entire content of the message part body is |
| 814 | # contained in the data field. |
| 815 | "data": "A String", # The body data of a MIME message part as a base64url encoded string. |
| 816 | # May be empty for MIME container |
| 817 | # types that have no message body or when the body data is sent as a |
| 818 | # separate attachment. An attachment ID is present if the body data is |
| 819 | # contained in a separate attachment. |
| 820 | }, |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 821 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 822 | "historyId": "A String", # The ID of the last history record that modified this message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 823 | "snippet": "A String", # A short part of the message text. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 824 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url |
| 825 | # encoded string. Returned in `messages.get` and |
| 826 | # `drafts.get` responses when the `format=RAW` |
| 827 | # parameter is supplied. |
| 828 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 829 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 830 | "labelIds": [ # List of IDs of labels applied to this message. |
| 831 | # @mutable gmail.users.messages.insert gmail.users.messages.modify |
| 832 | "A String", |
| 833 | ], |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 834 | }</pre> |
| 835 | </div> |
| 836 | |
| 837 | <div class="method"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 838 | <code class="details" id="send">send(userId, body=None, x__xgafv=None, media_body=None, media_mime_type=None)</code> |
| 839 | <pre>Sends the specified message to the recipients in the |
| 840 | `To`, `Cc`, and `Bcc` headers. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 841 | |
| 842 | Args: |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 843 | userId: string, The user's email address. The special value `me` |
| 844 | can be used to indicate the authenticated user. (required) |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 845 | body: object, The request body. |
| 846 | The object takes the form of: |
| 847 | |
| 848 | { # An email message. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 849 | "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to |
| 850 | # a thread, the following criteria must be met: |
| 851 | # <ol><li>The requested `threadId` must be specified on the |
| 852 | # `Message` or `Draft.Message` you supply with your |
| 853 | # request.</li> |
| 854 | # <li>The `References` and `In-Reply-To` headers must |
| 855 | # be set in compliance with the |
| 856 | # <a href="https://tools.ietf.org/html/rfc2822">RFC 2822</a> standard.</li> |
| 857 | # <li>The `Subject` headers must match. |
| 858 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 859 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 860 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines |
| 861 | # ordering in the inbox. For normal SMTP-received email, this represents the |
| 862 | # time the message was originally accepted by Google, which is more reliable |
| 863 | # than the `Date` header. However, for API-migrated mail, it can |
| 864 | # be configured by client to be based on the `Date` header. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 865 | "id": "A String", # The immutable ID of the message. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 866 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 867 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 868 | "mimeType": "A String", # The MIME type of the message part. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 869 | "parts": [ # The child MIME message parts of this part. This only applies to container |
| 870 | # MIME message parts, for example `multipart/*`. For non- |
| 871 | # container MIME message part types, such as `text/plain`, this |
| 872 | # field is empty. For more information, see |
| 873 | # <a href="http://www.ietf.org/rfc/rfc1521.txt">RFC 1521</a>. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 874 | # Object with schema name: MessagePart |
| 875 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 876 | "headers": [ # List of headers on this message part. For the top-level message part, |
| 877 | # representing the entire message payload, it will contain the standard |
| 878 | # RFC 2822 email headers such as `To`, `From`, and |
| 879 | # `Subject`. |
| 880 | { |
| 881 | "name": "A String", # The name of the header before the `:` separator. For |
| 882 | # example, `To`. |
| 883 | "value": "A String", # The value of the header after the `:` separator. For example, |
| 884 | # `someuser@example.com`. |
| 885 | }, |
| 886 | ], |
| 887 | "filename": "A String", # The filename of the attachment. Only present if this message part |
| 888 | # represents an attachment. |
| 889 | "partId": "A String", # The immutable ID of the message part. |
| 890 | "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for |
| 891 | # container MIME message parts. |
| 892 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
| 893 | "attachmentId": "A String", # When present, contains the ID of an external attachment that can be |
| 894 | # retrieved in a separate `messages.attachments.get` request. |
| 895 | # When not present, the entire content of the message part body is |
| 896 | # contained in the data field. |
| 897 | "data": "A String", # The body data of a MIME message part as a base64url encoded string. |
| 898 | # May be empty for MIME container |
| 899 | # types that have no message body or when the body data is sent as a |
| 900 | # separate attachment. An attachment ID is present if the body data is |
| 901 | # contained in a separate attachment. |
| 902 | }, |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 903 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 904 | "historyId": "A String", # The ID of the last history record that modified this message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 905 | "snippet": "A String", # A short part of the message text. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 906 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url |
| 907 | # encoded string. Returned in `messages.get` and |
| 908 | # `drafts.get` responses when the `format=RAW` |
| 909 | # parameter is supplied. |
| 910 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 911 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 912 | "labelIds": [ # List of IDs of labels applied to this message. |
| 913 | # @mutable gmail.users.messages.insert gmail.users.messages.modify |
| 914 | "A String", |
| 915 | ], |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 916 | } |
| 917 | |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 918 | x__xgafv: string, V1 error format. |
| 919 | Allowed values |
| 920 | 1 - v1 error format |
| 921 | 2 - v2 error format |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 922 | media_body: string, The filename of the media request body, or an instance of a MediaUpload object. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 923 | media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 924 | |
| 925 | Returns: |
| 926 | An object of the form: |
| 927 | |
| 928 | { # An email message. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 929 | "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to |
| 930 | # a thread, the following criteria must be met: |
| 931 | # <ol><li>The requested `threadId` must be specified on the |
| 932 | # `Message` or `Draft.Message` you supply with your |
| 933 | # request.</li> |
| 934 | # <li>The `References` and `In-Reply-To` headers must |
| 935 | # be set in compliance with the |
| 936 | # <a href="https://tools.ietf.org/html/rfc2822">RFC 2822</a> standard.</li> |
| 937 | # <li>The `Subject` headers must match. |
| 938 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 939 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 940 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines |
| 941 | # ordering in the inbox. For normal SMTP-received email, this represents the |
| 942 | # time the message was originally accepted by Google, which is more reliable |
| 943 | # than the `Date` header. However, for API-migrated mail, it can |
| 944 | # be configured by client to be based on the `Date` header. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 945 | "id": "A String", # The immutable ID of the message. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 946 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 947 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 948 | "mimeType": "A String", # The MIME type of the message part. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 949 | "parts": [ # The child MIME message parts of this part. This only applies to container |
| 950 | # MIME message parts, for example `multipart/*`. For non- |
| 951 | # container MIME message part types, such as `text/plain`, this |
| 952 | # field is empty. For more information, see |
| 953 | # <a href="http://www.ietf.org/rfc/rfc1521.txt">RFC 1521</a>. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 954 | # Object with schema name: MessagePart |
| 955 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 956 | "headers": [ # List of headers on this message part. For the top-level message part, |
| 957 | # representing the entire message payload, it will contain the standard |
| 958 | # RFC 2822 email headers such as `To`, `From`, and |
| 959 | # `Subject`. |
| 960 | { |
| 961 | "name": "A String", # The name of the header before the `:` separator. For |
| 962 | # example, `To`. |
| 963 | "value": "A String", # The value of the header after the `:` separator. For example, |
| 964 | # `someuser@example.com`. |
| 965 | }, |
| 966 | ], |
| 967 | "filename": "A String", # The filename of the attachment. Only present if this message part |
| 968 | # represents an attachment. |
| 969 | "partId": "A String", # The immutable ID of the message part. |
| 970 | "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for |
| 971 | # container MIME message parts. |
| 972 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
| 973 | "attachmentId": "A String", # When present, contains the ID of an external attachment that can be |
| 974 | # retrieved in a separate `messages.attachments.get` request. |
| 975 | # When not present, the entire content of the message part body is |
| 976 | # contained in the data field. |
| 977 | "data": "A String", # The body data of a MIME message part as a base64url encoded string. |
| 978 | # May be empty for MIME container |
| 979 | # types that have no message body or when the body data is sent as a |
| 980 | # separate attachment. An attachment ID is present if the body data is |
| 981 | # contained in a separate attachment. |
| 982 | }, |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 983 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 984 | "historyId": "A String", # The ID of the last history record that modified this message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 985 | "snippet": "A String", # A short part of the message text. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 986 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url |
| 987 | # encoded string. Returned in `messages.get` and |
| 988 | # `drafts.get` responses when the `format=RAW` |
| 989 | # parameter is supplied. |
| 990 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 991 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 992 | "labelIds": [ # List of IDs of labels applied to this message. |
| 993 | # @mutable gmail.users.messages.insert gmail.users.messages.modify |
| 994 | "A String", |
| 995 | ], |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 996 | }</pre> |
| 997 | </div> |
| 998 | |
| 999 | <div class="method"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1000 | <code class="details" id="trash">trash(userId, id, x__xgafv=None)</code> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 1001 | <pre>Moves the specified message to the trash. |
| 1002 | |
| 1003 | Args: |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1004 | userId: string, The user's email address. The special value `me` |
| 1005 | can be used to indicate the authenticated user. (required) |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 1006 | id: string, The ID of the message to Trash. (required) |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1007 | x__xgafv: string, V1 error format. |
| 1008 | Allowed values |
| 1009 | 1 - v1 error format |
| 1010 | 2 - v2 error format |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 1011 | |
| 1012 | Returns: |
| 1013 | An object of the form: |
| 1014 | |
| 1015 | { # An email message. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1016 | "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to |
| 1017 | # a thread, the following criteria must be met: |
| 1018 | # <ol><li>The requested `threadId` must be specified on the |
| 1019 | # `Message` or `Draft.Message` you supply with your |
| 1020 | # request.</li> |
| 1021 | # <li>The `References` and `In-Reply-To` headers must |
| 1022 | # be set in compliance with the |
| 1023 | # <a href="https://tools.ietf.org/html/rfc2822">RFC 2822</a> standard.</li> |
| 1024 | # <li>The `Subject` headers must match. |
| 1025 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 1026 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 1027 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines |
| 1028 | # ordering in the inbox. For normal SMTP-received email, this represents the |
| 1029 | # time the message was originally accepted by Google, which is more reliable |
| 1030 | # than the `Date` header. However, for API-migrated mail, it can |
| 1031 | # be configured by client to be based on the `Date` header. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1032 | "id": "A String", # The immutable ID of the message. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1033 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1034 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1035 | "mimeType": "A String", # The MIME type of the message part. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1036 | "parts": [ # The child MIME message parts of this part. This only applies to container |
| 1037 | # MIME message parts, for example `multipart/*`. For non- |
| 1038 | # container MIME message part types, such as `text/plain`, this |
| 1039 | # field is empty. For more information, see |
| 1040 | # <a href="http://www.ietf.org/rfc/rfc1521.txt">RFC 1521</a>. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 1041 | # Object with schema name: MessagePart |
| 1042 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1043 | "headers": [ # List of headers on this message part. For the top-level message part, |
| 1044 | # representing the entire message payload, it will contain the standard |
| 1045 | # RFC 2822 email headers such as `To`, `From`, and |
| 1046 | # `Subject`. |
| 1047 | { |
| 1048 | "name": "A String", # The name of the header before the `:` separator. For |
| 1049 | # example, `To`. |
| 1050 | "value": "A String", # The value of the header after the `:` separator. For example, |
| 1051 | # `someuser@example.com`. |
| 1052 | }, |
| 1053 | ], |
| 1054 | "filename": "A String", # The filename of the attachment. Only present if this message part |
| 1055 | # represents an attachment. |
| 1056 | "partId": "A String", # The immutable ID of the message part. |
| 1057 | "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for |
| 1058 | # container MIME message parts. |
| 1059 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
| 1060 | "attachmentId": "A String", # When present, contains the ID of an external attachment that can be |
| 1061 | # retrieved in a separate `messages.attachments.get` request. |
| 1062 | # When not present, the entire content of the message part body is |
| 1063 | # contained in the data field. |
| 1064 | "data": "A String", # The body data of a MIME message part as a base64url encoded string. |
| 1065 | # May be empty for MIME container |
| 1066 | # types that have no message body or when the body data is sent as a |
| 1067 | # separate attachment. An attachment ID is present if the body data is |
| 1068 | # contained in a separate attachment. |
| 1069 | }, |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 1070 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1071 | "historyId": "A String", # The ID of the last history record that modified this message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1072 | "snippet": "A String", # A short part of the message text. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1073 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url |
| 1074 | # encoded string. Returned in `messages.get` and |
| 1075 | # `drafts.get` responses when the `format=RAW` |
| 1076 | # parameter is supplied. |
| 1077 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 1078 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 1079 | "labelIds": [ # List of IDs of labels applied to this message. |
| 1080 | # @mutable gmail.users.messages.insert gmail.users.messages.modify |
| 1081 | "A String", |
| 1082 | ], |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 1083 | }</pre> |
| 1084 | </div> |
| 1085 | |
| 1086 | <div class="method"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1087 | <code class="details" id="untrash">untrash(userId, id, x__xgafv=None)</code> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 1088 | <pre>Removes the specified message from the trash. |
| 1089 | |
| 1090 | Args: |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1091 | userId: string, The user's email address. The special value `me` |
| 1092 | can be used to indicate the authenticated user. (required) |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 1093 | id: string, The ID of the message to remove from Trash. (required) |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1094 | x__xgafv: string, V1 error format. |
| 1095 | Allowed values |
| 1096 | 1 - v1 error format |
| 1097 | 2 - v2 error format |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 1098 | |
| 1099 | Returns: |
| 1100 | An object of the form: |
| 1101 | |
| 1102 | { # An email message. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1103 | "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to |
| 1104 | # a thread, the following criteria must be met: |
| 1105 | # <ol><li>The requested `threadId` must be specified on the |
| 1106 | # `Message` or `Draft.Message` you supply with your |
| 1107 | # request.</li> |
| 1108 | # <li>The `References` and `In-Reply-To` headers must |
| 1109 | # be set in compliance with the |
| 1110 | # <a href="https://tools.ietf.org/html/rfc2822">RFC 2822</a> standard.</li> |
| 1111 | # <li>The `Subject` headers must match. |
| 1112 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 1113 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 1114 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines |
| 1115 | # ordering in the inbox. For normal SMTP-received email, this represents the |
| 1116 | # time the message was originally accepted by Google, which is more reliable |
| 1117 | # than the `Date` header. However, for API-migrated mail, it can |
| 1118 | # be configured by client to be based on the `Date` header. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1119 | "id": "A String", # The immutable ID of the message. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1120 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1121 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1122 | "mimeType": "A String", # The MIME type of the message part. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1123 | "parts": [ # The child MIME message parts of this part. This only applies to container |
| 1124 | # MIME message parts, for example `multipart/*`. For non- |
| 1125 | # container MIME message part types, such as `text/plain`, this |
| 1126 | # field is empty. For more information, see |
| 1127 | # <a href="http://www.ietf.org/rfc/rfc1521.txt">RFC 1521</a>. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 1128 | # Object with schema name: MessagePart |
| 1129 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1130 | "headers": [ # List of headers on this message part. For the top-level message part, |
| 1131 | # representing the entire message payload, it will contain the standard |
| 1132 | # RFC 2822 email headers such as `To`, `From`, and |
| 1133 | # `Subject`. |
| 1134 | { |
| 1135 | "name": "A String", # The name of the header before the `:` separator. For |
| 1136 | # example, `To`. |
| 1137 | "value": "A String", # The value of the header after the `:` separator. For example, |
| 1138 | # `someuser@example.com`. |
| 1139 | }, |
| 1140 | ], |
| 1141 | "filename": "A String", # The filename of the attachment. Only present if this message part |
| 1142 | # represents an attachment. |
| 1143 | "partId": "A String", # The immutable ID of the message part. |
| 1144 | "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for |
| 1145 | # container MIME message parts. |
| 1146 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
| 1147 | "attachmentId": "A String", # When present, contains the ID of an external attachment that can be |
| 1148 | # retrieved in a separate `messages.attachments.get` request. |
| 1149 | # When not present, the entire content of the message part body is |
| 1150 | # contained in the data field. |
| 1151 | "data": "A String", # The body data of a MIME message part as a base64url encoded string. |
| 1152 | # May be empty for MIME container |
| 1153 | # types that have no message body or when the body data is sent as a |
| 1154 | # separate attachment. An attachment ID is present if the body data is |
| 1155 | # contained in a separate attachment. |
| 1156 | }, |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 1157 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1158 | "historyId": "A String", # The ID of the last history record that modified this message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1159 | "snippet": "A String", # A short part of the message text. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1160 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url |
| 1161 | # encoded string. Returned in `messages.get` and |
| 1162 | # `drafts.get` responses when the `format=RAW` |
| 1163 | # parameter is supplied. |
| 1164 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 1165 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 1166 | "labelIds": [ # List of IDs of labels applied to this message. |
| 1167 | # @mutable gmail.users.messages.insert gmail.users.messages.modify |
| 1168 | "A String", |
| 1169 | ], |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 1170 | }</pre> |
| 1171 | </div> |
| 1172 | |
| 1173 | </body></html> |