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