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"> |
| 78 | <code><a href="#create">create(userId, body=None, media_body=None)</a></code></p> |
| 79 | <p class="firstline">Creates a new draft with the DRAFT label.</p> |
| 80 | <p class="toc_element"> |
| 81 | <code><a href="#delete">delete(userId, id)</a></code></p> |
| 82 | <p class="firstline">Immediately and permanently deletes the specified draft. Does not simply trash it.</p> |
| 83 | <p class="toc_element"> |
| 84 | <code><a href="#get">get(userId, id, format=None)</a></code></p> |
| 85 | <p class="firstline">Gets the specified draft.</p> |
| 86 | <p class="toc_element"> |
| 87 | <code><a href="#list">list(userId, pageToken=None, maxResults=None)</a></code></p> |
| 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"> |
| 93 | <code><a href="#send">send(userId, body=None, media_body=None)</a></code></p> |
| 94 | <p class="firstline">Sends the specified, existing draft to the recipients in the To, Cc, and Bcc headers.</p> |
| 95 | <p class="toc_element"> |
| 96 | <code><a href="#update">update(userId, id, body=None, media_body=None)</a></code></p> |
| 97 | <p class="firstline">Replaces a draft's content.</p> |
| 98 | <h3>Method Details</h3> |
| 99 | <div class="method"> |
| 100 | <code class="details" id="create">create(userId, body=None, media_body=None)</code> |
| 101 | <pre>Creates a new draft with the DRAFT label. |
| 102 | |
| 103 | Args: |
| 104 | userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required) |
| 105 | body: object, The request body. |
| 106 | The object takes the form of: |
| 107 | |
| 108 | { # A draft email in the user's mailbox. |
| 109 | "message": { # An email message. # The message content of the draft. |
| 110 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 111 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 112 | "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for container MIME message parts. |
| 113 | "data": "A String", # The body data of a MIME message part. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment. |
| 114 | "attachmentId": "A String", # When present, contains the ID of an external attachment that can be retrieved in a separate messages.attachments.get request. When not present, the entire content of the message part body is contained in the data field. |
| 115 | "size": 42, # Total number of bytes in the body of the message part. |
| 116 | }, |
| 117 | "mimeType": "A String", # The MIME type of the message part. |
| 118 | "partId": "A String", # The immutable ID of the message part. |
| 119 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
| 120 | "headers": [ # List of headers on this message part. For the top-level message part, representing the entire message payload, it will contain the standard RFC 2822 email headers such as To, From, and Subject. |
| 121 | { |
| 122 | "name": "A String", # The name of the header before the : separator. For example, To. |
| 123 | "value": "A String", # The value of the header after the : separator. For example, someuser@example.com. |
| 124 | }, |
| 125 | ], |
| 126 | "parts": [ # The child MIME message parts of this part. This only applies to container MIME message parts, for example multipart/*. For non- container MIME message part types, such as text/plain, this field is empty. For more information, see RFC 1521. |
| 127 | # Object with schema name: MessagePart |
| 128 | ], |
| 129 | }, |
| 130 | "snippet": "A String", # A short part of the message text. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 131 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 132 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 133 | "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met: |
| 134 | # - The requested threadId must be specified on the Message or Draft.Message you supply with your request. |
Craig Citro | 0e5b9bf | 2014-10-15 10:26:14 -0700 | [diff] [blame] | 135 | # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 136 | # - The Subject headers must match. |
| 137 | "labelIds": [ # List of IDs of labels applied to this message. |
| 138 | "A String", |
| 139 | ], |
| 140 | "id": "A String", # The immutable ID of the message. |
| 141 | }, |
| 142 | "id": "A String", # The immutable ID of the draft. |
| 143 | } |
| 144 | |
| 145 | media_body: string, The filename of the media request body, or an instance of a MediaUpload object. |
| 146 | |
| 147 | Returns: |
| 148 | An object of the form: |
| 149 | |
| 150 | { # A draft email in the user's mailbox. |
| 151 | "message": { # An email message. # The message content of the draft. |
| 152 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 153 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 154 | "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for container MIME message parts. |
| 155 | "data": "A String", # The body data of a MIME message part. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment. |
| 156 | "attachmentId": "A String", # When present, contains the ID of an external attachment that can be retrieved in a separate messages.attachments.get request. When not present, the entire content of the message part body is contained in the data field. |
| 157 | "size": 42, # Total number of bytes in the body of the message part. |
| 158 | }, |
| 159 | "mimeType": "A String", # The MIME type of the message part. |
| 160 | "partId": "A String", # The immutable ID of the message part. |
| 161 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
| 162 | "headers": [ # List of headers on this message part. For the top-level message part, representing the entire message payload, it will contain the standard RFC 2822 email headers such as To, From, and Subject. |
| 163 | { |
| 164 | "name": "A String", # The name of the header before the : separator. For example, To. |
| 165 | "value": "A String", # The value of the header after the : separator. For example, someuser@example.com. |
| 166 | }, |
| 167 | ], |
| 168 | "parts": [ # The child MIME message parts of this part. This only applies to container MIME message parts, for example multipart/*. For non- container MIME message part types, such as text/plain, this field is empty. For more information, see RFC 1521. |
| 169 | # Object with schema name: MessagePart |
| 170 | ], |
| 171 | }, |
| 172 | "snippet": "A String", # A short part of the message text. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 173 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 174 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 175 | "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met: |
| 176 | # - The requested threadId must be specified on the Message or Draft.Message you supply with your request. |
Craig Citro | 0e5b9bf | 2014-10-15 10:26:14 -0700 | [diff] [blame] | 177 | # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 178 | # - The Subject headers must match. |
| 179 | "labelIds": [ # List of IDs of labels applied to this message. |
| 180 | "A String", |
| 181 | ], |
| 182 | "id": "A String", # The immutable ID of the message. |
| 183 | }, |
| 184 | "id": "A String", # The immutable ID of the draft. |
| 185 | }</pre> |
| 186 | </div> |
| 187 | |
| 188 | <div class="method"> |
| 189 | <code class="details" id="delete">delete(userId, id)</code> |
| 190 | <pre>Immediately and permanently deletes the specified draft. Does not simply trash it. |
| 191 | |
| 192 | Args: |
| 193 | userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required) |
| 194 | id: string, The ID of the draft to delete. (required) |
| 195 | </pre> |
| 196 | </div> |
| 197 | |
| 198 | <div class="method"> |
| 199 | <code class="details" id="get">get(userId, id, format=None)</code> |
| 200 | <pre>Gets the specified draft. |
| 201 | |
| 202 | Args: |
| 203 | userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required) |
| 204 | id: string, The ID of the draft to retrieve. (required) |
| 205 | format: string, The format to return the draft in. |
| 206 | Allowed values |
| 207 | full - |
Craig Citro | 0e5b9bf | 2014-10-15 10:26:14 -0700 | [diff] [blame] | 208 | metadata - |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 209 | minimal - |
| 210 | raw - |
| 211 | |
| 212 | Returns: |
| 213 | An object of the form: |
| 214 | |
| 215 | { # A draft email in the user's mailbox. |
| 216 | "message": { # An email message. # The message content of the draft. |
| 217 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 218 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 219 | "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for container MIME message parts. |
| 220 | "data": "A String", # The body data of a MIME message part. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment. |
| 221 | "attachmentId": "A String", # When present, contains the ID of an external attachment that can be retrieved in a separate messages.attachments.get request. When not present, the entire content of the message part body is contained in the data field. |
| 222 | "size": 42, # Total number of bytes in the body of the message part. |
| 223 | }, |
| 224 | "mimeType": "A String", # The MIME type of the message part. |
| 225 | "partId": "A String", # The immutable ID of the message part. |
| 226 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
| 227 | "headers": [ # List of headers on this message part. For the top-level message part, representing the entire message payload, it will contain the standard RFC 2822 email headers such as To, From, and Subject. |
| 228 | { |
| 229 | "name": "A String", # The name of the header before the : separator. For example, To. |
| 230 | "value": "A String", # The value of the header after the : separator. For example, someuser@example.com. |
| 231 | }, |
| 232 | ], |
| 233 | "parts": [ # The child MIME message parts of this part. This only applies to container MIME message parts, for example multipart/*. For non- container MIME message part types, such as text/plain, this field is empty. For more information, see RFC 1521. |
| 234 | # Object with schema name: MessagePart |
| 235 | ], |
| 236 | }, |
| 237 | "snippet": "A String", # A short part of the message text. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 238 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 239 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 240 | "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met: |
| 241 | # - The requested threadId must be specified on the Message or Draft.Message you supply with your request. |
Craig Citro | 0e5b9bf | 2014-10-15 10:26:14 -0700 | [diff] [blame] | 242 | # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 243 | # - The Subject headers must match. |
| 244 | "labelIds": [ # List of IDs of labels applied to this message. |
| 245 | "A String", |
| 246 | ], |
| 247 | "id": "A String", # The immutable ID of the message. |
| 248 | }, |
| 249 | "id": "A String", # The immutable ID of the draft. |
| 250 | }</pre> |
| 251 | </div> |
| 252 | |
| 253 | <div class="method"> |
| 254 | <code class="details" id="list">list(userId, pageToken=None, maxResults=None)</code> |
| 255 | <pre>Lists the drafts in the user's mailbox. |
| 256 | |
| 257 | Args: |
| 258 | userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required) |
| 259 | pageToken: string, Page token to retrieve a specific page of results in the list. |
| 260 | maxResults: integer, Maximum number of drafts to return. |
| 261 | |
| 262 | Returns: |
| 263 | An object of the form: |
| 264 | |
| 265 | { |
| 266 | "nextPageToken": "A String", # Token to retrieve the next page of results in the list. |
| 267 | "resultSizeEstimate": 42, # Estimated total number of results. |
| 268 | "drafts": [ # List of drafts. |
| 269 | { # A draft email in the user's mailbox. |
| 270 | "message": { # An email message. # The message content of the draft. |
| 271 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 272 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 273 | "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for container MIME message parts. |
| 274 | "data": "A String", # The body data of a MIME message part. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment. |
| 275 | "attachmentId": "A String", # When present, contains the ID of an external attachment that can be retrieved in a separate messages.attachments.get request. When not present, the entire content of the message part body is contained in the data field. |
| 276 | "size": 42, # Total number of bytes in the body of the message part. |
| 277 | }, |
| 278 | "mimeType": "A String", # The MIME type of the message part. |
| 279 | "partId": "A String", # The immutable ID of the message part. |
| 280 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
| 281 | "headers": [ # List of headers on this message part. For the top-level message part, representing the entire message payload, it will contain the standard RFC 2822 email headers such as To, From, and Subject. |
| 282 | { |
| 283 | "name": "A String", # The name of the header before the : separator. For example, To. |
| 284 | "value": "A String", # The value of the header after the : separator. For example, someuser@example.com. |
| 285 | }, |
| 286 | ], |
| 287 | "parts": [ # The child MIME message parts of this part. This only applies to container MIME message parts, for example multipart/*. For non- container MIME message part types, such as text/plain, this field is empty. For more information, see RFC 1521. |
| 288 | # Object with schema name: MessagePart |
| 289 | ], |
| 290 | }, |
| 291 | "snippet": "A String", # A short part of the message text. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 292 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 293 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 294 | "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met: |
| 295 | # - The requested threadId must be specified on the Message or Draft.Message you supply with your request. |
Craig Citro | 0e5b9bf | 2014-10-15 10:26:14 -0700 | [diff] [blame] | 296 | # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 297 | # - The Subject headers must match. |
| 298 | "labelIds": [ # List of IDs of labels applied to this message. |
| 299 | "A String", |
| 300 | ], |
| 301 | "id": "A String", # The immutable ID of the message. |
| 302 | }, |
| 303 | "id": "A String", # The immutable ID of the draft. |
| 304 | }, |
| 305 | ], |
| 306 | }</pre> |
| 307 | </div> |
| 308 | |
| 309 | <div class="method"> |
| 310 | <code class="details" id="list_next">list_next(previous_request, previous_response)</code> |
| 311 | <pre>Retrieves the next page of results. |
| 312 | |
| 313 | Args: |
| 314 | previous_request: The request for the previous page. (required) |
| 315 | previous_response: The response from the request for the previous page. (required) |
| 316 | |
| 317 | Returns: |
| 318 | A request object that you can call 'execute()' on to request the next |
| 319 | page. Returns None if there are no more items in the collection. |
| 320 | </pre> |
| 321 | </div> |
| 322 | |
| 323 | <div class="method"> |
| 324 | <code class="details" id="send">send(userId, body=None, media_body=None)</code> |
| 325 | <pre>Sends the specified, existing draft to the recipients in the To, Cc, and Bcc headers. |
| 326 | |
| 327 | Args: |
| 328 | userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required) |
| 329 | body: object, The request body. |
| 330 | The object takes the form of: |
| 331 | |
| 332 | { # A draft email in the user's mailbox. |
| 333 | "message": { # An email message. # The message content of the draft. |
| 334 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 335 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 336 | "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for container MIME message parts. |
| 337 | "data": "A String", # The body data of a MIME message part. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment. |
| 338 | "attachmentId": "A String", # When present, contains the ID of an external attachment that can be retrieved in a separate messages.attachments.get request. When not present, the entire content of the message part body is contained in the data field. |
| 339 | "size": 42, # Total number of bytes in the body of the message part. |
| 340 | }, |
| 341 | "mimeType": "A String", # The MIME type of the message part. |
| 342 | "partId": "A String", # The immutable ID of the message part. |
| 343 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
| 344 | "headers": [ # List of headers on this message part. For the top-level message part, representing the entire message payload, it will contain the standard RFC 2822 email headers such as To, From, and Subject. |
| 345 | { |
| 346 | "name": "A String", # The name of the header before the : separator. For example, To. |
| 347 | "value": "A String", # The value of the header after the : separator. For example, someuser@example.com. |
| 348 | }, |
| 349 | ], |
| 350 | "parts": [ # The child MIME message parts of this part. This only applies to container MIME message parts, for example multipart/*. For non- container MIME message part types, such as text/plain, this field is empty. For more information, see RFC 1521. |
| 351 | # Object with schema name: MessagePart |
| 352 | ], |
| 353 | }, |
| 354 | "snippet": "A String", # A short part of the message text. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 355 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 356 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 357 | "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met: |
| 358 | # - The requested threadId must be specified on the Message or Draft.Message you supply with your request. |
Craig Citro | 0e5b9bf | 2014-10-15 10:26:14 -0700 | [diff] [blame] | 359 | # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 360 | # - The Subject headers must match. |
| 361 | "labelIds": [ # List of IDs of labels applied to this message. |
| 362 | "A String", |
| 363 | ], |
| 364 | "id": "A String", # The immutable ID of the message. |
| 365 | }, |
| 366 | "id": "A String", # The immutable ID of the draft. |
| 367 | } |
| 368 | |
| 369 | media_body: string, The filename of the media request body, or an instance of a MediaUpload object. |
| 370 | |
| 371 | Returns: |
| 372 | An object of the form: |
| 373 | |
| 374 | { # An email message. |
| 375 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 376 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 377 | "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for container MIME message parts. |
| 378 | "data": "A String", # The body data of a MIME message part. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment. |
| 379 | "attachmentId": "A String", # When present, contains the ID of an external attachment that can be retrieved in a separate messages.attachments.get request. When not present, the entire content of the message part body is contained in the data field. |
| 380 | "size": 42, # Total number of bytes in the body of the message part. |
| 381 | }, |
| 382 | "mimeType": "A String", # The MIME type of the message part. |
| 383 | "partId": "A String", # The immutable ID of the message part. |
| 384 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
| 385 | "headers": [ # List of headers on this message part. For the top-level message part, representing the entire message payload, it will contain the standard RFC 2822 email headers such as To, From, and Subject. |
| 386 | { |
| 387 | "name": "A String", # The name of the header before the : separator. For example, To. |
| 388 | "value": "A String", # The value of the header after the : separator. For example, someuser@example.com. |
| 389 | }, |
| 390 | ], |
| 391 | "parts": [ # The child MIME message parts of this part. This only applies to container MIME message parts, for example multipart/*. For non- container MIME message part types, such as text/plain, this field is empty. For more information, see RFC 1521. |
| 392 | # Object with schema name: MessagePart |
| 393 | ], |
| 394 | }, |
| 395 | "snippet": "A String", # A short part of the message text. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 396 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 397 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 398 | "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met: |
| 399 | # - The requested threadId must be specified on the Message or Draft.Message you supply with your request. |
Craig Citro | 0e5b9bf | 2014-10-15 10:26:14 -0700 | [diff] [blame] | 400 | # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 401 | # - The Subject headers must match. |
| 402 | "labelIds": [ # List of IDs of labels applied to this message. |
| 403 | "A String", |
| 404 | ], |
| 405 | "id": "A String", # The immutable ID of the message. |
| 406 | }</pre> |
| 407 | </div> |
| 408 | |
| 409 | <div class="method"> |
| 410 | <code class="details" id="update">update(userId, id, body=None, media_body=None)</code> |
| 411 | <pre>Replaces a draft's content. |
| 412 | |
| 413 | Args: |
| 414 | userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required) |
| 415 | id: string, The ID of the draft to update. (required) |
| 416 | body: object, The request body. |
| 417 | The object takes the form of: |
| 418 | |
| 419 | { # A draft email in the user's mailbox. |
| 420 | "message": { # An email message. # The message content of the draft. |
| 421 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 422 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 423 | "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for container MIME message parts. |
| 424 | "data": "A String", # The body data of a MIME message part. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment. |
| 425 | "attachmentId": "A String", # When present, contains the ID of an external attachment that can be retrieved in a separate messages.attachments.get request. When not present, the entire content of the message part body is contained in the data field. |
| 426 | "size": 42, # Total number of bytes in the body of the message part. |
| 427 | }, |
| 428 | "mimeType": "A String", # The MIME type of the message part. |
| 429 | "partId": "A String", # The immutable ID of the message part. |
| 430 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
| 431 | "headers": [ # List of headers on this message part. For the top-level message part, representing the entire message payload, it will contain the standard RFC 2822 email headers such as To, From, and Subject. |
| 432 | { |
| 433 | "name": "A String", # The name of the header before the : separator. For example, To. |
| 434 | "value": "A String", # The value of the header after the : separator. For example, someuser@example.com. |
| 435 | }, |
| 436 | ], |
| 437 | "parts": [ # The child MIME message parts of this part. This only applies to container MIME message parts, for example multipart/*. For non- container MIME message part types, such as text/plain, this field is empty. For more information, see RFC 1521. |
| 438 | # Object with schema name: MessagePart |
| 439 | ], |
| 440 | }, |
| 441 | "snippet": "A String", # A short part of the message text. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 442 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 443 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 444 | "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met: |
| 445 | # - The requested threadId must be specified on the Message or Draft.Message you supply with your request. |
Craig Citro | 0e5b9bf | 2014-10-15 10:26:14 -0700 | [diff] [blame] | 446 | # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 447 | # - The Subject headers must match. |
| 448 | "labelIds": [ # List of IDs of labels applied to this message. |
| 449 | "A String", |
| 450 | ], |
| 451 | "id": "A String", # The immutable ID of the message. |
| 452 | }, |
| 453 | "id": "A String", # The immutable ID of the draft. |
| 454 | } |
| 455 | |
| 456 | media_body: string, The filename of the media request body, or an instance of a MediaUpload object. |
| 457 | |
| 458 | Returns: |
| 459 | An object of the form: |
| 460 | |
| 461 | { # A draft email in the user's mailbox. |
| 462 | "message": { # An email message. # The message content of the draft. |
| 463 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 464 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 465 | "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for container MIME message parts. |
| 466 | "data": "A String", # The body data of a MIME message part. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment. |
| 467 | "attachmentId": "A String", # When present, contains the ID of an external attachment that can be retrieved in a separate messages.attachments.get request. When not present, the entire content of the message part body is contained in the data field. |
| 468 | "size": 42, # Total number of bytes in the body of the message part. |
| 469 | }, |
| 470 | "mimeType": "A String", # The MIME type of the message part. |
| 471 | "partId": "A String", # The immutable ID of the message part. |
| 472 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
| 473 | "headers": [ # List of headers on this message part. For the top-level message part, representing the entire message payload, it will contain the standard RFC 2822 email headers such as To, From, and Subject. |
| 474 | { |
| 475 | "name": "A String", # The name of the header before the : separator. For example, To. |
| 476 | "value": "A String", # The value of the header after the : separator. For example, someuser@example.com. |
| 477 | }, |
| 478 | ], |
| 479 | "parts": [ # The child MIME message parts of this part. This only applies to container MIME message parts, for example multipart/*. For non- container MIME message part types, such as text/plain, this field is empty. For more information, see RFC 1521. |
| 480 | # Object with schema name: MessagePart |
| 481 | ], |
| 482 | }, |
| 483 | "snippet": "A String", # A short part of the message text. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 484 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 485 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 486 | "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met: |
| 487 | # - The requested threadId must be specified on the Message or Draft.Message you supply with your request. |
Craig Citro | 0e5b9bf | 2014-10-15 10:26:14 -0700 | [diff] [blame] | 488 | # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 489 | # - The Subject headers must match. |
| 490 | "labelIds": [ # List of IDs of labels applied to this message. |
| 491 | "A String", |
| 492 | ], |
| 493 | "id": "A String", # The immutable ID of the message. |
| 494 | }, |
| 495 | "id": "A String", # The immutable ID of the draft. |
| 496 | }</pre> |
| 497 | </div> |
| 498 | |
| 499 | </body></html> |