Method: spaces.findDirectMessage
यह फ़ंक्शन, किसी उपयोगकर्ता के साथ मौजूदा डायरेक्ट मैसेज दिखाता है. अगर डायरेक्ट मैसेज में कोई स्पेस नहीं मिलता है, तो 404 NOT_FOUND
गड़बड़ी का कोड दिखाता है. उदाहरण के लिए, डायरेक्ट मैसेज ढूंढना देखें.
ऐप्लिकेशन की पुष्टि करने की सुविधा का इस्तेमाल करने पर, चुनिंदा उपयोगकर्ता और कॉल के लिए इस्तेमाल होने वाले Chat ऐप्लिकेशन के बीच डायरेक्ट मैसेज स्पेस मिलता है.
उपयोगकर्ता की पुष्टि करने पर, यह फ़ंक्शन उस उपयोगकर्ता और पुष्टि किए गए उपयोगकर्ता के बीच का डायरेक्ट मैसेज स्पेस दिखाता है.
// पुष्टि करने के लिए, इन तरीकों का इस्तेमाल किया जा सकता है:
एचटीटीपी अनुरोध
GET https://chat.googleapis.com/v1/spaces:findDirectMessage
यूआरएल में gRPC ट्रांसकोडिंग सिंटैक्स का इस्तेमाल किया गया है.
क्वेरी पैरामीटर
पैरामीटर |
name |
string
ज़रूरी है. उस उपयोगकर्ता का संसाधन का नाम जिसके साथ डायरेक्ट मैसेज ढूंढना है. फ़ॉर्मैट: users/{user} , जहां {user} , People API के व्यक्ति के लिए या डायरेक्ट्री एपीआई में उपयोगकर्ता के लिए id है.id उदाहरण के लिए, अगर People API प्रोफ़ाइल आईडी 123456789 है, तो name के तौर पर users/123456789 का इस्तेमाल करके, उस व्यक्ति के साथ किया गया डायरेक्ट मैसेज ढूंढा जा सकता है. उपयोगकर्ता के तौर पर पुष्टि होने पर, {user} के लिए ईमेल को उपनाम के तौर पर इस्तेमाल किया जा सकता है. उदाहरण के लिए, users/example@gmail.com , जहां example@gmail.com Google Chat का इस्तेमाल करने वाले व्यक्ति का ईमेल है.
|
अनुरोध का मुख्य भाग
अनुरोध का मुख्य हिस्सा खाली होना चाहिए.
जवाब का मुख्य हिस्सा
कामयाब रहने पर, जवाब के मुख्य हिस्से में Space
का एक इंस्टेंस शामिल किया जाता है.
अनुमति के दायरे
इसके लिए, OAuth के इनमें से किसी एक स्कोप की ज़रूरत होती है:
https://www.googleapis.com/auth/chat.spaces
https://www.googleapis.com/auth/chat.spaces.readonly
https://www.googleapis.com/auth/chat.bot
ज़्यादा जानकारी के लिए, अनुमति से जुड़ी गाइड देखें.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2024-11-12 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2024-11-12 (UTC) को अपडेट किया गया."],[[["Retrieves the existing direct message with a specified user or Chat app, returning a 404 error if none is found."],["Supports both app authentication and user authentication for finding direct messages."],["Requires providing the resource name of the user in the `name` query parameter using specific formats."],["Uses a `GET` HTTP request to the `https://chat.googleapis.com/v1/spaces:findDirectMessage` endpoint with gRPC Transcoding syntax."],["Needs authorization with specific OAuth scopes like `chat.spaces`, `chat.spaces.readonly`, or `chat.bot`."]]],["This outlines how to retrieve an existing direct message space with a specific user via the Chat API. Use a `GET` request to `https://chat.googleapis.com/v1/spaces:findDirectMessage`. Provide the target user's resource name in the `name` query parameter (e.g., `users/123456789`). The request body should be empty. Upon success, the response includes a `Space` resource. Requires either App or User authentication and specific OAuth scopes like `chat.spaces` or `chat.spaces.readonly`.\n"]]