You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<pclass="firstline">[Developer Preview](https://developers.google.com/workspace/preview): Uploads an attachment. Requires user [authentication](https://developers.google.com/chat/api/guides/auth/users). You can upload attachments up to 200 MB. Certain file types aren't supported. For details, see [File types blocked by Google Chat](https://support.google.com/chat/answer/7651457?&co=GENIE.Platform%3DDesktop#File%20types%20blocked%20in%20Google%20Chat).</p>
<pre>[Developer Preview](https://developers.google.com/workspace/preview): Uploads an attachment. Requires user [authentication](https://developers.google.com/chat/api/guides/auth/users). You can upload attachments up to 200 MB. Certain file types aren't supported. For details, see [File types blocked by Google Chat](https://support.google.com/chat/answer/7651457?&co=GENIE.Platform%3DDesktop#File%20types%20blocked%20in%20Google%20Chat).
134
+
135
+
Args:
136
+
parent: string, Required. Resource name of the Chat space in which the attachment is uploaded. Format "spaces/{space}". (required)
"filename": "A String", # Required. The filename of the attachment, including the file extension.
142
+
}
143
+
144
+
media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
145
+
media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object.
146
+
x__xgafv: string, V1 error format.
147
+
Allowed values
148
+
1 - v1 error format
149
+
2 - v2 error format
150
+
151
+
Returns:
152
+
An object of the form:
153
+
154
+
{
155
+
"attachmentDataRef": { # Reference to the uploaded attachment.
156
+
"attachmentUploadToken": "A 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. [Developer Preview](https://developers.google.com/workspace/preview).
157
+
"resourceName": "A String", # The resource name of the attachment data. This field is used with the media API to download the attachment data.
Copy file name to clipboardExpand all lines: docs/dyn/chat_v1.spaces.messages.attachments.html
+9-8Lines changed: 9 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -91,7 +91,7 @@ <h3>Method Details</h3>
91
91
<pre>Gets the metadata of a message attachment. The attachment data is fetched using the [media API](https://developers.google.com/chat/api/reference/rest/v1/media/download). Requires [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts).
92
92
93
93
Args:
94
-
name: string, Required. Resource name of the attachment, in the form "spaces/*/messages/*/attachments/*". (required)
94
+
name: string, Required. Resource name of the attachment, in the form `spaces/*/messages/*/attachments/*`. (required)
95
95
x__xgafv: string, V1 error format.
96
96
Allowed values
97
97
1 - v1 error format
@@ -101,18 +101,19 @@ <h3>Method Details</h3>
101
101
An object of the form:
102
102
103
103
{ # An attachment in Google Chat.
104
-
"attachmentDataRef": { # A reference to the attachment data. This is used with the media API to download the attachment data.
105
-
"resourceName": "A String", # The resource name of the attachment data. This is used with the media API to download the attachment data.
104
+
"attachmentDataRef": { # A reference to the attachment data. This field is used with the media API to download the attachment data.
105
+
"attachmentUploadToken": "A 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. [Developer Preview](https://developers.google.com/workspace/preview).
106
+
"resourceName": "A String", # The resource name of the attachment data. This field is used with the media API to download the attachment data.
106
107
},
107
108
"contentName": "A String", # The original file name for the content, not the full path.
108
109
"contentType": "A String", # The content type (MIME type) of the file.
109
-
"downloadUri": "A String", # Output only. The download URL which should be used to allow a human user to download the attachment. Chat apps should not use this URL to download attachment content.
110
-
"driveDataRef": { # A reference to the data of a drive attachment. # A reference to the drive attachment. This is used with the Drive API.
111
-
"driveFileId": "A String", # The id for the drive file, for use with the Drive API.
110
+
"downloadUri": "A 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.
111
+
"driveDataRef": { # A reference to the data of a drive attachment. # A reference to the drive attachment. This field is used with the Drive API.
112
+
"driveFileId": "A String", # The ID for the drive file. Use with the Drive API.
112
113
},
113
-
"name": "A String", # Resource name of the attachment, in the form "spaces/*/messages/*/attachments/*".
114
+
"name": "A String", # Resource name of the attachment, in the form `spaces/*/messages/*/attachments/*`.
114
115
"source": "A String", # The source of the attachment.
115
-
"thumbnailUri": "A String", # Output only. The thumbnail URL which should be used to preview the attachment to a human user. Chat apps should not use this URL to download attachment content.
116
+
"thumbnailUri": "A 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.
0 commit comments