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.

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年05月07日 UTC.