REST Resource: users.messages.attachments
Stay organized with collections
Save and categorize content based on your preferences.
Resource: MessagePartBody
The body of a single MIME message part.
JSON representation |
{
"attachmentId": string,
"size": integer,
"data": string
} |
Fields |
attachmentId |
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.
|
size |
integer
Number of bytes for the message part data (encoding notwithstanding).
|
data |
string (bytes format)
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. A base64-encoded string.
|
Methods |
|
Gets the specified message attachment. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-03-24 UTC.
[null,null,["Last updated 2025-03-24 UTC."],[],[],null,["# REST Resource: users.messages.attachments\n\n- [Resource: MessagePartBody](#MessagePartBody)\n - [JSON representation](#MessagePartBody.SCHEMA_REPRESENTATION)\n- [Methods](#METHODS_SUMMARY)\n\nResource: MessagePartBody\n-------------------------\n\nThe body of a single MIME message part.\n\n| JSON representation |\n|---------------------------------------------------------------------|\n| ``` { \"attachmentId\": string, \"size\": integer, \"data\": string } ``` |\n\n| Fields ||\n|----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `attachmentId` | `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. |\n| `size` | `integer` Number of bytes for the message part data (encoding notwithstanding). |\n| `data` | `string (`[bytes](https://developers.google.com/discovery/v1/type-format)` format)` 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. A base64-encoded string. |\n\n| Methods ------- ||\n|----------------------------------------------------------------------------------|----------------------------------------|\n| ### [get](/workspace/gmail/api/reference/rest/v1/users.messages.attachments/get) | Gets the specified message attachment. |"]]