# REST Resource: users.messages.attachments

- [Resource: MessagePartBody](https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.messages.attachments#MessagePartBody)
  - [JSON representation](https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.messages.attachments#MessagePartBody.SCHEMA_REPRESENTATION)
- [Methods](https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.messages.attachments#METHODS_SUMMARY)

## 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 (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. |

| ## Methods ||
|---|---|
| ### `https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.messages.attachments/get` | Gets the specified message attachment. |