Method: spaces.messages.attachments.get

  • Retrieves metadata of a message attachment, with the actual attachment data fetched separately using the media API.

  • Requires the chat.bot OAuth scope and app authentication for access.

  • Uses a GET request to the specified URL with the attachment's resource name as a path parameter.

  • Returns an Attachment object in the response body upon successful execution.

  • Refer to the provided links for a practical example and further details on media download and authorization.

Gets the metadata of a message attachment. The attachment data is fetched using the media API. For an example, see Get metadata about a message attachment.

Requires app authentication with the authorization scope:

  • https://www.googleapis.com/auth/chat.bot

HTTP request

GET https://chat.googleapis.com/v1/{name=spaces/*/messages/*/attachments/*}

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
name

string

Required. Resource name of the attachment, in the form spaces/{space}/messages/{message}/attachments/{attachment}.

Request body

The request body must be empty.

Response body

If successful, the response body contains an instance of Attachment.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/chat.bot

For more information, see the Authorization guide.