REST Resource: spaces.messages.attachments

Resource: Attachment

An attachment in Google Chat.

JSON representation
{
  "name": string,
  "contentName": string,
  "contentType": string,
  "thumbnailUri": string,
  "downloadUri": string,
  "source": enum (Source),

  // Union field data_ref can be only one of the following:
  "attachmentDataRef": {
    object (AttachmentDataRef)
  },
  "driveDataRef": {
    object (DriveDataRef)
  }
  // End of list of possible types for union field data_ref.
}
Fields
name

string

Resource name of the attachment, in the form spaces/*/messages/*/attachments/*.

contentName

string

The original file name for the content, not the full path.

contentType

string

The content type (MIME type) of the file.

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.

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.

source

enum (Source)

The source of the attachment.

Union field data_ref.

data_ref can be only one of the following:

attachmentDataRef

object (AttachmentDataRef)

A reference to the attachment data. This field is used with the media API to download the attachment data.

driveDataRef

object (DriveDataRef)

A reference to the drive attachment. This field is used with the Drive API.

AttachmentDataRef

JSON representation
{
  "resourceName": string,
  "attachmentUploadToken": string
}
Fields
resourceName

string

The resource name of the attachment data. This field is used with the media API to download the attachment data.

attachmentUploadToken

string

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.

DriveDataRef

A reference to the data of a drive attachment.

JSON representation
{
  "driveFileId": string
}
Fields
driveFileId

string

The ID for the drive file. Use with the Drive API.

Source

Enums
SOURCE_UNSPECIFIED
DRIVE_FILE
UPLOADED_CONTENT

Methods

get

Gets the metadata of a message attachment.