यह फ़ंक्शन, किसी उपयोगकर्ता के साथ मौजूदा डायरेक्ट मैसेज दिखाता है. अगर डायरेक्ट मैसेज में कोई स्पेस नहीं मिलता है, तो 404 NOT_FOUND गड़बड़ी का कोड दिखाता है. उदाहरण के लिए, डायरेक्ट मैसेज ढूंढना देखें.
ऐप्लिकेशन की पुष्टि करने की सुविधा का इस्तेमाल करने पर, चुनिंदा उपयोगकर्ता और कॉल के लिए इस्तेमाल होने वाले Chat ऐप्लिकेशन के बीच डायरेक्ट मैसेज स्पेस मिलता है.
उपयोगकर्ता की पुष्टि करने पर, यह फ़ंक्शन उस उपयोगकर्ता और पुष्टि किए गए उपयोगकर्ता के बीच का डायरेक्ट मैसेज स्पेस दिखाता है.
// पुष्टि करने के लिए, इन तरीकों का इस्तेमाल किया जा सकता है:
ज़रूरी है. उस उपयोगकर्ता का संसाधन का नाम जिसके साथ डायरेक्ट मैसेज ढूंढना है.
फ़ॉर्मैट: 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 के इनमें से किसी एक स्कोप की ज़रूरत होती है:
[[["समझने में आसान है","easyToUnderstand","thumb-up"],["मेरी समस्या हल हो गई","solvedMyProblem","thumb-up"],["अन्य","otherUp","thumb-up"]],[["वह जानकारी मौजूद नहीं है जो मुझे चाहिए","missingTheInformationINeed","thumb-down"],["बहुत मुश्किल है / बहुत सारे चरण हैं","tooComplicatedTooManySteps","thumb-down"],["पुराना","outOfDate","thumb-down"],["अनुवाद से जुड़ी समस्या","translationIssue","thumb-down"],["सैंपल / कोड से जुड़ी समस्या","samplesCodeIssue","thumb-down"],["अन्य","otherDown","thumb-down"]],["आखिरी बार 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"]]