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.drafts.html">drafts</a></h1> |
| 76 | <h2>Instance Methods</h2> |
| 77 | <p class="toc_element"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 78 | <code><a href="#create">create(userId, body=None, x__xgafv=None, media_body=None, media_mime_type=None)</a></code></p> |
| 79 | <p class="firstline">Creates a new draft with the `DRAFT` label.</p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 80 | <p class="toc_element"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 81 | <code><a href="#delete">delete(userId, id, x__xgafv=None)</a></code></p> |
| 82 | <p class="firstline">Immediately and permanently deletes the specified draft.</p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 83 | <p class="toc_element"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 84 | <code><a href="#get">get(userId, id, format=None, x__xgafv=None)</a></code></p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 85 | <p class="firstline">Gets the specified draft.</p> |
| 86 | <p class="toc_element"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 87 | <code><a href="#list">list(userId, maxResults=None, q=None, includeSpamTrash=None, pageToken=None, x__xgafv=None)</a></code></p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 88 | <p class="firstline">Lists the drafts in the user's mailbox.</p> |
| 89 | <p class="toc_element"> |
| 90 | <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> |
| 91 | <p class="firstline">Retrieves the next page of results.</p> |
| 92 | <p class="toc_element"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 93 | <code><a href="#send">send(userId, body=None, x__xgafv=None, media_body=None, media_mime_type=None)</a></code></p> |
| 94 | <p class="firstline">Sends the specified, existing draft to the recipients in the</p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 95 | <p class="toc_element"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 96 | <code><a href="#update">update(userId, id, body=None, x__xgafv=None, media_body=None, media_mime_type=None)</a></code></p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 97 | <p class="firstline">Replaces a draft's content.</p> |
| 98 | <h3>Method Details</h3> |
| 99 | <div class="method"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 100 | <code class="details" id="create">create(userId, body=None, x__xgafv=None, media_body=None, media_mime_type=None)</code> |
| 101 | <pre>Creates a new draft with the `DRAFT` label. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 102 | |
| 103 | Args: |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 104 | userId: string, The user's email address. The special value `me` |
| 105 | can be used to indicate the authenticated user. (required) |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 106 | body: object, The request body. |
| 107 | The object takes the form of: |
| 108 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 109 | { # A draft email in the user's mailbox. |
| 110 | "id": "A String", # The immutable ID of the draft. |
| 111 | "message": { # An email message. # The message content of the draft. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 112 | "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to |
| 113 | # a thread, the following criteria must be met: |
| 114 | # <ol><li>The requested `threadId` must be specified on the |
| 115 | # `Message` or `Draft.Message` you supply with your |
| 116 | # request.</li> |
| 117 | # <li>The `References` and `In-Reply-To` headers must |
| 118 | # be set in compliance with the |
| 119 | # <a href="https://tools.ietf.org/html/rfc2822">RFC 2822</a> standard.</li> |
| 120 | # <li>The `Subject` headers must match. |
| 121 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 122 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 123 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines |
| 124 | # ordering in the inbox. For normal SMTP-received email, this represents the |
| 125 | # time the message was originally accepted by Google, which is more reliable |
| 126 | # than the `Date` header. However, for API-migrated mail, it can |
| 127 | # be configured by client to be based on the `Date` header. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 128 | "id": "A String", # The immutable ID of the message. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 129 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 130 | "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] | 131 | "mimeType": "A String", # The MIME type of the message part. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 132 | "parts": [ # The child MIME message parts of this part. This only applies to container |
| 133 | # MIME message parts, for example `multipart/*`. For non- |
| 134 | # container MIME message part types, such as `text/plain`, this |
| 135 | # field is empty. For more information, see |
| 136 | # <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] | 137 | # Object with schema name: MessagePart |
| 138 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 139 | "headers": [ # List of headers on this message part. For the top-level message part, |
| 140 | # representing the entire message payload, it will contain the standard |
| 141 | # RFC 2822 email headers such as `To`, `From`, and |
| 142 | # `Subject`. |
| 143 | { |
| 144 | "name": "A String", # The name of the header before the `:` separator. For |
| 145 | # example, `To`. |
| 146 | "value": "A String", # The value of the header after the `:` separator. For example, |
| 147 | # `someuser@example.com`. |
| 148 | }, |
| 149 | ], |
| 150 | "filename": "A String", # The filename of the attachment. Only present if this message part |
| 151 | # represents an attachment. |
| 152 | "partId": "A String", # The immutable ID of the message part. |
| 153 | "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for |
| 154 | # container MIME message parts. |
| 155 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
| 156 | "attachmentId": "A String", # When present, contains the ID of an external attachment that can be |
| 157 | # retrieved in a separate `messages.attachments.get` request. |
| 158 | # When not present, the entire content of the message part body is |
| 159 | # contained in the data field. |
| 160 | "data": "A String", # The body data of a MIME message part as a base64url encoded string. |
| 161 | # May be empty for MIME container |
| 162 | # types that have no message body or when the body data is sent as a |
| 163 | # separate attachment. An attachment ID is present if the body data is |
| 164 | # contained in a separate attachment. |
| 165 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 166 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 167 | "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] | 168 | "snippet": "A String", # A short part of the message text. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 169 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url |
| 170 | # encoded string. Returned in `messages.get` and |
| 171 | # `drafts.get` responses when the `format=RAW` |
| 172 | # parameter is supplied. |
| 173 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 174 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 175 | "labelIds": [ # List of IDs of labels applied to this message. |
| 176 | # @mutable gmail.users.messages.insert gmail.users.messages.modify |
| 177 | "A String", |
| 178 | ], |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 179 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 180 | } |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 181 | |
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 | 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] | 187 | 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] | 188 | |
| 189 | Returns: |
| 190 | An object of the form: |
| 191 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 192 | { # A draft email in the user's mailbox. |
| 193 | "id": "A String", # The immutable ID of the draft. |
| 194 | "message": { # An email message. # The message content of the draft. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 195 | "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to |
| 196 | # a thread, the following criteria must be met: |
| 197 | # <ol><li>The requested `threadId` must be specified on the |
| 198 | # `Message` or `Draft.Message` you supply with your |
| 199 | # request.</li> |
| 200 | # <li>The `References` and `In-Reply-To` headers must |
| 201 | # be set in compliance with the |
| 202 | # <a href="https://tools.ietf.org/html/rfc2822">RFC 2822</a> standard.</li> |
| 203 | # <li>The `Subject` headers must match. |
| 204 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 205 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 206 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines |
| 207 | # ordering in the inbox. For normal SMTP-received email, this represents the |
| 208 | # time the message was originally accepted by Google, which is more reliable |
| 209 | # than the `Date` header. However, for API-migrated mail, it can |
| 210 | # be configured by client to be based on the `Date` header. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 211 | "id": "A String", # The immutable ID of the message. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 212 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 213 | "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] | 214 | "mimeType": "A String", # The MIME type of the message part. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 215 | "parts": [ # The child MIME message parts of this part. This only applies to container |
| 216 | # MIME message parts, for example `multipart/*`. For non- |
| 217 | # container MIME message part types, such as `text/plain`, this |
| 218 | # field is empty. For more information, see |
| 219 | # <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] | 220 | # Object with schema name: MessagePart |
| 221 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 222 | "headers": [ # List of headers on this message part. For the top-level message part, |
| 223 | # representing the entire message payload, it will contain the standard |
| 224 | # RFC 2822 email headers such as `To`, `From`, and |
| 225 | # `Subject`. |
| 226 | { |
| 227 | "name": "A String", # The name of the header before the `:` separator. For |
| 228 | # example, `To`. |
| 229 | "value": "A String", # The value of the header after the `:` separator. For example, |
| 230 | # `someuser@example.com`. |
| 231 | }, |
| 232 | ], |
| 233 | "filename": "A String", # The filename of the attachment. Only present if this message part |
| 234 | # represents an attachment. |
| 235 | "partId": "A String", # The immutable ID of the message part. |
| 236 | "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for |
| 237 | # container MIME message parts. |
| 238 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
| 239 | "attachmentId": "A String", # When present, contains the ID of an external attachment that can be |
| 240 | # retrieved in a separate `messages.attachments.get` request. |
| 241 | # When not present, the entire content of the message part body is |
| 242 | # contained in the data field. |
| 243 | "data": "A String", # The body data of a MIME message part as a base64url encoded string. |
| 244 | # May be empty for MIME container |
| 245 | # types that have no message body or when the body data is sent as a |
| 246 | # separate attachment. An attachment ID is present if the body data is |
| 247 | # contained in a separate attachment. |
| 248 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 249 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 250 | "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] | 251 | "snippet": "A String", # A short part of the message text. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 252 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url |
| 253 | # encoded string. Returned in `messages.get` and |
| 254 | # `drafts.get` responses when the `format=RAW` |
| 255 | # parameter is supplied. |
| 256 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 257 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 258 | "labelIds": [ # List of IDs of labels applied to this message. |
| 259 | # @mutable gmail.users.messages.insert gmail.users.messages.modify |
| 260 | "A String", |
| 261 | ], |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 262 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 263 | }</pre> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 264 | </div> |
| 265 | |
| 266 | <div class="method"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 267 | <code class="details" id="delete">delete(userId, id, x__xgafv=None)</code> |
| 268 | <pre>Immediately and permanently deletes the specified draft. |
| 269 | Does not simply trash it. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 270 | |
| 271 | Args: |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 272 | userId: string, The user's email address. The special value `me` |
| 273 | can be used to indicate the authenticated user. (required) |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 274 | id: string, The ID of the draft to delete. (required) |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 275 | x__xgafv: string, V1 error format. |
| 276 | Allowed values |
| 277 | 1 - v1 error format |
| 278 | 2 - v2 error format |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 279 | </pre> |
| 280 | </div> |
| 281 | |
| 282 | <div class="method"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 283 | <code class="details" id="get">get(userId, id, format=None, x__xgafv=None)</code> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 284 | <pre>Gets the specified draft. |
| 285 | |
| 286 | Args: |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 287 | userId: string, The user's email address. The special value `me` |
| 288 | can be used to indicate the authenticated user. (required) |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 289 | id: string, The ID of the draft to retrieve. (required) |
| 290 | format: string, The format to return the draft in. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 291 | x__xgafv: string, V1 error format. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 292 | Allowed values |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 293 | 1 - v1 error format |
| 294 | 2 - v2 error format |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 295 | |
| 296 | Returns: |
| 297 | An object of the form: |
| 298 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 299 | { # A draft email in the user's mailbox. |
| 300 | "id": "A String", # The immutable ID of the draft. |
| 301 | "message": { # An email message. # The message content of the draft. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 302 | "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to |
| 303 | # a thread, the following criteria must be met: |
| 304 | # <ol><li>The requested `threadId` must be specified on the |
| 305 | # `Message` or `Draft.Message` you supply with your |
| 306 | # request.</li> |
| 307 | # <li>The `References` and `In-Reply-To` headers must |
| 308 | # be set in compliance with the |
| 309 | # <a href="https://tools.ietf.org/html/rfc2822">RFC 2822</a> standard.</li> |
| 310 | # <li>The `Subject` headers must match. |
| 311 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 312 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 313 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines |
| 314 | # ordering in the inbox. For normal SMTP-received email, this represents the |
| 315 | # time the message was originally accepted by Google, which is more reliable |
| 316 | # than the `Date` header. However, for API-migrated mail, it can |
| 317 | # be configured by client to be based on the `Date` header. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 318 | "id": "A String", # The immutable ID of the message. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 319 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 320 | "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] | 321 | "mimeType": "A String", # The MIME type of the message part. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 322 | "parts": [ # The child MIME message parts of this part. This only applies to container |
| 323 | # MIME message parts, for example `multipart/*`. For non- |
| 324 | # container MIME message part types, such as `text/plain`, this |
| 325 | # field is empty. For more information, see |
| 326 | # <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] | 327 | # Object with schema name: MessagePart |
| 328 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 329 | "headers": [ # List of headers on this message part. For the top-level message part, |
| 330 | # representing the entire message payload, it will contain the standard |
| 331 | # RFC 2822 email headers such as `To`, `From`, and |
| 332 | # `Subject`. |
| 333 | { |
| 334 | "name": "A String", # The name of the header before the `:` separator. For |
| 335 | # example, `To`. |
| 336 | "value": "A String", # The value of the header after the `:` separator. For example, |
| 337 | # `someuser@example.com`. |
| 338 | }, |
| 339 | ], |
| 340 | "filename": "A String", # The filename of the attachment. Only present if this message part |
| 341 | # represents an attachment. |
| 342 | "partId": "A String", # The immutable ID of the message part. |
| 343 | "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for |
| 344 | # container MIME message parts. |
| 345 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
| 346 | "attachmentId": "A String", # When present, contains the ID of an external attachment that can be |
| 347 | # retrieved in a separate `messages.attachments.get` request. |
| 348 | # When not present, the entire content of the message part body is |
| 349 | # contained in the data field. |
| 350 | "data": "A String", # The body data of a MIME message part as a base64url encoded string. |
| 351 | # May be empty for MIME container |
| 352 | # types that have no message body or when the body data is sent as a |
| 353 | # separate attachment. An attachment ID is present if the body data is |
| 354 | # contained in a separate attachment. |
| 355 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 356 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 357 | "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] | 358 | "snippet": "A String", # A short part of the message text. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 359 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url |
| 360 | # encoded string. Returned in `messages.get` and |
| 361 | # `drafts.get` responses when the `format=RAW` |
| 362 | # parameter is supplied. |
| 363 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 364 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 365 | "labelIds": [ # List of IDs of labels applied to this message. |
| 366 | # @mutable gmail.users.messages.insert gmail.users.messages.modify |
| 367 | "A String", |
| 368 | ], |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 369 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 370 | }</pre> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 371 | </div> |
| 372 | |
| 373 | <div class="method"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 374 | <code class="details" id="list">list(userId, maxResults=None, q=None, includeSpamTrash=None, pageToken=None, x__xgafv=None)</code> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 375 | <pre>Lists the drafts in the user's mailbox. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 376 | |
| 377 | Args: |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 378 | userId: string, The user's email address. The special value `me` |
| 379 | can be used to indicate the authenticated user. (required) |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 380 | maxResults: integer, Maximum number of drafts to return. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 381 | q: string, Only return draft messages matching the specified query. Supports the same |
| 382 | query format as the Gmail search box. For example, |
| 383 | `"from:someuser@example.com rfc822msgid:<somemsgid@example.com> |
| 384 | is:unread"`. |
| 385 | includeSpamTrash: boolean, Include drafts from `SPAM` and `TRASH` |
| 386 | in the results. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 387 | 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] | 388 | x__xgafv: string, V1 error format. |
| 389 | Allowed values |
| 390 | 1 - v1 error format |
| 391 | 2 - v2 error format |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 392 | |
| 393 | Returns: |
| 394 | An object of the form: |
| 395 | |
| 396 | { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 397 | "nextPageToken": "A String", # Token to retrieve the next page of results in the list. |
| 398 | "drafts": [ # List of drafts. Note that the `Message` property in each |
| 399 | # `Draft` resource only contains an `id` and a |
| 400 | # `threadId`. The |
| 401 | # <a href="/gmail/api/v1/reference/users/messages/get">messages.get</a> |
| 402 | # method can fetch additional message details. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 403 | { # A draft email in the user's mailbox. |
| 404 | "id": "A String", # The immutable ID of the draft. |
| 405 | "message": { # An email message. # The message content of the draft. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 406 | "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to |
| 407 | # a thread, the following criteria must be met: |
| 408 | # <ol><li>The requested `threadId` must be specified on the |
| 409 | # `Message` or `Draft.Message` you supply with your |
| 410 | # request.</li> |
| 411 | # <li>The `References` and `In-Reply-To` headers must |
| 412 | # be set in compliance with the |
| 413 | # <a href="https://tools.ietf.org/html/rfc2822">RFC 2822</a> standard.</li> |
| 414 | # <li>The `Subject` headers must match. |
| 415 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 416 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 417 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines |
| 418 | # ordering in the inbox. For normal SMTP-received email, this represents the |
| 419 | # time the message was originally accepted by Google, which is more reliable |
| 420 | # than the `Date` header. However, for API-migrated mail, it can |
| 421 | # be configured by client to be based on the `Date` header. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 422 | "id": "A String", # The immutable ID of the message. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 423 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 424 | "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] | 425 | "mimeType": "A String", # The MIME type of the message part. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 426 | "parts": [ # The child MIME message parts of this part. This only applies to container |
| 427 | # MIME message parts, for example `multipart/*`. For non- |
| 428 | # container MIME message part types, such as `text/plain`, this |
| 429 | # field is empty. For more information, see |
| 430 | # <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] | 431 | # Object with schema name: MessagePart |
| 432 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 433 | "headers": [ # List of headers on this message part. For the top-level message part, |
| 434 | # representing the entire message payload, it will contain the standard |
| 435 | # RFC 2822 email headers such as `To`, `From`, and |
| 436 | # `Subject`. |
| 437 | { |
| 438 | "name": "A String", # The name of the header before the `:` separator. For |
| 439 | # example, `To`. |
| 440 | "value": "A String", # The value of the header after the `:` separator. For example, |
| 441 | # `someuser@example.com`. |
| 442 | }, |
| 443 | ], |
| 444 | "filename": "A String", # The filename of the attachment. Only present if this message part |
| 445 | # represents an attachment. |
| 446 | "partId": "A String", # The immutable ID of the message part. |
| 447 | "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for |
| 448 | # container MIME message parts. |
| 449 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
| 450 | "attachmentId": "A String", # When present, contains the ID of an external attachment that can be |
| 451 | # retrieved in a separate `messages.attachments.get` request. |
| 452 | # When not present, the entire content of the message part body is |
| 453 | # contained in the data field. |
| 454 | "data": "A String", # The body data of a MIME message part as a base64url encoded string. |
| 455 | # May be empty for MIME container |
| 456 | # types that have no message body or when the body data is sent as a |
| 457 | # separate attachment. An attachment ID is present if the body data is |
| 458 | # contained in a separate attachment. |
| 459 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 460 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 461 | "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] | 462 | "snippet": "A String", # A short part of the message text. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 463 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url |
| 464 | # encoded string. Returned in `messages.get` and |
| 465 | # `drafts.get` responses when the `format=RAW` |
| 466 | # parameter is supplied. |
| 467 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 468 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 469 | "labelIds": [ # List of IDs of labels applied to this message. |
| 470 | # @mutable gmail.users.messages.insert gmail.users.messages.modify |
| 471 | "A String", |
| 472 | ], |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 473 | }, |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 474 | }, |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 475 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 476 | "resultSizeEstimate": 42, # Estimated total number of results. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 477 | }</pre> |
| 478 | </div> |
| 479 | |
| 480 | <div class="method"> |
| 481 | <code class="details" id="list_next">list_next(previous_request, previous_response)</code> |
| 482 | <pre>Retrieves the next page of results. |
| 483 | |
| 484 | Args: |
| 485 | previous_request: The request for the previous page. (required) |
| 486 | previous_response: The response from the request for the previous page. (required) |
| 487 | |
| 488 | Returns: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 489 | 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] | 490 | page. Returns None if there are no more items in the collection. |
| 491 | </pre> |
| 492 | </div> |
| 493 | |
| 494 | <div class="method"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 495 | <code class="details" id="send">send(userId, body=None, x__xgafv=None, media_body=None, media_mime_type=None)</code> |
| 496 | <pre>Sends the specified, existing draft to the recipients in the |
| 497 | `To`, `Cc`, and `Bcc` headers. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 498 | |
| 499 | Args: |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 500 | userId: string, The user's email address. The special value `me` |
| 501 | can be used to indicate the authenticated user. (required) |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 502 | body: object, The request body. |
| 503 | The object takes the form of: |
| 504 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 505 | { # A draft email in the user's mailbox. |
| 506 | "id": "A String", # The immutable ID of the draft. |
| 507 | "message": { # An email message. # The message content of the draft. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 508 | "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to |
| 509 | # a thread, the following criteria must be met: |
| 510 | # <ol><li>The requested `threadId` must be specified on the |
| 511 | # `Message` or `Draft.Message` you supply with your |
| 512 | # request.</li> |
| 513 | # <li>The `References` and `In-Reply-To` headers must |
| 514 | # be set in compliance with the |
| 515 | # <a href="https://tools.ietf.org/html/rfc2822">RFC 2822</a> standard.</li> |
| 516 | # <li>The `Subject` headers must match. |
| 517 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 518 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 519 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines |
| 520 | # ordering in the inbox. For normal SMTP-received email, this represents the |
| 521 | # time the message was originally accepted by Google, which is more reliable |
| 522 | # than the `Date` header. However, for API-migrated mail, it can |
| 523 | # be configured by client to be based on the `Date` header. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 524 | "id": "A String", # The immutable ID of the message. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 525 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 526 | "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] | 527 | "mimeType": "A String", # The MIME type of the message part. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 528 | "parts": [ # The child MIME message parts of this part. This only applies to container |
| 529 | # MIME message parts, for example `multipart/*`. For non- |
| 530 | # container MIME message part types, such as `text/plain`, this |
| 531 | # field is empty. For more information, see |
| 532 | # <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] | 533 | # Object with schema name: MessagePart |
| 534 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 535 | "headers": [ # List of headers on this message part. For the top-level message part, |
| 536 | # representing the entire message payload, it will contain the standard |
| 537 | # RFC 2822 email headers such as `To`, `From`, and |
| 538 | # `Subject`. |
| 539 | { |
| 540 | "name": "A String", # The name of the header before the `:` separator. For |
| 541 | # example, `To`. |
| 542 | "value": "A String", # The value of the header after the `:` separator. For example, |
| 543 | # `someuser@example.com`. |
| 544 | }, |
| 545 | ], |
| 546 | "filename": "A String", # The filename of the attachment. Only present if this message part |
| 547 | # represents an attachment. |
| 548 | "partId": "A String", # The immutable ID of the message part. |
| 549 | "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for |
| 550 | # container MIME message parts. |
| 551 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
| 552 | "attachmentId": "A String", # When present, contains the ID of an external attachment that can be |
| 553 | # retrieved in a separate `messages.attachments.get` request. |
| 554 | # When not present, the entire content of the message part body is |
| 555 | # contained in the data field. |
| 556 | "data": "A String", # The body data of a MIME message part as a base64url encoded string. |
| 557 | # May be empty for MIME container |
| 558 | # types that have no message body or when the body data is sent as a |
| 559 | # separate attachment. An attachment ID is present if the body data is |
| 560 | # contained in a separate attachment. |
| 561 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 562 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 563 | "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] | 564 | "snippet": "A String", # A short part of the message text. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 565 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url |
| 566 | # encoded string. Returned in `messages.get` and |
| 567 | # `drafts.get` responses when the `format=RAW` |
| 568 | # parameter is supplied. |
| 569 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 570 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 571 | "labelIds": [ # List of IDs of labels applied to this message. |
| 572 | # @mutable gmail.users.messages.insert gmail.users.messages.modify |
| 573 | "A String", |
| 574 | ], |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 575 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 576 | } |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 577 | |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 578 | x__xgafv: string, V1 error format. |
| 579 | Allowed values |
| 580 | 1 - v1 error format |
| 581 | 2 - v2 error format |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 582 | 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] | 583 | 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] | 584 | |
| 585 | Returns: |
| 586 | An object of the form: |
| 587 | |
| 588 | { # An email message. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 589 | "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to |
| 590 | # a thread, the following criteria must be met: |
| 591 | # <ol><li>The requested `threadId` must be specified on the |
| 592 | # `Message` or `Draft.Message` you supply with your |
| 593 | # request.</li> |
| 594 | # <li>The `References` and `In-Reply-To` headers must |
| 595 | # be set in compliance with the |
| 596 | # <a href="https://tools.ietf.org/html/rfc2822">RFC 2822</a> standard.</li> |
| 597 | # <li>The `Subject` headers must match. |
| 598 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 599 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 600 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines |
| 601 | # ordering in the inbox. For normal SMTP-received email, this represents the |
| 602 | # time the message was originally accepted by Google, which is more reliable |
| 603 | # than the `Date` header. However, for API-migrated mail, it can |
| 604 | # be configured by client to be based on the `Date` header. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 605 | "id": "A String", # The immutable ID of the message. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 606 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 607 | "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] | 608 | "mimeType": "A String", # The MIME type of the message part. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 609 | "parts": [ # The child MIME message parts of this part. This only applies to container |
| 610 | # MIME message parts, for example `multipart/*`. For non- |
| 611 | # container MIME message part types, such as `text/plain`, this |
| 612 | # field is empty. For more information, see |
| 613 | # <a href="http://www.ietf.org/rfc/rfc1521.txt">RFC 1521</a>. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 614 | # Object with schema name: MessagePart |
| 615 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 616 | "headers": [ # List of headers on this message part. For the top-level message part, |
| 617 | # representing the entire message payload, it will contain the standard |
| 618 | # RFC 2822 email headers such as `To`, `From`, and |
| 619 | # `Subject`. |
| 620 | { |
| 621 | "name": "A String", # The name of the header before the `:` separator. For |
| 622 | # example, `To`. |
| 623 | "value": "A String", # The value of the header after the `:` separator. For example, |
| 624 | # `someuser@example.com`. |
| 625 | }, |
| 626 | ], |
| 627 | "filename": "A String", # The filename of the attachment. Only present if this message part |
| 628 | # represents an attachment. |
| 629 | "partId": "A String", # The immutable ID of the message part. |
| 630 | "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for |
| 631 | # container MIME message parts. |
| 632 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
| 633 | "attachmentId": "A String", # When present, contains the ID of an external attachment that can be |
| 634 | # retrieved in a separate `messages.attachments.get` request. |
| 635 | # When not present, the entire content of the message part body is |
| 636 | # contained in the data field. |
| 637 | "data": "A String", # The body data of a MIME message part as a base64url encoded string. |
| 638 | # May be empty for MIME container |
| 639 | # types that have no message body or when the body data is sent as a |
| 640 | # separate attachment. An attachment ID is present if the body data is |
| 641 | # contained in a separate attachment. |
| 642 | }, |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 643 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 644 | "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] | 645 | "snippet": "A String", # A short part of the message text. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 646 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url |
| 647 | # encoded string. Returned in `messages.get` and |
| 648 | # `drafts.get` responses when the `format=RAW` |
| 649 | # parameter is supplied. |
| 650 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 651 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 652 | "labelIds": [ # List of IDs of labels applied to this message. |
| 653 | # @mutable gmail.users.messages.insert gmail.users.messages.modify |
| 654 | "A String", |
| 655 | ], |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 656 | }</pre> |
| 657 | </div> |
| 658 | |
| 659 | <div class="method"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 660 | <code class="details" id="update">update(userId, id, body=None, x__xgafv=None, media_body=None, media_mime_type=None)</code> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 661 | <pre>Replaces a draft's content. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 662 | |
| 663 | Args: |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 664 | userId: string, The user's email address. The special value `me` |
| 665 | can be used to indicate the authenticated user. (required) |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 666 | id: string, The ID of the draft to update. (required) |
| 667 | body: object, The request body. |
| 668 | The object takes the form of: |
| 669 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 670 | { # A draft email in the user's mailbox. |
| 671 | "id": "A String", # The immutable ID of the draft. |
| 672 | "message": { # An email message. # The message content of the draft. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 673 | "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to |
| 674 | # a thread, the following criteria must be met: |
| 675 | # <ol><li>The requested `threadId` must be specified on the |
| 676 | # `Message` or `Draft.Message` you supply with your |
| 677 | # request.</li> |
| 678 | # <li>The `References` and `In-Reply-To` headers must |
| 679 | # be set in compliance with the |
| 680 | # <a href="https://tools.ietf.org/html/rfc2822">RFC 2822</a> standard.</li> |
| 681 | # <li>The `Subject` headers must match. |
| 682 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 683 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 684 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines |
| 685 | # ordering in the inbox. For normal SMTP-received email, this represents the |
| 686 | # time the message was originally accepted by Google, which is more reliable |
| 687 | # than the `Date` header. However, for API-migrated mail, it can |
| 688 | # be configured by client to be based on the `Date` header. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 689 | "id": "A String", # The immutable ID of the message. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 690 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 691 | "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] | 692 | "mimeType": "A String", # The MIME type of the message part. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 693 | "parts": [ # The child MIME message parts of this part. This only applies to container |
| 694 | # MIME message parts, for example `multipart/*`. For non- |
| 695 | # container MIME message part types, such as `text/plain`, this |
| 696 | # field is empty. For more information, see |
| 697 | # <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] | 698 | # Object with schema name: MessagePart |
| 699 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 700 | "headers": [ # List of headers on this message part. For the top-level message part, |
| 701 | # representing the entire message payload, it will contain the standard |
| 702 | # RFC 2822 email headers such as `To`, `From`, and |
| 703 | # `Subject`. |
| 704 | { |
| 705 | "name": "A String", # The name of the header before the `:` separator. For |
| 706 | # example, `To`. |
| 707 | "value": "A String", # The value of the header after the `:` separator. For example, |
| 708 | # `someuser@example.com`. |
| 709 | }, |
| 710 | ], |
| 711 | "filename": "A String", # The filename of the attachment. Only present if this message part |
| 712 | # represents an attachment. |
| 713 | "partId": "A String", # The immutable ID of the message part. |
| 714 | "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for |
| 715 | # container MIME message parts. |
| 716 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
| 717 | "attachmentId": "A String", # When present, contains the ID of an external attachment that can be |
| 718 | # retrieved in a separate `messages.attachments.get` request. |
| 719 | # When not present, the entire content of the message part body is |
| 720 | # contained in the data field. |
| 721 | "data": "A String", # The body data of a MIME message part as a base64url encoded string. |
| 722 | # May be empty for MIME container |
| 723 | # types that have no message body or when the body data is sent as a |
| 724 | # separate attachment. An attachment ID is present if the body data is |
| 725 | # contained in a separate attachment. |
| 726 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 727 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 728 | "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] | 729 | "snippet": "A String", # A short part of the message text. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 730 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url |
| 731 | # encoded string. Returned in `messages.get` and |
| 732 | # `drafts.get` responses when the `format=RAW` |
| 733 | # parameter is supplied. |
| 734 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 735 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 736 | "labelIds": [ # List of IDs of labels applied to this message. |
| 737 | # @mutable gmail.users.messages.insert gmail.users.messages.modify |
| 738 | "A String", |
| 739 | ], |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 740 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 741 | } |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 742 | |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 743 | x__xgafv: string, V1 error format. |
| 744 | Allowed values |
| 745 | 1 - v1 error format |
| 746 | 2 - v2 error format |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 747 | 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] | 748 | 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] | 749 | |
| 750 | Returns: |
| 751 | An object of the form: |
| 752 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 753 | { # A draft email in the user's mailbox. |
| 754 | "id": "A String", # The immutable ID of the draft. |
| 755 | "message": { # An email message. # The message content of the draft. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 756 | "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to |
| 757 | # a thread, the following criteria must be met: |
| 758 | # <ol><li>The requested `threadId` must be specified on the |
| 759 | # `Message` or `Draft.Message` you supply with your |
| 760 | # request.</li> |
| 761 | # <li>The `References` and `In-Reply-To` headers must |
| 762 | # be set in compliance with the |
| 763 | # <a href="https://tools.ietf.org/html/rfc2822">RFC 2822</a> standard.</li> |
| 764 | # <li>The `Subject` headers must match. |
| 765 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 766 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 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 `Date` header. However, for API-migrated mail, it can |
| 771 | # be configured by client to be based on the `Date` header. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 772 | "id": "A String", # The immutable ID of the message. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 773 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 774 | "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] | 775 | "mimeType": "A String", # The MIME type of the message part. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 776 | "parts": [ # The child MIME message parts of this part. This only applies to container |
| 777 | # MIME message parts, for example `multipart/*`. For non- |
| 778 | # container MIME message part types, such as `text/plain`, this |
| 779 | # field is empty. For more information, see |
| 780 | # <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] | 781 | # Object with schema name: MessagePart |
| 782 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 783 | "headers": [ # List of headers on this message part. For the top-level message part, |
| 784 | # representing the entire message payload, it will contain the standard |
| 785 | # RFC 2822 email headers such as `To`, `From`, and |
| 786 | # `Subject`. |
| 787 | { |
| 788 | "name": "A String", # The name of the header before the `:` separator. For |
| 789 | # example, `To`. |
| 790 | "value": "A String", # The value of the header after the `:` separator. For example, |
| 791 | # `someuser@example.com`. |
| 792 | }, |
| 793 | ], |
| 794 | "filename": "A String", # The filename of the attachment. Only present if this message part |
| 795 | # represents an attachment. |
| 796 | "partId": "A String", # The immutable ID of the message part. |
| 797 | "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for |
| 798 | # container MIME message parts. |
| 799 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
| 800 | "attachmentId": "A String", # When present, contains the ID of an external attachment that can be |
| 801 | # retrieved in a separate `messages.attachments.get` request. |
| 802 | # When not present, the entire content of the message part body is |
| 803 | # contained in the data field. |
| 804 | "data": "A String", # The body data of a MIME message part as a base64url encoded string. |
| 805 | # May be empty for MIME container |
| 806 | # types that have no message body or when the body data is sent as a |
| 807 | # separate attachment. An attachment ID is present if the body data is |
| 808 | # contained in a separate attachment. |
| 809 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 810 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 811 | "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] | 812 | "snippet": "A String", # A short part of the message text. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 813 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url |
| 814 | # encoded string. Returned in `messages.get` and |
| 815 | # `drafts.get` responses when the `format=RAW` |
| 816 | # parameter is supplied. |
| 817 | # @mutable gmail.users.messages.insert gmail.users.messages.send |
| 818 | # @mutable gmail.users.drafts.create gmail.users.drafts.update |
| 819 | "labelIds": [ # List of IDs of labels applied to this message. |
| 820 | # @mutable gmail.users.messages.insert gmail.users.messages.modify |
| 821 | "A String", |
| 822 | ], |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 823 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 824 | }</pre> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 825 | </div> |
| 826 | |
| 827 | </body></html> |