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.threads.html">threads</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="#delete">delete(userId, id)</a></code></p> |
| 79 | <p class="firstline">Immediately and permanently deletes the specified thread. This operation cannot be undone. Prefer threads.trash instead.</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="#get">get(userId, id, format=None, metadataHeaders=None)</a></code></p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 82 | <p class="firstline">Gets the specified thread.</p> |
| 83 | <p class="toc_element"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 84 | <code><a href="#list">list(userId, includeSpamTrash=None, labelIds=None, maxResults=None, pageToken=None, q=None)</a></code></p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 85 | <p class="firstline">Lists the threads in the user's mailbox.</p> |
| 86 | <p class="toc_element"> |
| 87 | <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> |
| 88 | <p class="firstline">Retrieves the next page of results.</p> |
| 89 | <p class="toc_element"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 90 | <code><a href="#modify">modify(userId, id, body=None)</a></code></p> |
| 91 | <p class="firstline">Modifies the labels applied to the thread. This applies to all messages in the thread.</p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 92 | <p class="toc_element"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 93 | <code><a href="#trash">trash(userId, id)</a></code></p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 94 | <p class="firstline">Moves the specified thread to the trash.</p> |
| 95 | <p class="toc_element"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 96 | <code><a href="#untrash">untrash(userId, id)</a></code></p> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 97 | <p class="firstline">Removes the specified thread from the trash.</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="delete">delete(userId, id)</code> |
| 101 | <pre>Immediately and permanently deletes the specified thread. This operation cannot be undone. Prefer threads.trash instead. |
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 | id: string, ID of the Thread to delete. (required) |
| 106 | </pre> |
| 107 | </div> |
| 108 | |
| 109 | <div class="method"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 110 | <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] | 111 | <pre>Gets the specified thread. |
| 112 | |
| 113 | Args: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 114 | 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] | 115 | id: string, The ID of the thread to retrieve. (required) |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 116 | format: string, The format to return the messages in. |
| 117 | Allowed values |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 118 | full - |
| 119 | metadata - |
| 120 | minimal - |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 121 | 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] | 122 | |
| 123 | Returns: |
| 124 | An object of the form: |
| 125 | |
| 126 | { # A collection of messages representing a conversation. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 127 | "historyId": "A String", # The ID of the last history record that modified this thread. |
| 128 | "id": "A String", # The unique ID of the thread. |
| 129 | "messages": [ # The list of messages in the thread. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 130 | { # An email message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 131 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 132 | "id": "A String", # The immutable ID of the message. |
| 133 | "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. |
| 134 | "labelIds": [ # List of IDs of labels applied to this message. |
| 135 | "A String", |
| 136 | ], |
| 137 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 138 | "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for container MIME message parts. |
| 139 | "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. |
| 140 | "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. |
| 141 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 142 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 143 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
| 144 | "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] | 145 | { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 146 | "name": "A String", # The name of the header before the : separator. For example, To. |
| 147 | "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] | 148 | }, |
| 149 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 150 | "mimeType": "A String", # The MIME type of the message part. |
| 151 | "partId": "A String", # The immutable ID of the message part. |
| 152 | "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] | 153 | # Object with schema name: MessagePart |
| 154 | ], |
| 155 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 156 | "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. |
| 157 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 158 | "snippet": "A String", # A short part of the message text. |
| 159 | "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: |
| 160 | # - The requested threadId must be specified on the Message or Draft.Message you supply with your request. |
| 161 | # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. |
| 162 | # - The Subject headers must match. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 163 | }, |
| 164 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 165 | "snippet": "A String", # A short part of the message text. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 166 | }</pre> |
| 167 | </div> |
| 168 | |
| 169 | <div class="method"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 170 | <code class="details" id="list">list(userId, includeSpamTrash=None, labelIds=None, maxResults=None, pageToken=None, q=None)</code> |
| 171 | <pre>Lists the threads in the user's mailbox. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 172 | |
| 173 | Args: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 174 | userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required) |
| 175 | includeSpamTrash: boolean, Include threads from SPAM and TRASH in the results. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 176 | labelIds: string, Only return threads with labels that match all of the specified label IDs. (repeated) |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 177 | maxResults: integer, Maximum number of threads to return. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 178 | pageToken: string, Page token to retrieve a specific page of results in the list. |
| 179 | q: string, Only return threads matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread". Parameter cannot be used when accessing the api using the gmail.metadata scope. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 180 | |
| 181 | Returns: |
| 182 | An object of the form: |
| 183 | |
| 184 | { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 185 | "nextPageToken": "A String", # Page token to retrieve the next page of results in the list. |
| 186 | "resultSizeEstimate": 42, # Estimated total number of results. |
| 187 | "threads": [ # List of threads. Note that each thread resource does not contain a list of messages. The list of messages for a given thread can be fetched using the threads.get method. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 188 | { # A collection of messages representing a conversation. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 189 | "historyId": "A String", # The ID of the last history record that modified this thread. |
| 190 | "id": "A String", # The unique ID of the thread. |
| 191 | "messages": [ # The list of messages in the thread. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 192 | { # An email message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 193 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 194 | "id": "A String", # The immutable ID of the message. |
| 195 | "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. |
| 196 | "labelIds": [ # List of IDs of labels applied to this message. |
| 197 | "A String", |
| 198 | ], |
| 199 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 200 | "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. |
| 201 | "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. |
| 202 | "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. |
| 203 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 204 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 205 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
| 206 | "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] | 207 | { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 208 | "name": "A String", # The name of the header before the : separator. For example, To. |
| 209 | "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] | 210 | }, |
| 211 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 212 | "mimeType": "A String", # The MIME type of the message part. |
| 213 | "partId": "A String", # The immutable ID of the message part. |
| 214 | "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] | 215 | # Object with schema name: MessagePart |
| 216 | ], |
| 217 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 218 | "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. |
| 219 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 220 | "snippet": "A String", # A short part of the message text. |
| 221 | "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: |
| 222 | # - The requested threadId must be specified on the Message or Draft.Message you supply with your request. |
| 223 | # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. |
| 224 | # - The Subject headers must match. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 225 | }, |
| 226 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 227 | "snippet": "A String", # A short part of the message text. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 228 | }, |
| 229 | ], |
| 230 | }</pre> |
| 231 | </div> |
| 232 | |
| 233 | <div class="method"> |
| 234 | <code class="details" id="list_next">list_next(previous_request, previous_response)</code> |
| 235 | <pre>Retrieves the next page of results. |
| 236 | |
| 237 | Args: |
| 238 | previous_request: The request for the previous page. (required) |
| 239 | previous_response: The response from the request for the previous page. (required) |
| 240 | |
| 241 | Returns: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 242 | 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] | 243 | page. Returns None if there are no more items in the collection. |
| 244 | </pre> |
| 245 | </div> |
| 246 | |
| 247 | <div class="method"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 248 | <code class="details" id="modify">modify(userId, id, body=None)</code> |
| 249 | <pre>Modifies the labels applied to the thread. This applies to all messages in the thread. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 250 | |
| 251 | Args: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 252 | 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] | 253 | id: string, The ID of the thread to modify. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 254 | body: object, The request body. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 255 | The object takes the form of: |
| 256 | |
| 257 | { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 258 | "addLabelIds": [ # A list of IDs of labels to add to this thread. |
| 259 | "A String", |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 260 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 261 | "removeLabelIds": [ # A list of IDs of labels to remove from this thread. |
| 262 | "A String", |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 263 | ], |
| 264 | } |
| 265 | |
| 266 | |
| 267 | Returns: |
| 268 | An object of the form: |
| 269 | |
| 270 | { # A collection of messages representing a conversation. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 271 | "historyId": "A String", # The ID of the last history record that modified this thread. |
| 272 | "id": "A String", # The unique ID of the thread. |
| 273 | "messages": [ # The list of messages in the thread. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 274 | { # An email message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 275 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 276 | "id": "A String", # The immutable ID of the message. |
| 277 | "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. |
| 278 | "labelIds": [ # List of IDs of labels applied to this message. |
| 279 | "A String", |
| 280 | ], |
| 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 | "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. |
| 284 | "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. |
| 285 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 286 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 287 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
| 288 | "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] | 289 | { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 290 | "name": "A String", # The name of the header before the : separator. For example, To. |
| 291 | "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] | 292 | }, |
| 293 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 294 | "mimeType": "A String", # The MIME type of the message part. |
| 295 | "partId": "A String", # The immutable ID of the message part. |
| 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. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 297 | # Object with schema name: MessagePart |
| 298 | ], |
| 299 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 300 | "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. |
| 301 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 302 | "snippet": "A String", # A short part of the message text. |
| 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. |
| 305 | # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. |
| 306 | # - The Subject headers must match. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 307 | }, |
| 308 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 309 | "snippet": "A String", # A short part of the message text. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 310 | }</pre> |
| 311 | </div> |
| 312 | |
| 313 | <div class="method"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 314 | <code class="details" id="trash">trash(userId, id)</code> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 315 | <pre>Moves the specified thread to the trash. |
| 316 | |
| 317 | Args: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 318 | 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] | 319 | id: string, The ID of the thread to Trash. (required) |
| 320 | |
| 321 | Returns: |
| 322 | An object of the form: |
| 323 | |
| 324 | { # A collection of messages representing a conversation. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 325 | "historyId": "A String", # The ID of the last history record that modified this thread. |
| 326 | "id": "A String", # The unique ID of the thread. |
| 327 | "messages": [ # The list of messages in the thread. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 328 | { # An email message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 329 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 330 | "id": "A String", # The immutable ID of the message. |
| 331 | "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. |
| 332 | "labelIds": [ # List of IDs of labels applied to this message. |
| 333 | "A String", |
| 334 | ], |
| 335 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 336 | "body": { # The body of a single MIME message part. # The message part body for this part, which may be empty for container MIME message parts. |
| 337 | "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. |
| 338 | "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. |
| 339 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 340 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 341 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
| 342 | "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] | 343 | { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 344 | "name": "A String", # The name of the header before the : separator. For example, To. |
| 345 | "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] | 346 | }, |
| 347 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 348 | "mimeType": "A String", # The MIME type of the message part. |
| 349 | "partId": "A String", # The immutable ID of the message part. |
| 350 | "parts": [ # The child MIME message parts of this part. This only applies to container MIME message parts, for example multipart/*. For non- container MIME message part types, such as text/plain, this field is empty. For more information, see RFC 1521. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 351 | # Object with schema name: MessagePart |
| 352 | ], |
| 353 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 354 | "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. |
| 355 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 356 | "snippet": "A String", # A short part of the message text. |
| 357 | "threadId": "A String", # The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met: |
| 358 | # - The requested threadId must be specified on the Message or Draft.Message you supply with your request. |
| 359 | # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. |
| 360 | # - The Subject headers must match. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 361 | }, |
| 362 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 363 | "snippet": "A String", # A short part of the message text. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 364 | }</pre> |
| 365 | </div> |
| 366 | |
| 367 | <div class="method"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 368 | <code class="details" id="untrash">untrash(userId, id)</code> |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 369 | <pre>Removes the specified thread from the trash. |
| 370 | |
| 371 | Args: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 372 | 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] | 373 | id: string, The ID of the thread to remove from Trash. (required) |
| 374 | |
| 375 | Returns: |
| 376 | An object of the form: |
| 377 | |
| 378 | { # A collection of messages representing a conversation. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 379 | "historyId": "A String", # The ID of the last history record that modified this thread. |
| 380 | "id": "A String", # The unique ID of the thread. |
| 381 | "messages": [ # The list of messages in the thread. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 382 | { # An email message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 383 | "historyId": "A String", # The ID of the last history record that modified this message. |
| 384 | "id": "A String", # The immutable ID of the message. |
| 385 | "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. |
| 386 | "labelIds": [ # List of IDs of labels applied to this message. |
| 387 | "A String", |
| 388 | ], |
| 389 | "payload": { # A single MIME message part. # The parsed email structure in the message parts. |
| 390 | "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. |
| 391 | "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. |
| 392 | "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. |
| 393 | "size": 42, # Number of bytes for the message part data (encoding notwithstanding). |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 394 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 395 | "filename": "A String", # The filename of the attachment. Only present if this message part represents an attachment. |
| 396 | "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] | 397 | { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 398 | "name": "A String", # The name of the header before the : separator. For example, To. |
| 399 | "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] | 400 | }, |
| 401 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 402 | "mimeType": "A String", # The MIME type of the message part. |
| 403 | "partId": "A String", # The immutable ID of the message part. |
| 404 | "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] | 405 | # Object with schema name: MessagePart |
| 406 | ], |
| 407 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 408 | "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. |
| 409 | "sizeEstimate": 42, # Estimated size in bytes of the message. |
| 410 | "snippet": "A String", # A short part of the message text. |
| 411 | "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: |
| 412 | # - The requested threadId must be specified on the Message or Draft.Message you supply with your request. |
| 413 | # - The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. |
| 414 | # - The Subject headers must match. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 415 | }, |
| 416 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 417 | "snippet": "A String", # A short part of the message text. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 418 | }</pre> |
| 419 | </div> |
| 420 | |
| 421 | </body></html> |