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.messages.html">messages</a></h1> |
| 76 | <h2>Instance Methods</h2> |
| 77 | <p class="toc_element"> |
| 78 | <code><a href="gmail_v1.users.messages.attachments.html">attachments()</a></code> |
| 79 | </p> |
| 80 | <p class="firstline">Returns the attachments Resource.</p> |
| 81 | |
| 82 | <p class="toc_element"> |
| 83 | <code><a href="#delete">delete(userId, id)</a></code></p> |
| 84 | <p class="firstline">Immediately and permanently deletes the specified message. This operation cannot be undone. Prefer messages.trash instead.</p> |
| 85 | <p class="toc_element"> |
Craig Citro | 0e5b9bf | 2014-10-15 10:26:14 -0700 | [diff] [blame] | 86 | <code><a href="#get">get(userId, id, format=None, metadataHeaders=None)</a></code></p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 87 | <p class="firstline">Gets the specified message.</p> |
| 88 | <p class="toc_element"> |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 89 | <code><a href="#import_">import_(userId, body=None, media_body=None, internalDateSource=None, neverMarkSpam=None, processForCalendar=None, deleted=None)</a></code></p> |
Craig Citro | 0e5b9bf | 2014-10-15 10:26:14 -0700 | [diff] [blame] | 90 | <p class="firstline">Imports a message into only this user's mailbox, with standard email delivery scanning and classification similar to receiving via SMTP. Does not send a message.</p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 91 | <p class="toc_element"> |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 92 | <code><a href="#insert">insert(userId, body=None, media_body=None, internalDateSource=None, deleted=None)</a></code></p> |
Craig Citro | 0e5b9bf | 2014-10-15 10:26:14 -0700 | [diff] [blame] | 93 | <p class="firstline">Directly inserts a message into only this user's mailbox similar to IMAP APPEND, bypassing most scanning and classification. Does not send a message.</p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 94 | <p class="toc_element"> |
| 95 | <code><a href="#list">list(userId, labelIds=None, q=None, pageToken=None, maxResults=None, includeSpamTrash=None)</a></code></p> |
| 96 | <p class="firstline">Lists the messages in the user's mailbox.</p> |
| 97 | <p class="toc_element"> |
| 98 | <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> |
| 99 | <p class="firstline">Retrieves the next page of results.</p> |
| 100 | <p class="toc_element"> |
| 101 | <code><a href="#modify">modify(userId, id, body)</a></code></p> |
| 102 | <p class="firstline">Modifies the labels on the specified message.</p> |
| 103 | <p class="toc_element"> |
| 104 | <code><a href="#send">send(userId, body=None, media_body=None)</a></code></p> |
| 105 | <p class="firstline">Sends the specified message to the recipients in the To, Cc, and Bcc headers.</p> |
| 106 | <p class="toc_element"> |
| 107 | <code><a href="#trash">trash(userId, id)</a></code></p> |
| 108 | <p class="firstline">Moves the specified message to the trash.</p> |
| 109 | <p class="toc_element"> |
| 110 | <code><a href="#untrash">untrash(userId, id)</a></code></p> |
| 111 | <p class="firstline">Removes the specified message from the trash.</p> |
| 112 | <h3>Method Details</h3> |
| 113 | <div class="method"> |
| 114 | <code class="details" id="delete">delete(userId, id)</code> |
| 115 | <pre>Immediately and permanently deletes the specified message. This operation cannot be undone. Prefer messages.trash instead. |
| 116 | |
| 117 | Args: |
| 118 | userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required) |
| 119 | id: string, The ID of the message to delete. (required) |
| 120 | </pre> |
| 121 | </div> |
| 122 | |
| 123 | <div class="method"> |
Craig Citro | 0e5b9bf | 2014-10-15 10:26:14 -0700 | [diff] [blame] | 124 | <code class="details" id="get">get(userId, id, format=None, metadataHeaders=None)</code> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 125 | <pre>Gets the specified message. |
| 126 | |
| 127 | Args: |
| 128 | userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required) |
| 129 | id: string, The ID of the message to retrieve. (required) |
| 130 | format: string, The format to return the message in. |
| 131 | Allowed values |
| 132 | full - |
Craig Citro | 0e5b9bf | 2014-10-15 10:26:14 -0700 | [diff] [blame] | 133 | metadata - |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 134 | minimal - |
| 135 | raw - |
Craig Citro | 0e5b9bf | 2014-10-15 10:26:14 -0700 | [diff] [blame] | 136 | metadataHeaders: string, When given and format is METADATA, only include headers specified. (repeated) |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 137 | |
| 138 | Returns: |
| 139 | An object of the form: |
| 140 | |
| 141 | { # An email message. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame^] | 142 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 143 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 144 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 145 | "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. |
| 146 | "data": "A String", # The body data of a MIME message part. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment. |
| 147 | "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. |
| 148 | "size": 42, # Total number of bytes in the body of the message part. |
| 149 | }, |
| 150 | "mimeType": "A String", # The MIME type of the message part. |
| 151 | "partId": "A String", # The immutable ID of the message part. |
| 152 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
| 153 | "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. |
| 154 | { |
| 155 | "name": "A String", # The name of the header before the : separator. For example, To. |
| 156 | "value": "A String", # The value of the header after the : separator. For example, someuser@example.com. |
| 157 | }, |
| 158 | ], |
| 159 | "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. |
| 160 | # Object with schema name: MessagePart |
| 161 | ], |
| 162 | }, |
| 163 | "snippet": "A String", # A short part of the message text. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 164 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 165 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 166 | "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: |
| 167 | # - The requested threadId must be specified on the Message or Draft.Message you supply with your request. |
Craig Citro | 0e5b9bf | 2014-10-15 10:26:14 -0700 | [diff] [blame] | 168 | # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 169 | # - The Subject headers must match. |
| 170 | "labelIds": [ # List of IDs of labels applied to this message. |
| 171 | "A String", |
| 172 | ], |
| 173 | "id": "A String", # The immutable ID of the message. |
| 174 | }</pre> |
| 175 | </div> |
| 176 | |
| 177 | <div class="method"> |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 178 | <code class="details" id="import_">import_(userId, body=None, media_body=None, internalDateSource=None, neverMarkSpam=None, processForCalendar=None, deleted=None)</code> |
Craig Citro | 0e5b9bf | 2014-10-15 10:26:14 -0700 | [diff] [blame] | 179 | <pre>Imports a message into only this user's mailbox, with standard email delivery scanning and classification similar to receiving via SMTP. Does not send a message. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 180 | |
| 181 | Args: |
| 182 | userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required) |
| 183 | body: object, The request body. |
| 184 | The object takes the form of: |
| 185 | |
| 186 | { # An email message. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame^] | 187 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 188 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 189 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 190 | "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. |
| 191 | "data": "A String", # The body data of a MIME message part. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment. |
| 192 | "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. |
| 193 | "size": 42, # Total number of bytes in the body of the message part. |
| 194 | }, |
| 195 | "mimeType": "A String", # The MIME type of the message part. |
| 196 | "partId": "A String", # The immutable ID of the message part. |
| 197 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
| 198 | "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. |
| 199 | { |
| 200 | "name": "A String", # The name of the header before the : separator. For example, To. |
| 201 | "value": "A String", # The value of the header after the : separator. For example, someuser@example.com. |
| 202 | }, |
| 203 | ], |
| 204 | "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. |
| 205 | # Object with schema name: MessagePart |
| 206 | ], |
| 207 | }, |
| 208 | "snippet": "A String", # A short part of the message text. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 209 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 210 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 211 | "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: |
| 212 | # - The requested threadId must be specified on the Message or Draft.Message you supply with your request. |
Craig Citro | 0e5b9bf | 2014-10-15 10:26:14 -0700 | [diff] [blame] | 213 | # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 214 | # - The Subject headers must match. |
| 215 | "labelIds": [ # List of IDs of labels applied to this message. |
| 216 | "A String", |
| 217 | ], |
| 218 | "id": "A String", # The immutable ID of the message. |
| 219 | } |
| 220 | |
| 221 | media_body: string, The filename of the media request body, or an instance of a MediaUpload object. |
Craig Citro | 0e5b9bf | 2014-10-15 10:26:14 -0700 | [diff] [blame] | 222 | internalDateSource: string, Source for Gmail's internal date of the message. |
| 223 | Allowed values |
| 224 | dateHeader - |
| 225 | receivedTime - |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 226 | neverMarkSpam: boolean, Ignore the Gmail spam classifier decision and never mark this email as SPAM in the mailbox. |
| 227 | processForCalendar: boolean, Process calendar invites in the email and add any extracted meetings to the Google Calendar for this user. |
| 228 | deleted: boolean, Mark the email as permanently deleted (not TRASH) and only visible in Google Apps Vault to a Vault administrator. Only used for Google Apps for Work accounts. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 229 | |
| 230 | Returns: |
| 231 | An object of the form: |
| 232 | |
| 233 | { # An email message. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame^] | 234 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 235 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 236 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 237 | "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. |
| 238 | "data": "A String", # The body data of a MIME message part. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment. |
| 239 | "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. |
| 240 | "size": 42, # Total number of bytes in the body of the message part. |
| 241 | }, |
| 242 | "mimeType": "A String", # The MIME type of the message part. |
| 243 | "partId": "A String", # The immutable ID of the message part. |
| 244 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
| 245 | "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. |
| 246 | { |
| 247 | "name": "A String", # The name of the header before the : separator. For example, To. |
| 248 | "value": "A String", # The value of the header after the : separator. For example, someuser@example.com. |
| 249 | }, |
| 250 | ], |
| 251 | "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. |
| 252 | # Object with schema name: MessagePart |
| 253 | ], |
| 254 | }, |
| 255 | "snippet": "A String", # A short part of the message text. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 256 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 257 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 258 | "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: |
| 259 | # - The requested threadId must be specified on the Message or Draft.Message you supply with your request. |
Craig Citro | 0e5b9bf | 2014-10-15 10:26:14 -0700 | [diff] [blame] | 260 | # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 261 | # - The Subject headers must match. |
| 262 | "labelIds": [ # List of IDs of labels applied to this message. |
| 263 | "A String", |
| 264 | ], |
| 265 | "id": "A String", # The immutable ID of the message. |
| 266 | }</pre> |
| 267 | </div> |
| 268 | |
| 269 | <div class="method"> |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 270 | <code class="details" id="insert">insert(userId, body=None, media_body=None, internalDateSource=None, deleted=None)</code> |
Craig Citro | 0e5b9bf | 2014-10-15 10:26:14 -0700 | [diff] [blame] | 271 | <pre>Directly inserts a message into only this user's mailbox similar to IMAP APPEND, bypassing most scanning and classification. Does not send a message. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 272 | |
| 273 | Args: |
| 274 | userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required) |
| 275 | body: object, The request body. |
| 276 | The object takes the form of: |
| 277 | |
| 278 | { # An email message. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame^] | 279 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 280 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 281 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 282 | "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. |
| 283 | "data": "A String", # The body data of a MIME message part. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment. |
| 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 | "size": 42, # Total number of bytes in the body of the message part. |
| 286 | }, |
| 287 | "mimeType": "A String", # The MIME type of the message part. |
| 288 | "partId": "A String", # The immutable ID of the message part. |
| 289 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
| 290 | "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. |
| 291 | { |
| 292 | "name": "A String", # The name of the header before the : separator. For example, To. |
| 293 | "value": "A String", # The value of the header after the : separator. For example, someuser@example.com. |
| 294 | }, |
| 295 | ], |
| 296 | "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. |
| 297 | # Object with schema name: MessagePart |
| 298 | ], |
| 299 | }, |
| 300 | "snippet": "A String", # A short part of the message text. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 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. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 302 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 303 | "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: |
| 304 | # - The requested threadId must be specified on the Message or Draft.Message you supply with your request. |
Craig Citro | 0e5b9bf | 2014-10-15 10:26:14 -0700 | [diff] [blame] | 305 | # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 306 | # - The Subject headers must match. |
| 307 | "labelIds": [ # List of IDs of labels applied to this message. |
| 308 | "A String", |
| 309 | ], |
| 310 | "id": "A String", # The immutable ID of the message. |
| 311 | } |
| 312 | |
| 313 | media_body: string, The filename of the media request body, or an instance of a MediaUpload object. |
Craig Citro | 0e5b9bf | 2014-10-15 10:26:14 -0700 | [diff] [blame] | 314 | internalDateSource: string, Source for Gmail's internal date of the message. |
| 315 | Allowed values |
| 316 | dateHeader - |
| 317 | receivedTime - |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 318 | deleted: boolean, Mark the email as permanently deleted (not TRASH) and only visible in Google Apps Vault to a Vault administrator. Only used for Google Apps for Work accounts. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 319 | |
| 320 | Returns: |
| 321 | An object of the form: |
| 322 | |
| 323 | { # An email message. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame^] | 324 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 325 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 326 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 327 | "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. |
| 328 | "data": "A String", # The body data of a MIME message part. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment. |
| 329 | "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. |
| 330 | "size": 42, # Total number of bytes in the body of the message part. |
| 331 | }, |
| 332 | "mimeType": "A String", # The MIME type of the message part. |
| 333 | "partId": "A String", # The immutable ID of the message part. |
| 334 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
| 335 | "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. |
| 336 | { |
| 337 | "name": "A String", # The name of the header before the : separator. For example, To. |
| 338 | "value": "A String", # The value of the header after the : separator. For example, someuser@example.com. |
| 339 | }, |
| 340 | ], |
| 341 | "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. |
| 342 | # Object with schema name: MessagePart |
| 343 | ], |
| 344 | }, |
| 345 | "snippet": "A String", # A short part of the message text. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 346 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 347 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 348 | "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: |
| 349 | # - The requested threadId must be specified on the Message or Draft.Message you supply with your request. |
Craig Citro | 0e5b9bf | 2014-10-15 10:26:14 -0700 | [diff] [blame] | 350 | # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 351 | # - The Subject headers must match. |
| 352 | "labelIds": [ # List of IDs of labels applied to this message. |
| 353 | "A String", |
| 354 | ], |
| 355 | "id": "A String", # The immutable ID of the message. |
| 356 | }</pre> |
| 357 | </div> |
| 358 | |
| 359 | <div class="method"> |
| 360 | <code class="details" id="list">list(userId, labelIds=None, q=None, pageToken=None, maxResults=None, includeSpamTrash=None)</code> |
| 361 | <pre>Lists the messages in the user's mailbox. |
| 362 | |
| 363 | Args: |
| 364 | userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required) |
| 365 | labelIds: string, Only return messages with labels that match all of the specified label IDs. (repeated) |
| 366 | q: string, Only return messages matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread". |
| 367 | pageToken: string, Page token to retrieve a specific page of results in the list. |
| 368 | maxResults: integer, Maximum number of messages to return. |
| 369 | includeSpamTrash: boolean, Include messages from SPAM and TRASH in the results. |
| 370 | |
| 371 | Returns: |
| 372 | An object of the form: |
| 373 | |
| 374 | { |
| 375 | "nextPageToken": "A String", # Token to retrieve the next page of results in the list. |
| 376 | "resultSizeEstimate": 42, # Estimated total number of results. |
| 377 | "messages": [ # List of messages. |
| 378 | { # An email message. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame^] | 379 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 380 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 381 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 382 | "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. |
| 383 | "data": "A String", # The body data of a MIME message part. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment. |
| 384 | "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. |
| 385 | "size": 42, # Total number of bytes in the body of the message part. |
| 386 | }, |
| 387 | "mimeType": "A String", # The MIME type of the message part. |
| 388 | "partId": "A String", # The immutable ID of the message part. |
| 389 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
| 390 | "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. |
| 391 | { |
| 392 | "name": "A String", # The name of the header before the : separator. For example, To. |
| 393 | "value": "A String", # The value of the header after the : separator. For example, someuser@example.com. |
| 394 | }, |
| 395 | ], |
| 396 | "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. |
| 397 | # Object with schema name: MessagePart |
| 398 | ], |
| 399 | }, |
| 400 | "snippet": "A String", # A short part of the message text. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 401 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 402 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 403 | "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: |
| 404 | # - The requested threadId must be specified on the Message or Draft.Message you supply with your request. |
Craig Citro | 0e5b9bf | 2014-10-15 10:26:14 -0700 | [diff] [blame] | 405 | # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 406 | # - The Subject headers must match. |
| 407 | "labelIds": [ # List of IDs of labels applied to this message. |
| 408 | "A String", |
| 409 | ], |
| 410 | "id": "A String", # The immutable ID of the message. |
| 411 | }, |
| 412 | ], |
| 413 | }</pre> |
| 414 | </div> |
| 415 | |
| 416 | <div class="method"> |
| 417 | <code class="details" id="list_next">list_next(previous_request, previous_response)</code> |
| 418 | <pre>Retrieves the next page of results. |
| 419 | |
| 420 | Args: |
| 421 | previous_request: The request for the previous page. (required) |
| 422 | previous_response: The response from the request for the previous page. (required) |
| 423 | |
| 424 | Returns: |
| 425 | A request object that you can call 'execute()' on to request the next |
| 426 | page. Returns None if there are no more items in the collection. |
| 427 | </pre> |
| 428 | </div> |
| 429 | |
| 430 | <div class="method"> |
| 431 | <code class="details" id="modify">modify(userId, id, body)</code> |
| 432 | <pre>Modifies the labels on the specified message. |
| 433 | |
| 434 | Args: |
| 435 | userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required) |
| 436 | id: string, The ID of the message to modify. (required) |
| 437 | body: object, The request body. (required) |
| 438 | The object takes the form of: |
| 439 | |
| 440 | { |
| 441 | "removeLabelIds": [ # A list IDs of labels to remove from this message. |
| 442 | "A String", |
| 443 | ], |
| 444 | "addLabelIds": [ # A list of IDs of labels to add to this message. |
| 445 | "A String", |
| 446 | ], |
| 447 | } |
| 448 | |
| 449 | |
| 450 | Returns: |
| 451 | An object of the form: |
| 452 | |
| 453 | { # An email message. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame^] | 454 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 455 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 456 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 457 | "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. |
| 458 | "data": "A String", # The body data of a MIME message part. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment. |
| 459 | "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. |
| 460 | "size": 42, # Total number of bytes in the body of the message part. |
| 461 | }, |
| 462 | "mimeType": "A String", # The MIME type of the message part. |
| 463 | "partId": "A String", # The immutable ID of the message part. |
| 464 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
| 465 | "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. |
| 466 | { |
| 467 | "name": "A String", # The name of the header before the : separator. For example, To. |
| 468 | "value": "A String", # The value of the header after the : separator. For example, someuser@example.com. |
| 469 | }, |
| 470 | ], |
| 471 | "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. |
| 472 | # Object with schema name: MessagePart |
| 473 | ], |
| 474 | }, |
| 475 | "snippet": "A String", # A short part of the message text. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 476 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 477 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 478 | "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: |
| 479 | # - The requested threadId must be specified on the Message or Draft.Message you supply with your request. |
Craig Citro | 0e5b9bf | 2014-10-15 10:26:14 -0700 | [diff] [blame] | 480 | # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 481 | # - The Subject headers must match. |
| 482 | "labelIds": [ # List of IDs of labels applied to this message. |
| 483 | "A String", |
| 484 | ], |
| 485 | "id": "A String", # The immutable ID of the message. |
| 486 | }</pre> |
| 487 | </div> |
| 488 | |
| 489 | <div class="method"> |
| 490 | <code class="details" id="send">send(userId, body=None, media_body=None)</code> |
| 491 | <pre>Sends the specified message to the recipients in the To, Cc, and Bcc headers. |
| 492 | |
| 493 | Args: |
| 494 | userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required) |
| 495 | body: object, The request body. |
| 496 | The object takes the form of: |
| 497 | |
| 498 | { # An email message. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame^] | 499 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 500 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 501 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 502 | "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. |
| 503 | "data": "A String", # The body data of a MIME message part. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment. |
| 504 | "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. |
| 505 | "size": 42, # Total number of bytes in the body of the message part. |
| 506 | }, |
| 507 | "mimeType": "A String", # The MIME type of the message part. |
| 508 | "partId": "A String", # The immutable ID of the message part. |
| 509 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
| 510 | "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. |
| 511 | { |
| 512 | "name": "A String", # The name of the header before the : separator. For example, To. |
| 513 | "value": "A String", # The value of the header after the : separator. For example, someuser@example.com. |
| 514 | }, |
| 515 | ], |
| 516 | "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. |
| 517 | # Object with schema name: MessagePart |
| 518 | ], |
| 519 | }, |
| 520 | "snippet": "A String", # A short part of the message text. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 521 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 522 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 523 | "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: |
| 524 | # - The requested threadId must be specified on the Message or Draft.Message you supply with your request. |
Craig Citro | 0e5b9bf | 2014-10-15 10:26:14 -0700 | [diff] [blame] | 525 | # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 526 | # - The Subject headers must match. |
| 527 | "labelIds": [ # List of IDs of labels applied to this message. |
| 528 | "A String", |
| 529 | ], |
| 530 | "id": "A String", # The immutable ID of the message. |
| 531 | } |
| 532 | |
| 533 | media_body: string, The filename of the media request body, or an instance of a MediaUpload object. |
| 534 | |
| 535 | Returns: |
| 536 | An object of the form: |
| 537 | |
| 538 | { # An email message. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame^] | 539 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 540 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 541 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 542 | "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. |
| 543 | "data": "A String", # The body data of a MIME message part. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment. |
| 544 | "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. |
| 545 | "size": 42, # Total number of bytes in the body of the message part. |
| 546 | }, |
| 547 | "mimeType": "A String", # The MIME type of the message part. |
| 548 | "partId": "A String", # The immutable ID of the message part. |
| 549 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
| 550 | "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. |
| 551 | { |
| 552 | "name": "A String", # The name of the header before the : separator. For example, To. |
| 553 | "value": "A String", # The value of the header after the : separator. For example, someuser@example.com. |
| 554 | }, |
| 555 | ], |
| 556 | "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. |
| 557 | # Object with schema name: MessagePart |
| 558 | ], |
| 559 | }, |
| 560 | "snippet": "A String", # A short part of the message text. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 561 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 562 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 563 | "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: |
| 564 | # - The requested threadId must be specified on the Message or Draft.Message you supply with your request. |
Craig Citro | 0e5b9bf | 2014-10-15 10:26:14 -0700 | [diff] [blame] | 565 | # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 566 | # - The Subject headers must match. |
| 567 | "labelIds": [ # List of IDs of labels applied to this message. |
| 568 | "A String", |
| 569 | ], |
| 570 | "id": "A String", # The immutable ID of the message. |
| 571 | }</pre> |
| 572 | </div> |
| 573 | |
| 574 | <div class="method"> |
| 575 | <code class="details" id="trash">trash(userId, id)</code> |
| 576 | <pre>Moves the specified message to the trash. |
| 577 | |
| 578 | Args: |
| 579 | userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required) |
| 580 | id: string, The ID of the message to Trash. (required) |
| 581 | |
| 582 | Returns: |
| 583 | An object of the form: |
| 584 | |
| 585 | { # An email message. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame^] | 586 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 587 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 588 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 589 | "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. |
| 590 | "data": "A String", # The body data of a MIME message part. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment. |
| 591 | "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. |
| 592 | "size": 42, # Total number of bytes in the body of the message part. |
| 593 | }, |
| 594 | "mimeType": "A String", # The MIME type of the message part. |
| 595 | "partId": "A String", # The immutable ID of the message part. |
| 596 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
| 597 | "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. |
| 598 | { |
| 599 | "name": "A String", # The name of the header before the : separator. For example, To. |
| 600 | "value": "A String", # The value of the header after the : separator. For example, someuser@example.com. |
| 601 | }, |
| 602 | ], |
| 603 | "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. |
| 604 | # Object with schema name: MessagePart |
| 605 | ], |
| 606 | }, |
| 607 | "snippet": "A String", # A short part of the message text. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 608 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 609 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 610 | "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: |
| 611 | # - The requested threadId must be specified on the Message or Draft.Message you supply with your request. |
Craig Citro | 0e5b9bf | 2014-10-15 10:26:14 -0700 | [diff] [blame] | 612 | # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 613 | # - The Subject headers must match. |
| 614 | "labelIds": [ # List of IDs of labels applied to this message. |
| 615 | "A String", |
| 616 | ], |
| 617 | "id": "A String", # The immutable ID of the message. |
| 618 | }</pre> |
| 619 | </div> |
| 620 | |
| 621 | <div class="method"> |
| 622 | <code class="details" id="untrash">untrash(userId, id)</code> |
| 623 | <pre>Removes the specified message from the trash. |
| 624 | |
| 625 | Args: |
| 626 | userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required) |
| 627 | id: string, The ID of the message to remove from Trash. (required) |
| 628 | |
| 629 | Returns: |
| 630 | An object of the form: |
| 631 | |
| 632 | { # An email message. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame^] | 633 | "internalDate": "A String", # The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 634 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 635 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 636 | "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. |
| 637 | "data": "A String", # The body data of a MIME message part. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment. |
| 638 | "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. |
| 639 | "size": 42, # Total number of bytes in the body of the message part. |
| 640 | }, |
| 641 | "mimeType": "A String", # The MIME type of the message part. |
| 642 | "partId": "A String", # The immutable ID of the message part. |
| 643 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
| 644 | "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. |
| 645 | { |
| 646 | "name": "A String", # The name of the header before the : separator. For example, To. |
| 647 | "value": "A String", # The value of the header after the : separator. For example, someuser@example.com. |
| 648 | }, |
| 649 | ], |
| 650 | "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. |
| 651 | # Object with schema name: MessagePart |
| 652 | ], |
| 653 | }, |
| 654 | "snippet": "A String", # A short part of the message text. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 655 | "raw": "A String", # The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 656 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 657 | "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: |
| 658 | # - The requested threadId must be specified on the Message or Draft.Message you supply with your request. |
Craig Citro | 0e5b9bf | 2014-10-15 10:26:14 -0700 | [diff] [blame] | 659 | # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 660 | # - The Subject headers must match. |
| 661 | "labelIds": [ # List of IDs of labels applied to this message. |
| 662 | "A String", |
| 663 | ], |
| 664 | "id": "A String", # The immutable ID of the message. |
| 665 | }</pre> |
| 666 | </div> |
| 667 | |
| 668 | </body></html> |