Optional. A reference to the attachment data. This field is used to create or update messages with attachments, or with the media API to download the attachment data.
Output only. A reference to the Google Drive attachment. This field is used with the Google Drive API.
↳ thumbnail_uri
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.
↳ download_uri
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
int
Output only. The source of the attachment.
getName
Optional. Resource name of the attachment, in the formspaces/{space}/messages/{message}/attachments/{attachment}.
Returns
Type
Description
string
setName
Optional. Resource name of the attachment, in the formspaces/{space}/messages/{message}/attachments/{attachment}.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getContentName
Output only. The original file name for the content, not the full path.
Returns
Type
Description
string
setContentName
Output only. The original file name for the content, not the full path.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getContentType
Output only. The content type (MIME type) of the file.
Returns
Type
Description
string
setContentType
Output only. The content type (MIME type) of the file.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getAttachmentDataRef
Optional. A reference to the attachment data. This field is used to
create or update messages with attachments, or with the media API to
download the attachment data.
Optional. A reference to the attachment data. This field is used to
create or update messages with attachments, or with the media API to
download the attachment data.
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.
Returns
Type
Description
string
setThumbnailUri
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.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getDownloadUri
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.
Returns
Type
Description
string
setDownloadUri
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Apps Chat V1 Client - Class Attachment (0.12.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.12.0 (latest)](/php/docs/reference/apps-chat/latest/Chat.V1.Attachment)\n- [0.11.2](/php/docs/reference/apps-chat/0.11.2/Chat.V1.Attachment)\n- [0.10.0](/php/docs/reference/apps-chat/0.10.0/Chat.V1.Attachment)\n- [0.9.0](/php/docs/reference/apps-chat/0.9.0/Chat.V1.Attachment)\n- [0.8.1](/php/docs/reference/apps-chat/0.8.1/Chat.V1.Attachment)\n- [0.7.2](/php/docs/reference/apps-chat/0.7.2/Chat.V1.Attachment)\n- [0.6.1](/php/docs/reference/apps-chat/0.6.1/Chat.V1.Attachment)\n- [0.5.0](/php/docs/reference/apps-chat/0.5.0/Chat.V1.Attachment)\n- [0.4.0](/php/docs/reference/apps-chat/0.4.0/Chat.V1.Attachment)\n- [0.3.0](/php/docs/reference/apps-chat/0.3.0/Chat.V1.Attachment)\n- [0.2.0](/php/docs/reference/apps-chat/0.2.0/Chat.V1.Attachment)\n- [0.1.4](/php/docs/reference/apps-chat/0.1.4/Chat.V1.Attachment) \nReference documentation and code samples for the Google Apps Chat V1 Client class Attachment.\n\nAn attachment in Google Chat.\n\nGenerated from protobuf message `google.chat.v1.Attachment`\n\nNamespace\n---------\n\nGoogle \\\\ Apps \\\\ Chat \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getName\n\nOptional. Resource name of the attachment, in the form\n`spaces/{space}/messages/{message}/attachments/{attachment}`.\n\n### setName\n\nOptional. Resource name of the attachment, in the form\n`spaces/{space}/messages/{message}/attachments/{attachment}`.\n\n### getContentName\n\nOutput only. The original file name for the content, not the full path.\n\n### setContentName\n\nOutput only. The original file name for the content, not the full path.\n\n### getContentType\n\nOutput only. The content type (MIME type) of the file.\n\n### setContentType\n\nOutput only. The content type (MIME type) of the file.\n\n### getAttachmentDataRef\n\nOptional. A reference to the attachment data. This field is used to\ncreate or update messages with attachments, or with the media API to\ndownload the attachment data.\n\n### hasAttachmentDataRef\n\n### setAttachmentDataRef\n\nOptional. A reference to the attachment data. This field is used to\ncreate or update messages with attachments, or with the media API to\ndownload the attachment data.\n\n### getDriveDataRef\n\nOutput only. A reference to the Google Drive attachment. This field is\nused with the Google Drive API.\n\n### hasDriveDataRef\n\n### setDriveDataRef\n\nOutput only. A reference to the Google Drive attachment. This field is\nused with the Google Drive API.\n\n### getThumbnailUri\n\nOutput only. The thumbnail URL which should be used to preview the\nattachment to a human user. Chat apps shouldn't use this URL to download\nattachment content.\n\n### setThumbnailUri\n\nOutput only. The thumbnail URL which should be used to preview the\nattachment to a human user. Chat apps shouldn't use this URL to download\nattachment content.\n\n### getDownloadUri\n\nOutput only. The download URL which should be used to allow a human user to\ndownload the attachment. Chat apps shouldn't use this URL to download\nattachment content.\n\n### setDownloadUri\n\nOutput only. The download URL which should be used to allow a human user to\ndownload the attachment. Chat apps shouldn't use this URL to download\nattachment content.\n\n### getSource\n\nOutput only. The source of the attachment.\n\n### setSource\n\nOutput only. The source of the attachment.\n\n### getDataRef"]]