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"> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 78 | <code><a href="#close">close()</a></code></p> |
| 79 | <p class="firstline">Close httplib2 connections.</p> |
| 80 | <p class="toc_element"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 81 | <code><a href="#create">create(userId, body=None, x__xgafv=None, media_body=None, media_mime_type=None)</a></code></p> |
| 82 | <p class="firstline">Creates a new draft with the `DRAFT` label.</p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 83 | <p class="toc_element"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 84 | <code><a href="#delete">delete(userId, id, x__xgafv=None)</a></code></p> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 85 | <p class="firstline">Immediately and permanently deletes the specified draft. Does not simply trash it.</p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 86 | <p class="toc_element"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 87 | <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] | 88 | <p class="firstline">Gets the specified draft.</p> |
| 89 | <p class="toc_element"> |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 90 | <code><a href="#list">list(userId, maxResults=None, includeSpamTrash=None, q=None, pageToken=None, x__xgafv=None)</a></code></p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 91 | <p class="firstline">Lists the drafts in the user's mailbox.</p> |
| 92 | <p class="toc_element"> |
| 93 | <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> |
| 94 | <p class="firstline">Retrieves the next page of results.</p> |
| 95 | <p class="toc_element"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 96 | <code><a href="#send">send(userId, body=None, x__xgafv=None, media_body=None, media_mime_type=None)</a></code></p> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 97 | <p class="firstline">Sends the specified, existing draft to the recipients in the `To`, `Cc`, and `Bcc` headers.</p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 98 | <p class="toc_element"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 99 | <code><a href="#update">update(userId, id, body=None, x__xgafv=None, media_body=None, media_mime_type=None)</a></code></p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 100 | <p class="firstline">Replaces a draft's content.</p> |
| 101 | <h3>Method Details</h3> |
| 102 | <div class="method"> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 103 | <code class="details" id="close">close()</code> |
| 104 | <pre>Close httplib2 connections.</pre> |
| 105 | </div> |
| 106 | |
| 107 | <div class="method"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 108 | <code class="details" id="create">create(userId, body=None, x__xgafv=None, media_body=None, media_mime_type=None)</code> |
| 109 | <pre>Creates a new draft with the `DRAFT` label. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 110 | |
| 111 | Args: |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 112 | userId: string, The user's email address. The special value `me` can be used to indicate the authenticated user. (required) |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 113 | body: object, The request body. |
| 114 | The object takes the form of: |
| 115 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 116 | { # A draft email in the user's mailbox. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 117 | "id": "A String", # The immutable ID of the draft. |
| 118 | "message": { # An email message. # The message content of the draft. |
| 119 | "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: 1. The requested `threadId` must be specified on the `Message` or `Draft.Message` you supply with your request. 2. The `References` and `In-Reply-To` headers must be set in compliance with the [RFC 2822](https://tools.ietf.org/html/rfc2822) standard. 3. The `Subject` headers must match. |
| 120 | "labelIds": [ # List of IDs of labels applied to this message. |
| 121 | "A String", |
| 122 | ], |
| 123 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 124 | "id": "A String", # The immutable ID of the message. |
| 125 | "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. |
| 126 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 127 | "mimeType": "A String", # The MIME type of the message part. |
| 128 | "partId": "A String", # The immutable ID of the message part. |
| 129 | "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. |
| 130 | # Object with schema name: MessagePart |
Yoshi Automation Bot | 0d561ef | 2020-11-25 07:50:41 -0800 | [diff] [blame] | 131 | ], |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 132 | "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`. |
| 133 | { |
| 134 | "name": "A String", # The name of the header before the `:` separator. For example, `To`. |
| 135 | "value": "A String", # The value of the header after the `:` separator. For example, `someuser@example.com`. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 136 | }, |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 137 | ], |
| 138 | "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. |
| 139 | "data": "A String", # The body data of a MIME message part as a base64url encoded string. 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. |
| 140 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
| 141 | "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. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 142 | }, |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 143 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 144 | }, |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 145 | "snippet": "A String", # A short part of the message text. |
| 146 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 147 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the `Date` header. However, for API-migrated mail, it can be configured by client to be based on the `Date` header. |
| 148 | }, |
| 149 | } |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 150 | |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 151 | x__xgafv: string, V1 error format. |
| 152 | Allowed values |
| 153 | 1 - v1 error format |
| 154 | 2 - v2 error format |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 155 | 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] | 156 | media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 157 | |
| 158 | Returns: |
| 159 | An object of the form: |
| 160 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 161 | { # A draft email in the user's mailbox. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 162 | "id": "A String", # The immutable ID of the draft. |
| 163 | "message": { # An email message. # The message content of the draft. |
| 164 | "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: 1. The requested `threadId` must be specified on the `Message` or `Draft.Message` you supply with your request. 2. The `References` and `In-Reply-To` headers must be set in compliance with the [RFC 2822](https://tools.ietf.org/html/rfc2822) standard. 3. The `Subject` headers must match. |
| 165 | "labelIds": [ # List of IDs of labels applied to this message. |
| 166 | "A String", |
| 167 | ], |
| 168 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 169 | "id": "A String", # The immutable ID of the message. |
| 170 | "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. |
| 171 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 172 | "mimeType": "A String", # The MIME type of the message part. |
| 173 | "partId": "A String", # The immutable ID of the message part. |
| 174 | "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. |
| 175 | # Object with schema name: MessagePart |
Yoshi Automation Bot | 0d561ef | 2020-11-25 07:50:41 -0800 | [diff] [blame] | 176 | ], |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 177 | "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`. |
| 178 | { |
| 179 | "name": "A String", # The name of the header before the `:` separator. For example, `To`. |
| 180 | "value": "A String", # The value of the header after the `:` separator. For example, `someuser@example.com`. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 181 | }, |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 182 | ], |
| 183 | "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. |
| 184 | "data": "A String", # The body data of a MIME message part as a base64url encoded string. 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. |
| 185 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
| 186 | "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. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 187 | }, |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 188 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 189 | }, |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 190 | "snippet": "A String", # A short part of the message text. |
| 191 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 192 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the `Date` header. However, for API-migrated mail, it can be configured by client to be based on the `Date` header. |
| 193 | }, |
| 194 | }</pre> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 195 | </div> |
| 196 | |
| 197 | <div class="method"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 198 | <code class="details" id="delete">delete(userId, id, x__xgafv=None)</code> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 199 | <pre>Immediately and permanently deletes the specified draft. Does not simply trash it. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 200 | |
| 201 | Args: |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 202 | userId: string, The user's email address. The special value `me` can be used to indicate the authenticated user. (required) |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 203 | id: string, The ID of the draft to delete. (required) |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 204 | x__xgafv: string, V1 error format. |
| 205 | Allowed values |
| 206 | 1 - v1 error format |
| 207 | 2 - v2 error format |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 208 | </pre> |
| 209 | </div> |
| 210 | |
| 211 | <div class="method"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 212 | <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] | 213 | <pre>Gets the specified draft. |
| 214 | |
| 215 | Args: |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 216 | userId: string, The user's email address. The special value `me` can be used to indicate the authenticated user. (required) |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 217 | id: string, The ID of the draft to retrieve. (required) |
| 218 | format: string, The format to return the draft in. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 219 | Allowed values |
| 220 | minimal - Returns only email message ID and labels; does not return the email headers, body, or payload. |
| 221 | full - Returns the full email message data with body content parsed in the `payload` field; the `raw` field is not used. Format cannot be used when accessing the api using the gmail.metadata scope. |
| 222 | raw - Returns the full email message data with body content in the `raw` field as a base64url encoded string; the `payload` field is not used. Format cannot be used when accessing the api using the gmail.metadata scope. |
| 223 | metadata - Returns only email message ID, labels, and email headers. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 224 | x__xgafv: string, V1 error format. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 225 | Allowed values |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 226 | 1 - v1 error format |
| 227 | 2 - v2 error format |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 228 | |
| 229 | Returns: |
| 230 | An object of the form: |
| 231 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 232 | { # A draft email in the user's mailbox. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 233 | "id": "A String", # The immutable ID of the draft. |
| 234 | "message": { # An email message. # The message content of the draft. |
| 235 | "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: 1. The requested `threadId` must be specified on the `Message` or `Draft.Message` you supply with your request. 2. The `References` and `In-Reply-To` headers must be set in compliance with the [RFC 2822](https://tools.ietf.org/html/rfc2822) standard. 3. The `Subject` headers must match. |
| 236 | "labelIds": [ # List of IDs of labels applied to this message. |
| 237 | "A String", |
| 238 | ], |
| 239 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 240 | "id": "A String", # The immutable ID of the message. |
| 241 | "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. |
| 242 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 243 | "mimeType": "A String", # The MIME type of the message part. |
| 244 | "partId": "A String", # The immutable ID of the message part. |
| 245 | "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. |
| 246 | # Object with schema name: MessagePart |
Yoshi Automation Bot | 0d561ef | 2020-11-25 07:50:41 -0800 | [diff] [blame] | 247 | ], |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 248 | "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`. |
| 249 | { |
| 250 | "name": "A String", # The name of the header before the `:` separator. For example, `To`. |
| 251 | "value": "A String", # The value of the header after the `:` separator. For example, `someuser@example.com`. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 252 | }, |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 253 | ], |
| 254 | "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. |
| 255 | "data": "A String", # The body data of a MIME message part as a base64url encoded string. 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. |
| 256 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
| 257 | "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. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 258 | }, |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 259 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 260 | }, |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 261 | "snippet": "A String", # A short part of the message text. |
| 262 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 263 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the `Date` header. However, for API-migrated mail, it can be configured by client to be based on the `Date` header. |
| 264 | }, |
| 265 | }</pre> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 266 | </div> |
| 267 | |
| 268 | <div class="method"> |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 269 | <code class="details" id="list">list(userId, maxResults=None, includeSpamTrash=None, q=None, pageToken=None, x__xgafv=None)</code> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 270 | <pre>Lists the drafts in the user's mailbox. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 271 | |
| 272 | Args: |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 273 | userId: string, The user's email address. The special value `me` can be used to indicate the authenticated user. (required) |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 274 | maxResults: integer, Maximum number of drafts to return. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 275 | includeSpamTrash: boolean, Include drafts from `SPAM` and `TRASH` in the results. |
| 276 | q: string, Only return draft messages matching the specified query. Supports the same query format as the Gmail search box. For example, `"from:someuser@example.com rfc822msgid: is:unread"`. |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame] | 277 | pageToken: string, Page token to retrieve a specific page of results in the list. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 278 | x__xgafv: string, V1 error format. |
| 279 | Allowed values |
| 280 | 1 - v1 error format |
| 281 | 2 - v2 error format |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 282 | |
| 283 | Returns: |
| 284 | An object of the form: |
| 285 | |
| 286 | { |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 287 | "nextPageToken": "A String", # Token to retrieve the next page of results in the list. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 288 | "drafts": [ # List of drafts. Note that the `Message` property in each `Draft` resource only contains an `id` and a `threadId`. The messages.get method can fetch additional message details. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 289 | { # A draft email in the user's mailbox. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 290 | "id": "A String", # The immutable ID of the draft. |
| 291 | "message": { # An email message. # The message content of the draft. |
| 292 | "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: 1. The requested `threadId` must be specified on the `Message` or `Draft.Message` you supply with your request. 2. The `References` and `In-Reply-To` headers must be set in compliance with the [RFC 2822](https://tools.ietf.org/html/rfc2822) standard. 3. The `Subject` headers must match. |
| 293 | "labelIds": [ # List of IDs of labels applied to this message. |
| 294 | "A String", |
| 295 | ], |
| 296 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 297 | "id": "A String", # The immutable ID of the message. |
| 298 | "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. |
| 299 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 300 | "mimeType": "A String", # The MIME type of the message part. |
| 301 | "partId": "A String", # The immutable ID of the message part. |
| 302 | "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. |
| 303 | # Object with schema name: MessagePart |
Yoshi Automation Bot | 0d561ef | 2020-11-25 07:50:41 -0800 | [diff] [blame] | 304 | ], |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 305 | "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`. |
| 306 | { |
| 307 | "name": "A String", # The name of the header before the `:` separator. For example, `To`. |
| 308 | "value": "A String", # The value of the header after the `:` separator. For example, `someuser@example.com`. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 309 | }, |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 310 | ], |
| 311 | "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. |
| 312 | "data": "A String", # The body data of a MIME message part as a base64url encoded string. 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. |
| 313 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
| 314 | "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. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 315 | }, |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 316 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 317 | }, |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 318 | "snippet": "A String", # A short part of the message text. |
| 319 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 320 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the `Date` header. However, for API-migrated mail, it can be configured by client to be based on the `Date` header. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 321 | }, |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 322 | }, |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 323 | ], |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 324 | "resultSizeEstimate": 42, # Estimated total number of results. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 325 | }</pre> |
| 326 | </div> |
| 327 | |
| 328 | <div class="method"> |
| 329 | <code class="details" id="list_next">list_next(previous_request, previous_response)</code> |
| 330 | <pre>Retrieves the next page of results. |
| 331 | |
| 332 | Args: |
| 333 | previous_request: The request for the previous page. (required) |
| 334 | previous_response: The response from the request for the previous page. (required) |
| 335 | |
| 336 | Returns: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 337 | A request object that you can call 'execute()' on to request the next |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 338 | page. Returns None if there are no more items in the collection. |
| 339 | </pre> |
| 340 | </div> |
| 341 | |
| 342 | <div class="method"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 343 | <code class="details" id="send">send(userId, body=None, x__xgafv=None, media_body=None, media_mime_type=None)</code> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 344 | <pre>Sends the specified, existing draft to the recipients in the `To`, `Cc`, and `Bcc` headers. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 345 | |
| 346 | Args: |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 347 | userId: string, The user's email address. The special value `me` can be used to indicate the authenticated user. (required) |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 348 | body: object, The request body. |
| 349 | The object takes the form of: |
| 350 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 351 | { # A draft email in the user's mailbox. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 352 | "id": "A String", # The immutable ID of the draft. |
| 353 | "message": { # An email message. # The message content of the draft. |
| 354 | "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: 1. The requested `threadId` must be specified on the `Message` or `Draft.Message` you supply with your request. 2. The `References` and `In-Reply-To` headers must be set in compliance with the [RFC 2822](https://tools.ietf.org/html/rfc2822) standard. 3. The `Subject` headers must match. |
| 355 | "labelIds": [ # List of IDs of labels applied to this message. |
| 356 | "A String", |
| 357 | ], |
| 358 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 359 | "id": "A String", # The immutable ID of the message. |
| 360 | "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. |
| 361 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 362 | "mimeType": "A String", # The MIME type of the message part. |
| 363 | "partId": "A String", # The immutable ID of the message part. |
| 364 | "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. |
| 365 | # Object with schema name: MessagePart |
Yoshi Automation Bot | 0d561ef | 2020-11-25 07:50:41 -0800 | [diff] [blame] | 366 | ], |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 367 | "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`. |
| 368 | { |
| 369 | "name": "A String", # The name of the header before the `:` separator. For example, `To`. |
| 370 | "value": "A String", # The value of the header after the `:` separator. For example, `someuser@example.com`. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 371 | }, |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 372 | ], |
| 373 | "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. |
| 374 | "data": "A String", # The body data of a MIME message part as a base64url encoded string. 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. |
| 375 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
| 376 | "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. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 377 | }, |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 378 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 379 | }, |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 380 | "snippet": "A String", # A short part of the message text. |
| 381 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 382 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the `Date` header. However, for API-migrated mail, it can be configured by client to be based on the `Date` header. |
| 383 | }, |
| 384 | } |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 385 | |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 386 | x__xgafv: string, V1 error format. |
| 387 | Allowed values |
| 388 | 1 - v1 error format |
| 389 | 2 - v2 error format |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 390 | 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] | 391 | media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 392 | |
| 393 | Returns: |
| 394 | An object of the form: |
| 395 | |
| 396 | { # An email message. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 397 | "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: 1. The requested `threadId` must be specified on the `Message` or `Draft.Message` you supply with your request. 2. The `References` and `In-Reply-To` headers must be set in compliance with the [RFC 2822](https://tools.ietf.org/html/rfc2822) standard. 3. The `Subject` headers must match. |
Yoshi Automation Bot | 0d561ef | 2020-11-25 07:50:41 -0800 | [diff] [blame] | 398 | "labelIds": [ # List of IDs of labels applied to this message. |
| 399 | "A String", |
| 400 | ], |
Yoshi Automation Bot | 0d561ef | 2020-11-25 07:50:41 -0800 | [diff] [blame] | 401 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 402 | "id": "A String", # The immutable ID of the message. |
| 403 | "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. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 404 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 405 | "mimeType": "A String", # The MIME type of the message part. |
| 406 | "partId": "A String", # The immutable ID of the message part. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 407 | "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. |
| 408 | # Object with schema name: MessagePart |
| 409 | ], |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 410 | "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`. |
| 411 | { |
| 412 | "name": "A String", # The name of the header before the `:` separator. For example, `To`. |
| 413 | "value": "A String", # The value of the header after the `:` separator. For example, `someuser@example.com`. |
| 414 | }, |
| 415 | ], |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 416 | "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. |
| 417 | "data": "A String", # The body data of a MIME message part as a base64url encoded string. 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. |
| 418 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
| 419 | "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. |
| 420 | }, |
| 421 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 422 | }, |
Yoshi Automation Bot | 0d561ef | 2020-11-25 07:50:41 -0800 | [diff] [blame] | 423 | "snippet": "A String", # A short part of the message text. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 424 | "historyId": "A String", # The ID of the last history record that modified this message. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 425 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the `Date` header. However, for API-migrated mail, it can be configured by client to be based on the `Date` header. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 426 | }</pre> |
| 427 | </div> |
| 428 | |
| 429 | <div class="method"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 430 | <code class="details" id="update">update(userId, id, body=None, x__xgafv=None, media_body=None, media_mime_type=None)</code> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 431 | <pre>Replaces a draft's content. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 432 | |
| 433 | Args: |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 434 | userId: string, The user's email address. The special value `me` can be used to indicate the authenticated user. (required) |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 435 | id: string, The ID of the draft to update. (required) |
| 436 | body: object, The request body. |
| 437 | The object takes the form of: |
| 438 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 439 | { # A draft email in the user's mailbox. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 440 | "id": "A String", # The immutable ID of the draft. |
| 441 | "message": { # An email message. # The message content of the draft. |
| 442 | "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: 1. The requested `threadId` must be specified on the `Message` or `Draft.Message` you supply with your request. 2. The `References` and `In-Reply-To` headers must be set in compliance with the [RFC 2822](https://tools.ietf.org/html/rfc2822) standard. 3. The `Subject` headers must match. |
| 443 | "labelIds": [ # List of IDs of labels applied to this message. |
| 444 | "A String", |
| 445 | ], |
| 446 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 447 | "id": "A String", # The immutable ID of the message. |
| 448 | "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. |
| 449 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 450 | "mimeType": "A String", # The MIME type of the message part. |
| 451 | "partId": "A String", # The immutable ID of the message part. |
| 452 | "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. |
| 453 | # Object with schema name: MessagePart |
Yoshi Automation Bot | 0d561ef | 2020-11-25 07:50:41 -0800 | [diff] [blame] | 454 | ], |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 455 | "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`. |
| 456 | { |
| 457 | "name": "A String", # The name of the header before the `:` separator. For example, `To`. |
| 458 | "value": "A String", # The value of the header after the `:` separator. For example, `someuser@example.com`. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 459 | }, |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 460 | ], |
| 461 | "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. |
| 462 | "data": "A String", # The body data of a MIME message part as a base64url encoded string. 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. |
| 463 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
| 464 | "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. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 465 | }, |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 466 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 467 | }, |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 468 | "snippet": "A String", # A short part of the message text. |
| 469 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 470 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the `Date` header. However, for API-migrated mail, it can be configured by client to be based on the `Date` header. |
| 471 | }, |
| 472 | } |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 473 | |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 474 | x__xgafv: string, V1 error format. |
| 475 | Allowed values |
| 476 | 1 - v1 error format |
| 477 | 2 - v2 error format |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 478 | 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] | 479 | media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 480 | |
| 481 | Returns: |
| 482 | An object of the form: |
| 483 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 484 | { # A draft email in the user's mailbox. |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 485 | "id": "A String", # The immutable ID of the draft. |
| 486 | "message": { # An email message. # The message content of the draft. |
| 487 | "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: 1. The requested `threadId` must be specified on the `Message` or `Draft.Message` you supply with your request. 2. The `References` and `In-Reply-To` headers must be set in compliance with the [RFC 2822](https://tools.ietf.org/html/rfc2822) standard. 3. The `Subject` headers must match. |
| 488 | "labelIds": [ # List of IDs of labels applied to this message. |
| 489 | "A String", |
| 490 | ], |
| 491 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 492 | "id": "A String", # The immutable ID of the message. |
| 493 | "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. |
| 494 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 495 | "mimeType": "A String", # The MIME type of the message part. |
| 496 | "partId": "A String", # The immutable ID of the message part. |
| 497 | "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. |
| 498 | # Object with schema name: MessagePart |
Yoshi Automation Bot | 0d561ef | 2020-11-25 07:50:41 -0800 | [diff] [blame] | 499 | ], |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 500 | "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`. |
| 501 | { |
| 502 | "name": "A String", # The name of the header before the `:` separator. For example, `To`. |
| 503 | "value": "A String", # The value of the header after the `:` separator. For example, `someuser@example.com`. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 504 | }, |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 505 | ], |
| 506 | "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. |
| 507 | "data": "A String", # The body data of a MIME message part as a base64url encoded string. 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. |
| 508 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
| 509 | "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. |
Yoshi Automation Bot | b6971b0 | 2020-11-26 17:16:03 -0800 | [diff] [blame] | 510 | }, |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 511 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 512 | }, |
Yoshi Automation Bot | 0bf565c | 2020-12-09 08:56:03 -0800 | [diff] [blame^] | 513 | "snippet": "A String", # A short part of the message text. |
| 514 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 515 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the `Date` header. However, for API-migrated mail, it can be configured by client to be based on the `Date` header. |
| 516 | }, |
| 517 | }</pre> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 518 | </div> |
| 519 | |
| 520 | </body></html> |