---
title: "GET /v1/spaces/{spacesId}/messages/{messagesId}/attachments/{attachmentsId}"
method: GET
path: "/v1/spaces/{spacesId}/messages/{messagesId}/attachments/{attachmentsId}"
tags: ["spaces"]
---

# GET /v1/spaces/{spacesId}/messages/{messagesId}/attachments/{attachmentsId}

`GET /v1/spaces/{spacesId}/messages/{messagesId}/attachments/{attachmentsId}`

## Request

- Base URL: `https://chat.googleapis.com`
- URL: `https://chat.googleapis.com/v1/spaces/{spacesId}/messages/{messagesId}/attachments/{attachmentsId}`
- Auth: OAuth 2 and OAuth 2
  - Implicit: `https://accounts.google.com/o/oauth2/auth`
  - Scopes: `https://www.googleapis.com/auth/chat.bot`
  - Authorization code: `https://accounts.google.com/o/oauth2/auth`
  - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/chat.bot`

Gets the metadata of a message attachment. The attachment data is fetched using the [media API](https://developers.google.com/workspace/chat/api/reference/rest/v1/media/download). For an example, see [Get metadata about a message attachment](https://developers.google.com/workspace/chat/get-media-attachments). Requires [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with the [authorization scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - `https://www.googleapis.com/auth/chat.bot`

## Path parameters

- `spacesId` string, required
- `messagesId` string, required
- `attachmentsId` string, required

## Response `200`

Successful response

- Attachment: An attachment in Google Chat.
  - `attachmentDataRef` AttachmentDataRef: A reference to the attachment data.
    - `attachmentUploadToken` string: Optional. Opaque token containing a reference to an uploaded attachment. Treated by clients as an opaque string and used to create or update Chat messages with attachments.
    - `resourceName` string: Optional. The resource name of the attachment data. This field is used with the media API to download the attachment data.
  - `contentName` string: Output only. The original file name for the content, not the full path.
  - `contentType` string: Output only. The content type (MIME type) of the file.
  - `downloadUri` string: Output only. The download URL which should be used to allow a human user to download the attachment. Chat apps shouldn't use this URL to download attachment content.
  - `driveDataRef` DriveDataRef: A reference to the data of a drive attachment.
    - `driveFileId` string: The ID for the drive file. Use with the Drive API.
  - `name` string: Identifier. Resource name of the attachment. Format: `spaces/{space}/messages/{message}/attachments/{attachment}`.
  - `source` 'SOURCE_UNSPECIFIED' | 'DRIVE_FILE' | 'UPLOADED_CONTENT': Output only. The source of the attachment.
  - `thumbnailUri` string: Output only. The thumbnail URL which should be used to preview the attachment to a human user. Chat apps shouldn't use this URL to download attachment content.

---

[API](https://skmtc.dev/google/apis/chat.md) - [All operations](https://skmtc.dev/google/apis/chat/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/chat/revisions/ffee5784d4b1?raw)
