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