REST Resource: spaces.messages.attachments
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
संसाधन: अटैचमेंट
Google Chat में मौजूद कोई अटैचमेंट.
JSON के काेड में दिखाना |
{
"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 .
} |
फ़ील्ड |
name |
string
ज़रूरी नहीं. अटैचमेंट का spaces/{space}/messages/{message}/attachments/{attachment} फ़ॉर्मैट में दिया गया संसाधन का नाम.
|
contentName |
string
सिर्फ़ आउटपुट के लिए. कॉन्टेंट की ओरिजनल फ़ाइल का नाम, न कि पूरा पाथ.
|
contentType |
string
सिर्फ़ आउटपुट के लिए. फ़ाइल का कॉन्टेंट टाइप (MIME टाइप).
|
thumbnailUri |
string
सिर्फ़ आउटपुट के लिए. थंबनेल का यूआरएल, जिसका इस्तेमाल किसी व्यक्ति को अटैचमेंट की झलक दिखाने के लिए किया जाना चाहिए. चैट ऐप्लिकेशन को अटैचमेंट का कॉन्टेंट डाउनलोड करने के लिए, इस यूआरएल का इस्तेमाल नहीं करना चाहिए.
|
downloadUri |
string
सिर्फ़ आउटपुट के लिए. डाउनलोड करने के लिए यूआरएल, जिसका इस्तेमाल करके कोई व्यक्ति अटैचमेंट डाउनलोड कर सकता है. चैट ऐप्लिकेशन को अटैचमेंट का कॉन्टेंट डाउनलोड करने के लिए, इस यूआरएल का इस्तेमाल नहीं करना चाहिए.
|
source |
enum (Source )
सिर्फ़ आउटपुट के लिए. अटैचमेंट का सोर्स.
|
यूनियन फ़ील्ड data_ref . अटैचमेंट का डेटा रेफ़रंस. data_ref इनमें से कोई एक हो सकता है: |
attachmentDataRef |
object (AttachmentDataRef )
ज़रूरी नहीं. अटैचमेंट के डेटा का रेफ़रंस. इस फ़ील्ड का इस्तेमाल, अटैचमेंट के साथ मैसेज बनाने या अपडेट करने के लिए किया जाता है. इसके अलावा, अटैचमेंट का डेटा डाउनलोड करने के लिए, मीडिया एपीआई के साथ भी इसका इस्तेमाल किया जाता है.
|
driveDataRef |
object (DriveDataRef )
सिर्फ़ आउटपुट के लिए. Google Drive में मौजूद अटैचमेंट का रेफ़रंस. इस फ़ील्ड का इस्तेमाल, Google Drive API के साथ किया जाता है.
|
AttachmentDataRef
अटैचमेंट के डेटा का रेफ़रंस.
JSON के काेड में दिखाना |
{
"resourceName": string,
"attachmentUploadToken": string
} |
फ़ील्ड |
resourceName |
string
ज़रूरी नहीं. अटैचमेंट डेटा के संसाधन का नाम. अटैचमेंट का डेटा डाउनलोड करने के लिए, इस फ़ील्ड का इस्तेमाल मीडिया एपीआई के साथ किया जाता है.
|
attachmentUploadToken |
string
ज़रूरी नहीं. अपलोड किए गए अटैचमेंट का रेफ़रंस देने वाला ओपेक टोकन. क्लाइंट इसे एक ओपैक स्ट्रिंग के तौर पर इस्तेमाल करते हैं. साथ ही, इसका इस्तेमाल अटैचमेंट के साथ Chat मैसेज बनाने या अपडेट करने के लिए किया जाता है.
|
स्रोत
Enums |
SOURCE_UNSPECIFIED |
रिज़र्व किया गया. |
DRIVE_FILE |
फ़ाइल, Google Drive में मौजूद कोई फ़ाइल हो. |
UPLOADED_CONTENT |
फ़ाइल को Chat पर अपलोड किया जाता है. |
तरीके |
|
मैसेज के अटैचमेंट का मेटाडेटा पाता है. |
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eAn \u003ccode\u003eAttachment\u003c/code\u003e resource represents a file attached to a Google Chat message, containing metadata such as file name, content type, and source.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eAttachment\u003c/code\u003e includes URLs for thumbnail preview and user download, but Chat apps should utilize the \u003ccode\u003edata_ref\u003c/code\u003e field for accessing content.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003edata_ref\u003c/code\u003e field can point to either uploaded content within Chat (\u003ccode\u003eAttachmentDataRef\u003c/code\u003e) or a Google Drive file (\u003ccode\u003eDriveDataRef\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eAttachmentDataRef\u003c/code\u003e is used by Chat apps to create/update messages with attachments or to download attachment data via the media API.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use the \u003ccode\u003eget\u003c/code\u003e method to retrieve metadata for a specific message attachment.\u003c/p\u003e\n"]]],["Attachments in Google Chat contain metadata and data references. Key information includes the attachment's `name`, `contentName`, `contentType`, `thumbnailUri`, and `downloadUri`. The `source` indicates if it's from Google Drive or uploaded to Chat. `AttachmentDataRef` provides a `resourceName` for media API downloads and an `attachmentUploadToken` for creating/updating messages with attachments. Methods to retrieve attachments metadata are detailed. The data source can be either a Drive file or uploaded content.\n"],null,["# REST Resource: spaces.messages.attachments\n\n- [Resource: Attachment](#Attachment)\n - [JSON representation](#Attachment.SCHEMA_REPRESENTATION)\n - [AttachmentDataRef](#Attachment.AttachmentDataRef)\n - [JSON representation](#Attachment.AttachmentDataRef.SCHEMA_REPRESENTATION)\n - [Source](#Attachment.Source)\n- [Methods](#METHODS_SUMMARY)\n\nResource: Attachment\n--------------------\n\nAn attachment in Google Chat.\n\n| JSON representation |\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"name\": string, \"contentName\": string, \"contentType\": string, \"thumbnailUri\": string, \"downloadUri\": string, \"source\": enum (/workspace/chat/api/reference/rest/v1/spaces.messages.attachments#Attachment.Source), // Union field `data_ref` can be only one of the following: \"attachmentDataRef\": { object (/workspace/chat/api/reference/rest/v1/spaces.messages.attachments#Attachment.AttachmentDataRef) }, \"driveDataRef\": { object (/workspace/chat/api/reference/rest/v1/DriveDataRef) } // End of list of possible types for union field `data_ref`. } ``` |\n\n| Fields ||\n|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` Optional. Resource name of the attachment, in the form `spaces/{space}/messages/{message}/attachments/{attachment}`. |\n| `contentName` | `string` Output only. The original file name for the content, not the full path. |\n| `contentType` | `string` Output only. The content type (MIME type) of the file. |\n| `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. |\n| `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. |\n| `source` | `enum (`[Source](/workspace/chat/api/reference/rest/v1/spaces.messages.attachments#Attachment.Source)`)` Output only. The source of the attachment. |\n| Union field `data_ref`. The data reference to the attachment. `data_ref` can be only one of the following: ||\n| `attachmentDataRef` | `object (`[AttachmentDataRef](/workspace/chat/api/reference/rest/v1/spaces.messages.attachments#Attachment.AttachmentDataRef)`)` 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. |\n| `driveDataRef` | `object (`[DriveDataRef](/workspace/chat/api/reference/rest/v1/DriveDataRef)`)` Output only. A reference to the Google Drive attachment. This field is used with the Google Drive API. |\n\n### AttachmentDataRef\n\nA reference to the attachment data.\n\n| JSON representation |\n|---------------------------------------------------------------------|\n| ``` { \"resourceName\": string, \"attachmentUploadToken\": string } ``` |\n\n| Fields ||\n|-------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `resourceName` | `string` Optional. The resource name of the attachment data. This field is used with the media API to download the attachment data. |\n| `attachmentUploadToken` | `string` Optional. 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. |\n\n### Source\n\nThe source of the attachment.\n\n| Enums ||\n|----------------------|----------------------------------|\n| `SOURCE_UNSPECIFIED` | Reserved. |\n| `DRIVE_FILE` | The file is a Google Drive file. |\n| `UPLOADED_CONTENT` | The file is uploaded to Chat. |\n\n| Methods ------- ||\n|----------------------------------------------------------------------------------|--------------------------------------------|\n| ### [get](/workspace/chat/api/reference/rest/v1/spaces.messages.attachments/get) | Gets the metadata of a message attachment. |"]]