Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 1 | <html><body> |
| 2 | <style> |
| 3 | |
| 4 | body, h1, h2, h3, div, span, p, pre, a { |
| 5 | margin: 0; |
| 6 | padding: 0; |
| 7 | border: 0; |
| 8 | font-weight: inherit; |
| 9 | font-style: inherit; |
| 10 | font-size: 100%; |
| 11 | font-family: inherit; |
| 12 | vertical-align: baseline; |
| 13 | } |
| 14 | |
| 15 | body { |
| 16 | font-size: 13px; |
| 17 | padding: 1em; |
| 18 | } |
| 19 | |
| 20 | h1 { |
| 21 | font-size: 26px; |
| 22 | margin-bottom: 1em; |
| 23 | } |
| 24 | |
| 25 | h2 { |
| 26 | font-size: 24px; |
| 27 | margin-bottom: 1em; |
| 28 | } |
| 29 | |
| 30 | h3 { |
| 31 | font-size: 20px; |
| 32 | margin-bottom: 1em; |
| 33 | margin-top: 1em; |
| 34 | } |
| 35 | |
| 36 | pre, code { |
| 37 | line-height: 1.5; |
| 38 | font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; |
| 39 | } |
| 40 | |
| 41 | pre { |
| 42 | margin-top: 0.5em; |
| 43 | } |
| 44 | |
| 45 | h1, h2, h3, p { |
| 46 | font-family: Arial, sans serif; |
| 47 | } |
| 48 | |
| 49 | h1, h2, h3 { |
| 50 | border-bottom: solid #CCC 1px; |
| 51 | } |
| 52 | |
| 53 | .toc_element { |
| 54 | margin-top: 0.5em; |
| 55 | } |
| 56 | |
| 57 | .firstline { |
| 58 | margin-left: 2 em; |
| 59 | } |
| 60 | |
| 61 | .method { |
| 62 | margin-top: 1em; |
| 63 | border: solid 1px #CCC; |
| 64 | padding: 1em; |
| 65 | background: #EEE; |
| 66 | } |
| 67 | |
| 68 | .details { |
| 69 | font-weight: bold; |
| 70 | font-size: 14px; |
| 71 | } |
| 72 | |
| 73 | </style> |
| 74 | |
| 75 | <h1><a href="gmail_v1.html">Gmail API</a> . <a href="gmail_v1.users.html">users</a> . <a href="gmail_v1.users.drafts.html">drafts</a></h1> |
| 76 | <h2>Instance Methods</h2> |
| 77 | <p class="toc_element"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 78 | <code><a href="#create">create(userId, body=None, media_body=None, media_mime_type=None)</a></code></p> |
| 79 | <p class="firstline">Creates a new draft with the DRAFT label.</p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 80 | <p class="toc_element"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 81 | <code><a href="#delete">delete(userId, id)</a></code></p> |
| 82 | <p class="firstline">Immediately and permanently deletes the specified draft. Does not simply trash it.</p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 83 | <p class="toc_element"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 84 | <code><a href="#get">get(userId, id, format=None)</a></code></p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 85 | <p class="firstline">Gets the specified draft.</p> |
| 86 | <p class="toc_element"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 87 | <code><a href="#list">list(userId, includeSpamTrash=None, maxResults=None, pageToken=None, q=None)</a></code></p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 88 | <p class="firstline">Lists the drafts in the user's mailbox.</p> |
| 89 | <p class="toc_element"> |
| 90 | <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> |
| 91 | <p class="firstline">Retrieves the next page of results.</p> |
| 92 | <p class="toc_element"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 93 | <code><a href="#send">send(userId, body=None, media_body=None, media_mime_type=None)</a></code></p> |
| 94 | <p class="firstline">Sends the specified, existing draft to the recipients in the To, Cc, and Bcc headers.</p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 95 | <p class="toc_element"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 96 | <code><a href="#update">update(userId, id, body=None, media_body=None, media_mime_type=None)</a></code></p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 97 | <p class="firstline">Replaces a draft's content.</p> |
| 98 | <h3>Method Details</h3> |
| 99 | <div class="method"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 100 | <code class="details" id="create">create(userId, body=None, media_body=None, media_mime_type=None)</code> |
| 101 | <pre>Creates a new draft with the DRAFT label. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 102 | |
| 103 | Args: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 104 | 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] | 105 | body: object, The request body. |
| 106 | The object takes the form of: |
| 107 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 108 | { # A draft email in the user's mailbox. |
| 109 | "id": "A String", # The immutable ID of the draft. |
| 110 | "message": { # An email message. # The message content of the draft. |
| 111 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 112 | "id": "A String", # The immutable ID of the message. |
| 113 | "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. |
| 114 | "labelIds": [ # List of IDs of labels applied to this message. |
| 115 | "A String", |
| 116 | ], |
| 117 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 118 | "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. |
| 119 | "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. |
| 120 | "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. |
| 121 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 122 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 123 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
| 124 | "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. |
| 125 | { |
| 126 | "name": "A String", # The name of the header before the : separator. For example, To. |
| 127 | "value": "A String", # The value of the header after the : separator. For example, someuser@example.com. |
| 128 | }, |
| 129 | ], |
| 130 | "mimeType": "A String", # The MIME type of the message part. |
| 131 | "partId": "A String", # The immutable ID of the message part. |
| 132 | "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. |
| 133 | # Object with schema name: MessagePart |
| 134 | ], |
| 135 | }, |
| 136 | "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. |
| 137 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 138 | "snippet": "A String", # A short part of the message text. |
| 139 | "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: |
| 140 | # - The requested threadId must be specified on the Message or Draft.Message you supply with your request. |
| 141 | # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. |
| 142 | # - The Subject headers must match. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 143 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 144 | } |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 145 | |
| 146 | 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] | 147 | 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] | 148 | |
| 149 | Returns: |
| 150 | An object of the form: |
| 151 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 152 | { # A draft email in the user's mailbox. |
| 153 | "id": "A String", # The immutable ID of the draft. |
| 154 | "message": { # An email message. # The message content of the draft. |
| 155 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 156 | "id": "A String", # The immutable ID of the message. |
| 157 | "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. |
| 158 | "labelIds": [ # List of IDs of labels applied to this message. |
| 159 | "A String", |
| 160 | ], |
| 161 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 162 | "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. |
| 163 | "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. |
| 164 | "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. |
| 165 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 166 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 167 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
| 168 | "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. |
| 169 | { |
| 170 | "name": "A String", # The name of the header before the : separator. For example, To. |
| 171 | "value": "A String", # The value of the header after the : separator. For example, someuser@example.com. |
| 172 | }, |
| 173 | ], |
| 174 | "mimeType": "A String", # The MIME type of the message part. |
| 175 | "partId": "A String", # The immutable ID of the message part. |
| 176 | "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. |
| 177 | # Object with schema name: MessagePart |
| 178 | ], |
| 179 | }, |
| 180 | "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. |
| 181 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 182 | "snippet": "A String", # A short part of the message text. |
| 183 | "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: |
| 184 | # - The requested threadId must be specified on the Message or Draft.Message you supply with your request. |
| 185 | # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. |
| 186 | # - The Subject headers must match. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 187 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 188 | }</pre> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 189 | </div> |
| 190 | |
| 191 | <div class="method"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 192 | <code class="details" id="delete">delete(userId, id)</code> |
| 193 | <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] | 194 | |
| 195 | Args: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 196 | 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] | 197 | id: string, The ID of the draft to delete. (required) |
| 198 | </pre> |
| 199 | </div> |
| 200 | |
| 201 | <div class="method"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 202 | <code class="details" id="get">get(userId, id, format=None)</code> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 203 | <pre>Gets the specified draft. |
| 204 | |
| 205 | Args: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 206 | 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] | 207 | id: string, The ID of the draft to retrieve. (required) |
| 208 | format: string, The format to return the draft in. |
| 209 | Allowed values |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 210 | full - |
| 211 | metadata - |
| 212 | minimal - |
| 213 | raw - |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 214 | |
| 215 | Returns: |
| 216 | An object of the form: |
| 217 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 218 | { # A draft email in the user's mailbox. |
| 219 | "id": "A String", # The immutable ID of the draft. |
| 220 | "message": { # An email message. # The message content of the draft. |
| 221 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 222 | "id": "A String", # The immutable ID of the message. |
| 223 | "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. |
| 224 | "labelIds": [ # List of IDs of labels applied to this message. |
| 225 | "A String", |
| 226 | ], |
| 227 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 228 | "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. |
| 229 | "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. |
| 230 | "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. |
| 231 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 232 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 233 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
| 234 | "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. |
| 235 | { |
| 236 | "name": "A String", # The name of the header before the : separator. For example, To. |
| 237 | "value": "A String", # The value of the header after the : separator. For example, someuser@example.com. |
| 238 | }, |
| 239 | ], |
| 240 | "mimeType": "A String", # The MIME type of the message part. |
| 241 | "partId": "A String", # The immutable ID of the message part. |
| 242 | "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. |
| 243 | # Object with schema name: MessagePart |
| 244 | ], |
| 245 | }, |
| 246 | "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. |
| 247 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 248 | "snippet": "A String", # A short part of the message text. |
| 249 | "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: |
| 250 | # - The requested threadId must be specified on the Message or Draft.Message you supply with your request. |
| 251 | # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. |
| 252 | # - The Subject headers must match. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 253 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 254 | }</pre> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 255 | </div> |
| 256 | |
| 257 | <div class="method"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 258 | <code class="details" id="list">list(userId, includeSpamTrash=None, maxResults=None, pageToken=None, q=None)</code> |
| 259 | <pre>Lists the drafts in the user's mailbox. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 260 | |
| 261 | Args: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 262 | userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required) |
| 263 | includeSpamTrash: boolean, Include drafts from SPAM and TRASH in the results. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 264 | maxResults: integer, Maximum number of drafts to return. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 265 | pageToken: string, Page token to retrieve a specific page of results in the list. |
| 266 | 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". |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 267 | |
| 268 | Returns: |
| 269 | An object of the form: |
| 270 | |
| 271 | { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 272 | "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. |
| 273 | { # A draft email in the user's mailbox. |
| 274 | "id": "A String", # The immutable ID of the draft. |
| 275 | "message": { # An email message. # The message content of the draft. |
| 276 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 277 | "id": "A String", # The immutable ID of the message. |
| 278 | "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. |
| 279 | "labelIds": [ # List of IDs of labels applied to this message. |
| 280 | "A String", |
| 281 | ], |
| 282 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 283 | "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. |
| 284 | "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. |
| 285 | "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. |
| 286 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 287 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 288 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
| 289 | "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. |
| 290 | { |
| 291 | "name": "A String", # The name of the header before the : separator. For example, To. |
| 292 | "value": "A String", # The value of the header after the : separator. For example, someuser@example.com. |
| 293 | }, |
| 294 | ], |
| 295 | "mimeType": "A String", # The MIME type of the message part. |
| 296 | "partId": "A String", # The immutable ID of the message part. |
| 297 | "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. |
| 298 | # Object with schema name: MessagePart |
| 299 | ], |
| 300 | }, |
| 301 | "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. |
| 302 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 303 | "snippet": "A String", # A short part of the message text. |
| 304 | "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: |
| 305 | # - The requested threadId must be specified on the Message or Draft.Message you supply with your request. |
| 306 | # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. |
| 307 | # - The Subject headers must match. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 308 | }, |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 309 | }, |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 310 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 311 | "nextPageToken": "A String", # Token to retrieve the next page of results in the list. |
| 312 | "resultSizeEstimate": 42, # Estimated total number of results. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 313 | }</pre> |
| 314 | </div> |
| 315 | |
| 316 | <div class="method"> |
| 317 | <code class="details" id="list_next">list_next(previous_request, previous_response)</code> |
| 318 | <pre>Retrieves the next page of results. |
| 319 | |
| 320 | Args: |
| 321 | previous_request: The request for the previous page. (required) |
| 322 | previous_response: The response from the request for the previous page. (required) |
| 323 | |
| 324 | Returns: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 325 | 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] | 326 | page. Returns None if there are no more items in the collection. |
| 327 | </pre> |
| 328 | </div> |
| 329 | |
| 330 | <div class="method"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 331 | <code class="details" id="send">send(userId, body=None, media_body=None, media_mime_type=None)</code> |
| 332 | <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] | 333 | |
| 334 | Args: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 335 | 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] | 336 | body: object, The request body. |
| 337 | The object takes the form of: |
| 338 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 339 | { # A draft email in the user's mailbox. |
| 340 | "id": "A String", # The immutable ID of the draft. |
| 341 | "message": { # An email message. # The message content of the draft. |
| 342 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 343 | "id": "A String", # The immutable ID of the message. |
| 344 | "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. |
| 345 | "labelIds": [ # List of IDs of labels applied to this message. |
| 346 | "A String", |
| 347 | ], |
| 348 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 349 | "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. |
| 350 | "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. |
| 351 | "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. |
| 352 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 353 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 354 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
| 355 | "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. |
| 356 | { |
| 357 | "name": "A String", # The name of the header before the : separator. For example, To. |
| 358 | "value": "A String", # The value of the header after the : separator. For example, someuser@example.com. |
| 359 | }, |
| 360 | ], |
| 361 | "mimeType": "A String", # The MIME type of the message part. |
| 362 | "partId": "A String", # The immutable ID of the message part. |
| 363 | "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. |
| 364 | # Object with schema name: MessagePart |
| 365 | ], |
| 366 | }, |
| 367 | "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. |
| 368 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 369 | "snippet": "A String", # A short part of the message text. |
| 370 | "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: |
| 371 | # - The requested threadId must be specified on the Message or Draft.Message you supply with your request. |
| 372 | # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. |
| 373 | # - The Subject headers must match. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 374 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 375 | } |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 376 | |
| 377 | 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] | 378 | 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] | 379 | |
| 380 | Returns: |
| 381 | An object of the form: |
| 382 | |
| 383 | { # An email message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 384 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 385 | "id": "A String", # The immutable ID of the message. |
| 386 | "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. |
| 387 | "labelIds": [ # List of IDs of labels applied to this message. |
| 388 | "A String", |
| 389 | ], |
| 390 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 391 | "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. |
| 392 | "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. |
| 393 | "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. |
| 394 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 395 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 396 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
| 397 | "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. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 398 | { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 399 | "name": "A String", # The name of the header before the : separator. For example, To. |
| 400 | "value": "A String", # The value of the header after the : separator. For example, someuser@example.com. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 401 | }, |
| 402 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 403 | "mimeType": "A String", # The MIME type of the message part. |
| 404 | "partId": "A String", # The immutable ID of the message part. |
| 405 | "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. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 406 | # Object with schema name: MessagePart |
| 407 | ], |
| 408 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 409 | "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. |
| 410 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 411 | "snippet": "A String", # A short part of the message text. |
| 412 | "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: |
| 413 | # - The requested threadId must be specified on the Message or Draft.Message you supply with your request. |
| 414 | # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. |
| 415 | # - The Subject headers must match. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 416 | }</pre> |
| 417 | </div> |
| 418 | |
| 419 | <div class="method"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 420 | <code class="details" id="update">update(userId, id, body=None, media_body=None, media_mime_type=None)</code> |
| 421 | <pre>Replaces a draft's content. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 422 | |
| 423 | Args: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 424 | 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] | 425 | id: string, The ID of the draft to update. (required) |
| 426 | body: object, The request body. |
| 427 | The object takes the form of: |
| 428 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 429 | { # A draft email in the user's mailbox. |
| 430 | "id": "A String", # The immutable ID of the draft. |
| 431 | "message": { # An email message. # The message content of the draft. |
| 432 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 433 | "id": "A String", # The immutable ID of the message. |
| 434 | "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. |
| 435 | "labelIds": [ # List of IDs of labels applied to this message. |
| 436 | "A String", |
| 437 | ], |
| 438 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 439 | "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. |
| 440 | "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. |
| 441 | "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. |
| 442 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 443 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 444 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
| 445 | "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. |
| 446 | { |
| 447 | "name": "A String", # The name of the header before the : separator. For example, To. |
| 448 | "value": "A String", # The value of the header after the : separator. For example, someuser@example.com. |
| 449 | }, |
| 450 | ], |
| 451 | "mimeType": "A String", # The MIME type of the message part. |
| 452 | "partId": "A String", # The immutable ID of the message part. |
| 453 | "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. |
| 454 | # Object with schema name: MessagePart |
| 455 | ], |
| 456 | }, |
| 457 | "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. |
| 458 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 459 | "snippet": "A String", # A short part of the message text. |
| 460 | "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: |
| 461 | # - The requested threadId must be specified on the Message or Draft.Message you supply with your request. |
| 462 | # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. |
| 463 | # - The Subject headers must match. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 464 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 465 | } |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 466 | |
| 467 | 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] | 468 | 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] | 469 | |
| 470 | Returns: |
| 471 | An object of the form: |
| 472 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 473 | { # A draft email in the user's mailbox. |
| 474 | "id": "A String", # The immutable ID of the draft. |
| 475 | "message": { # An email message. # The message content of the draft. |
| 476 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 477 | "id": "A String", # The immutable ID of the message. |
| 478 | "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. |
| 479 | "labelIds": [ # List of IDs of labels applied to this message. |
| 480 | "A String", |
| 481 | ], |
| 482 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 483 | "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. |
| 484 | "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. |
| 485 | "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. |
| 486 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 487 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 488 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
| 489 | "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. |
| 490 | { |
| 491 | "name": "A String", # The name of the header before the : separator. For example, To. |
| 492 | "value": "A String", # The value of the header after the : separator. For example, someuser@example.com. |
| 493 | }, |
| 494 | ], |
| 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 |
| 499 | ], |
| 500 | }, |
| 501 | "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. |
| 502 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 503 | "snippet": "A String", # A short part of the message text. |
| 504 | "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: |
| 505 | # - The requested threadId must be specified on the Message or Draft.Message you supply with your request. |
| 506 | # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. |
| 507 | # - The Subject headers must match. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 508 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 509 | }</pre> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 510 | </div> |
| 511 | |
| 512 | </body></html> |