Method: spaces.messages.get
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
किसी मैसेज के बारे में जानकारी दिखाता है. उदाहरण के लिए, किसी मैसेज के बारे में जानकारी पाना लेख पढ़ें.
इन तरह के authentication के साथ काम करता है:
ऐप्लिकेशन की पुष्टि, अनुमति के इन स्कोप में से किसी एक के साथ की गई हो:
https://www.googleapis.com/auth/chat.bot
: अनुमति के इस स्कोप का इस्तेमाल करने पर, यह तरीका Chat ऐप्लिकेशन के ऐक्सेस किए गए मैसेज के बारे में जानकारी देता है. जैसे, डायरेक्ट मैसेज और Chat ऐप्लिकेशन को चालू करने वाली स्लैश कमांड.
https://www.googleapis.com/auth/chat.app.messages.readonly
के लिए एडमिन की मंज़ूरी ज़रूरी है. यह सुविधा डेवलपर के लिए झलक में उपलब्ध है. पुष्टि करने के इस स्कोप का इस्तेमाल करने पर, यह तरीका किसी स्पेस में मौजूद सार्वजनिक मैसेज के बारे में जानकारी दिखाता है.
उपयोगकर्ता की पुष्टि के लिए, अनुमति के इन स्कोप में से किसी एक का इस्तेमाल करें:
https://www.googleapis.com/auth/chat.messages.readonly
https://www.googleapis.com/auth/chat.messages
ध्यान दें: ऐसा हो सकता है कि आपको ब्लॉक किए गए किसी सदस्य या स्पेस से मिला मैसेज दिखे.
एचटीटीपी अनुरोध
GET https://chat.googleapis.com/v1/{name=spaces/*/messages/*}
यह यूआरएल, gRPC ट्रांसकोडिंग सिंटैक्स का इस्तेमाल करता है.
पाथ पैरामीटर
पैरामीटर |
name |
string
ज़रूरी है. मैसेज के संसाधन का नाम. फ़ॉर्मैट: spaces/{space}/messages/{message} अगर आपने अपने मैसेज के लिए कस्टम आईडी सेट किया है, तो {message} के लिए clientAssignedMessageId फ़ील्ड से वैल्यू का इस्तेमाल किया जा सकता है. ज़्यादा जानकारी के लिए, किसी मैसेज को नाम देना लेख पढ़ें.
|
अनुरोध का मुख्य भाग
अनुरोध का मुख्य हिस्सा खाली होना चाहिए.
जवाब का मुख्य हिस्सा
कामयाब रहने पर, जवाब के मुख्य हिस्से में Message
का एक इंस्टेंस शामिल किया जाता है.
अनुमति के स्कोप
इसके लिए, इनमें से किसी एक OAuth स्कोप की ज़रूरत होती है:
https://www.googleapis.com/auth/chat.bot
https://www.googleapis.com/auth/chat.messages
https://www.googleapis.com/auth/chat.messages.readonly
https://www.googleapis.com/auth/chat.app.messages.readonly
ज़्यादा जानकारी के लिए, अनुमति देने से जुड़ी गाइड देखें.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-08-19 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-08-19 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eReturns detailed information about a specific message within a space.\u003c/p\u003e\n"],["\u003cp\u003eRequires providing the message's resource name using the format \u003ccode\u003espaces/{space}/messages/{message}\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eSupports both app and user authentication methods for accessing message details.\u003c/p\u003e\n"],["\u003cp\u003eThe response includes a \u003ccode\u003eMessage\u003c/code\u003e object containing the message data if the request is successful.\u003c/p\u003e\n"],["\u003cp\u003eRequires specific authorization scopes like \u003ccode\u003echat.bot\u003c/code\u003e, \u003ccode\u003echat.messages\u003c/code\u003e, or \u003ccode\u003echat.messages.readonly\u003c/code\u003e.\u003c/p\u003e\n"]]],["This outlines retrieving message details using a `GET` request to `https://chat.googleapis.com/v1/{name=spaces/*/messages/*}`. The message's resource name, found in the `name` path parameter (`spaces/{space}/messages/{message}`), is required. The request body must be empty. The successful response returns a `Message` instance. Authentication is achieved through either App or User authentication, requiring one of three specified OAuth scopes. This may include message from blocked member.\n"],null,["# Method: spaces.messages.get\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nReturns details about a message. For an example, see [Get details about a message](https://developers.google.com/workspace/chat/get-messages).\n\nSupports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):\n\n- [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with one of the following authorization scopes:\n\n - `https://www.googleapis.com/auth/chat.bot`: When using this authorization scope, this method returns details about a message the Chat app has access to, like direct messages and [slash commands](https://developers.google.com/workspace/chat/slash-commands) that invoke the Chat app.\n - `https://www.googleapis.com/auth/chat.app.messages.readonly` with [administrator approval](https://support.google.com/a?p=chat-app-auth) (available in [Developer Preview](https://developers.google.com/workspace/preview)). When using this authentication scope, this method returns details about a public message in a space.\n- [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes:\n\n - `https://www.googleapis.com/auth/chat.messages.readonly`\n - `https://www.googleapis.com/auth/chat.messages`\n\nNote: Might return a message from a blocked member or space.\n\n### HTTP request\n\n`GET https://chat.googleapis.com/v1/{name=spaces/*/messages/*}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` Required. Resource name of the message. Format: `spaces/{space}/messages/{message}` If you've set a custom ID for your message, you can use the value from the `clientAssignedMessageId` field for `{message}`. For details, see [Name a message](https://developers.google.com/workspace/chat/create-messages#name_a_created_message). |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body contains an instance of [Message](/workspace/chat/api/reference/rest/v1/spaces.messages#Message).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/chat.bot`\n- `https://www.googleapis.com/auth/chat.messages`\n- `https://www.googleapis.com/auth/chat.messages.readonly`\n- `https://www.googleapis.com/auth/chat.app.messages.readonly`\n\nFor more information, see the [Authorization guide](/workspace/chat/authenticate-authorize)."]]