---
title: "GET /users/{userId}/messages/{messageId}/attachments/{id}"
method: GET
path: "/users/{userId}/messages/{messageId}/attachments/{id}"
tags: ["users"]
---

# GET /users/{userId}/messages/{messageId}/attachments/{id}

`GET /users/{userId}/messages/{messageId}/attachments/{id}`

Gets the specified message attachment.

## Path parameters

- `userId` string, required
- `messageId` string, required
- `id` string, required

## Query parameters

- `$.xgafv` '1' | '2' — V1 error format
- `access_token` string
- `alt` 'json' | 'media' | 'proto' — Data format for response
- `callback` string
- `fields` string
- `key` string
- `oauth_token` string
- `prettyPrint` boolean
- `quotaUser` string
- `upload_protocol` string
- `uploadType` string

## Response `200`

Successful response

- MessagePartBody — The body of a single MIME message part
  - `data` string, byte — 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
  - `size` integer — Number of bytes for the message part data (encoding notwithstanding)
  - `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

---

[API](https://skmtc.net/ballerina-platform/apis/gmail-api.md) · [All operations](https://skmtc.net/ballerina-platform/apis/gmail-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ballerina-platform/gmail-api/versions/c7f11764507c/schema)
