blob: 9972e88e6ee44c8d2fc6c00eb97eeb0a7011be9a [file] [log] [blame]
Craig Citro065b5302014-08-14 00:47:23 -07001<html><body>
2<style>
3
4body, 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
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, 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 Frenkel3e17f892020-10-06 16:46:05 -070078 <code><a href="#close">close()</a></code></p>
79<p class="firstline">Close httplib2 connections.</p>
80<p class="toc_element">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070081 <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 Citro065b5302014-08-14 00:47:23 -070083<p class="toc_element">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070084 <code><a href="#delete">delete(userId, id, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070085<p class="firstline">Immediately and permanently deletes the specified draft. Does not simply trash it.</p>
Craig Citro065b5302014-08-14 00:47:23 -070086<p class="toc_element">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070087 <code><a href="#get">get(userId, id, format=None, x__xgafv=None)</a></code></p>
Craig Citro065b5302014-08-14 00:47:23 -070088<p class="firstline">Gets the specified draft.</p>
89<p class="toc_element">
Yoshi Automation Botc2228be2020-11-24 15:48:03 -080090 <code><a href="#list">list(userId, includeSpamTrash=None, pageToken=None, q=None, maxResults=None, x__xgafv=None)</a></code></p>
Craig Citro065b5302014-08-14 00:47:23 -070091<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 Kimd059ad82020-07-22 17:02:09 -070096 <code><a href="#send">send(userId, body=None, x__xgafv=None, media_body=None, media_mime_type=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070097<p class="firstline">Sends the specified, existing draft to the recipients in the `To`, `Cc`, and `Bcc` headers.</p>
Craig Citro065b5302014-08-14 00:47:23 -070098<p class="toc_element">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070099 <code><a href="#update">update(userId, id, body=None, x__xgafv=None, media_body=None, media_mime_type=None)</a></code></p>
Craig Citro065b5302014-08-14 00:47:23 -0700100<p class="firstline">Replaces a draft's content.</p>
101<h3>Method Details</h3>
102<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700103 <code class="details" id="close">close()</code>
104 <pre>Close httplib2 connections.</pre>
105</div>
106
107<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700108 <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 Citro065b5302014-08-14 00:47:23 -0700110
111Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700112 userId: string, The user&#x27;s email address. The special value `me` can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700113 body: object, The request body.
114 The object takes the form of:
115
Bu Sun Kim65020912020-05-20 12:08:20 -0700116{ # A draft email in the user&#x27;s mailbox.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800117 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700118 &quot;message&quot;: { # An email message. # The message content of the draft.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800119 &quot;internalDate&quot;: &quot;A String&quot;, # 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.
120 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700121 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800122 &quot;threadId&quot;: &quot;A String&quot;, # 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.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700123 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
124 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
125 &quot;A String&quot;,
126 ],
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800127 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700128 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700129 &quot;parts&quot;: [ # 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
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700131 ],
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700132 &quot;headers&quot;: [ # 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 {
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700134 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800135 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700136 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700137 ],
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800138 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
139 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700140 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
141 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for container MIME message parts.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800142 &quot;data&quot;: &quot;A String&quot;, # 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.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700143 &quot;attachmentId&quot;: &quot;A String&quot;, # 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.
144 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700145 },
Craig Citro065b5302014-08-14 00:47:23 -0700146 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700147 &quot;raw&quot;: &quot;A String&quot;, # 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.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700148 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700149}
Craig Citro065b5302014-08-14 00:47:23 -0700150
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700151 x__xgafv: string, V1 error format.
152 Allowed values
153 1 - v1 error format
154 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -0700155 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800156 media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object.
Craig Citro065b5302014-08-14 00:47:23 -0700157
158Returns:
159 An object of the form:
160
Bu Sun Kim65020912020-05-20 12:08:20 -0700161 { # A draft email in the user&#x27;s mailbox.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800162 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700163 &quot;message&quot;: { # An email message. # The message content of the draft.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800164 &quot;internalDate&quot;: &quot;A String&quot;, # 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.
165 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700166 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800167 &quot;threadId&quot;: &quot;A String&quot;, # 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.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700168 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
169 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
170 &quot;A String&quot;,
171 ],
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800172 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700173 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700174 &quot;parts&quot;: [ # 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
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700176 ],
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700177 &quot;headers&quot;: [ # 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 {
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700179 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800180 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700181 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700182 ],
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800183 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
184 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700185 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
186 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for container MIME message parts.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800187 &quot;data&quot;: &quot;A String&quot;, # 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.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700188 &quot;attachmentId&quot;: &quot;A String&quot;, # 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.
189 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700190 },
Craig Citro065b5302014-08-14 00:47:23 -0700191 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700192 &quot;raw&quot;: &quot;A String&quot;, # 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.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700193 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700194 }</pre>
Craig Citro065b5302014-08-14 00:47:23 -0700195</div>
196
197<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700198 <code class="details" id="delete">delete(userId, id, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700199 <pre>Immediately and permanently deletes the specified draft. Does not simply trash it.
Craig Citro065b5302014-08-14 00:47:23 -0700200
201Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700202 userId: string, The user&#x27;s email address. The special value `me` can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700203 id: string, The ID of the draft to delete. (required)
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700204 x__xgafv: string, V1 error format.
205 Allowed values
206 1 - v1 error format
207 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -0700208</pre>
209</div>
210
211<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700212 <code class="details" id="get">get(userId, id, format=None, x__xgafv=None)</code>
Craig Citro065b5302014-08-14 00:47:23 -0700213 <pre>Gets the specified draft.
214
215Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700216 userId: string, The user&#x27;s email address. The special value `me` can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700217 id: string, The ID of the draft to retrieve. (required)
218 format: string, The format to return the draft in.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700219 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 Kimd059ad82020-07-22 17:02:09 -0700224 x__xgafv: string, V1 error format.
Craig Citro065b5302014-08-14 00:47:23 -0700225 Allowed values
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700226 1 - v1 error format
227 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -0700228
229Returns:
230 An object of the form:
231
Bu Sun Kim65020912020-05-20 12:08:20 -0700232 { # A draft email in the user&#x27;s mailbox.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800233 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700234 &quot;message&quot;: { # An email message. # The message content of the draft.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800235 &quot;internalDate&quot;: &quot;A String&quot;, # 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.
236 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700237 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800238 &quot;threadId&quot;: &quot;A String&quot;, # 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.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700239 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
240 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
241 &quot;A String&quot;,
242 ],
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800243 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700244 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700245 &quot;parts&quot;: [ # 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
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700247 ],
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700248 &quot;headers&quot;: [ # 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 {
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700250 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800251 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700252 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700253 ],
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800254 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
255 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700256 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
257 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for container MIME message parts.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800258 &quot;data&quot;: &quot;A String&quot;, # 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.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700259 &quot;attachmentId&quot;: &quot;A String&quot;, # 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.
260 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700261 },
Craig Citro065b5302014-08-14 00:47:23 -0700262 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700263 &quot;raw&quot;: &quot;A String&quot;, # 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.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700264 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700265 }</pre>
Craig Citro065b5302014-08-14 00:47:23 -0700266</div>
267
268<div class="method">
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800269 <code class="details" id="list">list(userId, includeSpamTrash=None, pageToken=None, q=None, maxResults=None, x__xgafv=None)</code>
Bu Sun Kim65020912020-05-20 12:08:20 -0700270 <pre>Lists the drafts in the user&#x27;s mailbox.
Craig Citro065b5302014-08-14 00:47:23 -0700271
272Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700273 userId: string, The user&#x27;s email address. The special value `me` can be used to indicate the authenticated user. (required)
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700274 includeSpamTrash: boolean, Include drafts from `SPAM` and `TRASH` in the results.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800275 pageToken: string, Page token to retrieve a specific page of results in the list.
276 q: string, Only return draft messages matching the specified query. Supports the same query format as the Gmail search box. For example, `&quot;from:someuser@example.com rfc822msgid: is:unread&quot;`.
277 maxResults: integer, Maximum number of drafts to return.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700278 x__xgafv: string, V1 error format.
279 Allowed values
280 1 - v1 error format
281 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -0700282
283Returns:
284 An object of the form:
285
286 {
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700287 &quot;drafts&quot;: [ # 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 Kim65020912020-05-20 12:08:20 -0700288 { # A draft email in the user&#x27;s mailbox.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800289 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700290 &quot;message&quot;: { # An email message. # The message content of the draft.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800291 &quot;internalDate&quot;: &quot;A String&quot;, # 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.
292 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700293 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800294 &quot;threadId&quot;: &quot;A String&quot;, # 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.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700295 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
296 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
297 &quot;A String&quot;,
298 ],
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800299 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700300 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700301 &quot;parts&quot;: [ # 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.
302 # Object with schema name: MessagePart
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700303 ],
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700304 &quot;headers&quot;: [ # 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`.
305 {
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700306 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800307 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700308 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700309 ],
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800310 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
311 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700312 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
313 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for container MIME message parts.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800314 &quot;data&quot;: &quot;A String&quot;, # 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.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700315 &quot;attachmentId&quot;: &quot;A String&quot;, # 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.
316 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700317 },
Craig Citro065b5302014-08-14 00:47:23 -0700318 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700319 &quot;raw&quot;: &quot;A String&quot;, # 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 Citro065b5302014-08-14 00:47:23 -0700320 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700321 },
Craig Citro065b5302014-08-14 00:47:23 -0700322 ],
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800323 &quot;nextPageToken&quot;: &quot;A String&quot;, # Token to retrieve the next page of results in the list.
324 &quot;resultSizeEstimate&quot;: 42, # Estimated total number of results.
Craig Citro065b5302014-08-14 00:47:23 -0700325 }</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
332Args:
333 previous_request: The request for the previous page. (required)
334 previous_response: The response from the request for the previous page. (required)
335
336Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -0700337 A request object that you can call &#x27;execute()&#x27; on to request the next
Craig Citro065b5302014-08-14 00:47:23 -0700338 page. Returns None if there are no more items in the collection.
339 </pre>
340</div>
341
342<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700343 <code class="details" id="send">send(userId, body=None, x__xgafv=None, media_body=None, media_mime_type=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700344 <pre>Sends the specified, existing draft to the recipients in the `To`, `Cc`, and `Bcc` headers.
Craig Citro065b5302014-08-14 00:47:23 -0700345
346Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700347 userId: string, The user&#x27;s email address. The special value `me` can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700348 body: object, The request body.
349 The object takes the form of:
350
Bu Sun Kim65020912020-05-20 12:08:20 -0700351{ # A draft email in the user&#x27;s mailbox.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800352 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700353 &quot;message&quot;: { # An email message. # The message content of the draft.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800354 &quot;internalDate&quot;: &quot;A String&quot;, # 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.
355 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700356 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800357 &quot;threadId&quot;: &quot;A String&quot;, # 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.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700358 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
359 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
360 &quot;A String&quot;,
361 ],
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800362 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700363 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700364 &quot;parts&quot;: [ # 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
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700366 ],
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700367 &quot;headers&quot;: [ # 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 {
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700369 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800370 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700371 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700372 ],
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800373 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
374 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700375 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
376 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for container MIME message parts.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800377 &quot;data&quot;: &quot;A String&quot;, # 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.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700378 &quot;attachmentId&quot;: &quot;A String&quot;, # 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.
379 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700380 },
Craig Citro065b5302014-08-14 00:47:23 -0700381 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700382 &quot;raw&quot;: &quot;A String&quot;, # 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.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700383 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700384}
Craig Citro065b5302014-08-14 00:47:23 -0700385
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700386 x__xgafv: string, V1 error format.
387 Allowed values
388 1 - v1 error format
389 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -0700390 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800391 media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object.
Craig Citro065b5302014-08-14 00:47:23 -0700392
393Returns:
394 An object of the form:
395
396 { # An email message.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800397 &quot;internalDate&quot;: &quot;A String&quot;, # 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.
398 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700399 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800400 &quot;threadId&quot;: &quot;A String&quot;, # 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.
Bu Sun Kim65020912020-05-20 12:08:20 -0700401 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700402 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700403 &quot;A String&quot;,
404 ],
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800405 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700406 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700407 &quot;parts&quot;: [ # 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 ],
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700410 &quot;headers&quot;: [ # 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 {
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700412 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800413 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700414 },
415 ],
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800416 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
417 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700418 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
419 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for container MIME message parts.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800420 &quot;data&quot;: &quot;A String&quot;, # 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.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700421 &quot;attachmentId&quot;: &quot;A String&quot;, # 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.
422 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
423 },
424 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700425 &quot;raw&quot;: &quot;A String&quot;, # 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 Citro065b5302014-08-14 00:47:23 -0700426 }</pre>
427</div>
428
429<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700430 <code class="details" id="update">update(userId, id, body=None, x__xgafv=None, media_body=None, media_mime_type=None)</code>
Bu Sun Kim65020912020-05-20 12:08:20 -0700431 <pre>Replaces a draft&#x27;s content.
Craig Citro065b5302014-08-14 00:47:23 -0700432
433Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700434 userId: string, The user&#x27;s email address. The special value `me` can be used to indicate the authenticated user. (required)
Craig Citro065b5302014-08-14 00:47:23 -0700435 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 Kim65020912020-05-20 12:08:20 -0700439{ # A draft email in the user&#x27;s mailbox.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800440 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700441 &quot;message&quot;: { # An email message. # The message content of the draft.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800442 &quot;internalDate&quot;: &quot;A String&quot;, # 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.
443 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700444 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800445 &quot;threadId&quot;: &quot;A String&quot;, # 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.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700446 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
447 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
448 &quot;A String&quot;,
449 ],
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800450 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700451 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700452 &quot;parts&quot;: [ # 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
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700454 ],
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700455 &quot;headers&quot;: [ # 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 {
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700457 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800458 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700459 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700460 ],
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800461 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
462 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700463 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
464 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for container MIME message parts.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800465 &quot;data&quot;: &quot;A String&quot;, # 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.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700466 &quot;attachmentId&quot;: &quot;A String&quot;, # 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.
467 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700468 },
Craig Citro065b5302014-08-14 00:47:23 -0700469 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700470 &quot;raw&quot;: &quot;A String&quot;, # 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.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700471 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700472}
Craig Citro065b5302014-08-14 00:47:23 -0700473
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700474 x__xgafv: string, V1 error format.
475 Allowed values
476 1 - v1 error format
477 2 - v2 error format
Craig Citro065b5302014-08-14 00:47:23 -0700478 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800479 media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object.
Craig Citro065b5302014-08-14 00:47:23 -0700480
481Returns:
482 An object of the form:
483
Bu Sun Kim65020912020-05-20 12:08:20 -0700484 { # A draft email in the user&#x27;s mailbox.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800485 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the draft.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700486 &quot;message&quot;: { # An email message. # The message content of the draft.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800487 &quot;internalDate&quot;: &quot;A String&quot;, # 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.
488 &quot;id&quot;: &quot;A String&quot;, # The immutable ID of the message.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700489 &quot;sizeEstimate&quot;: 42, # Estimated size in bytes of the message.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800490 &quot;threadId&quot;: &quot;A String&quot;, # 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.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700491 &quot;snippet&quot;: &quot;A String&quot;, # A short part of the message text.
492 &quot;labelIds&quot;: [ # List of IDs of labels applied to this message.
493 &quot;A String&quot;,
494 ],
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800495 &quot;historyId&quot;: &quot;A String&quot;, # The ID of the last history record that modified this message.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700496 &quot;payload&quot;: { # A single MIME message part. # The parsed email structure in the message parts.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700497 &quot;parts&quot;: [ # 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
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700499 ],
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700500 &quot;headers&quot;: [ # 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 {
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700502 &quot;value&quot;: &quot;A String&quot;, # The value of the header after the `:` separator. For example, `someuser@example.com`.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800503 &quot;name&quot;: &quot;A String&quot;, # The name of the header before the `:` separator. For example, `To`.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700504 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700505 ],
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800506 &quot;partId&quot;: &quot;A String&quot;, # The immutable ID of the message part.
507 &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the message part.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700508 &quot;filename&quot;: &quot;A String&quot;, # The filename of the attachment. Only present if this message part represents an attachment.
509 &quot;body&quot;: { # The body of a single MIME message part. # The message part body for this part, which may be empty for container MIME message parts.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800510 &quot;data&quot;: &quot;A String&quot;, # 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.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700511 &quot;attachmentId&quot;: &quot;A String&quot;, # 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.
512 &quot;size&quot;: 42, # Number of bytes for the message part data (encoding notwithstanding).
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700513 },
Craig Citro065b5302014-08-14 00:47:23 -0700514 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700515 &quot;raw&quot;: &quot;A String&quot;, # 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.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700516 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700517 }</pre>
Craig Citro065b5302014-08-14 00:47:23 -0700518</div>
519
520</body></html>