Method: spaces.findDirectMessage
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
নির্দিষ্ট ব্যবহারকারীর সাথে বিদ্যমান সরাসরি বার্তা ফেরত দেয়। যদি কোনো সরাসরি বার্তা স্থান না পাওয়া যায়, একটি 404 NOT_FOUND
ত্রুটি প্রদান করে। একটি উদাহরণের জন্য, একটি সরাসরি বার্তা খুঁজুন দেখুন।
অ্যাপ প্রমাণীকরণের মাধ্যমে, নির্দিষ্ট ব্যবহারকারী এবং কলিং চ্যাট অ্যাপের মধ্যে সরাসরি বার্তার স্থান ফেরত দেয়।
ব্যবহারকারীর প্রমাণীকরণের সাথে, নির্দিষ্ট ব্যবহারকারী এবং প্রমাণীকৃত ব্যবহারকারীর মধ্যে সরাসরি বার্তা স্থান ফেরত দেয়।
নিম্নলিখিত ধরনের প্রমাণীকরণ সমর্থন করে:
HTTP অনুরোধ
GET https://chat.googleapis.com/v1/spaces:findDirectMessage
URL gRPC ট্রান্সকোডিং সিনট্যাক্স ব্যবহার করে।
ক্যোয়ারী প্যারামিটার
পরামিতি |
---|
name | string প্রয়োজন। সরাসরি বার্তা খুঁজে পেতে ব্যবহারকারীর সম্পদের নাম। বিন্যাস: users/{user} , যেখানে {user} হয় People API-এর ব্যক্তির id , অথবা ডিরেক্টরি API-এর ব্যবহারকারীর জন্য id । উদাহরণস্বরূপ, যদি People API প্রোফাইল ID 123456789 হয়, তাহলে আপনি users/123456789 name হিসেবে ব্যবহার করে সেই ব্যক্তির সাথে একটি সরাসরি বার্তা খুঁজে পেতে পারেন। যখন একজন ব্যবহারকারী হিসাবে প্রমাণীকরণ করা হয় , আপনি {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 সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-07-25 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2025-07-25 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eRetrieves the existing direct message with a specified user or Chat app, returning a 404 error if none is found.\u003c/p\u003e\n"],["\u003cp\u003eSupports both app authentication and user authentication for finding direct messages.\u003c/p\u003e\n"],["\u003cp\u003eRequires providing the resource name of the user in the \u003ccode\u003ename\u003c/code\u003e query parameter using specific formats.\u003c/p\u003e\n"],["\u003cp\u003eUses a \u003ccode\u003eGET\u003c/code\u003e HTTP request to the \u003ccode\u003ehttps://chat.googleapis.com/v1/spaces:findDirectMessage\u003c/code\u003e endpoint with gRPC Transcoding syntax.\u003c/p\u003e\n"],["\u003cp\u003eNeeds authorization with specific OAuth scopes like \u003ccode\u003echat.spaces\u003c/code\u003e, \u003ccode\u003echat.spaces.readonly\u003c/code\u003e, or \u003ccode\u003echat.bot\u003c/code\u003e.\u003c/p\u003e\n"]]],["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"],null,["# Method: spaces.findDirectMessage\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Query parameters](#body.QUERY_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 the existing direct message with the specified user. If no direct message space is found, returns a `404 NOT_FOUND` error. For an example, see [Find a direct message](/chat/api/guides/v1/spaces/find-direct-message).\n\nWith [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app), returns the direct message space between the specified user and the calling Chat app.\n\nWith [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), returns the direct message space between the specified user and the authenticated user.\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 the authorization scope:\n\n - `https://www.googleapis.com/auth/chat.bot`\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.spaces.readonly`\n - `https://www.googleapis.com/auth/chat.spaces`\n\n### HTTP request\n\n`GET https://chat.googleapis.com/v1/spaces:findDirectMessage`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` Required. Resource name of the user to find direct message with. Format: `users/{user}`, where `{user}` is either the `id` for the [person](https://developers.google.com/people/api/rest/v1/people) from the People API, or the `id` for the [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Directory API. For example, if the People API profile ID is `123456789`, you can find a direct message with that person by using `users/123456789` as the `name`. When [authenticated as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), you can use the email as an alias for `{user}`. For example, `users/example@gmail.com` where `example@gmail.com` is the email of the Google Chat user. |\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 [Space](/workspace/chat/api/reference/rest/v1/spaces#Space).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/chat.spaces`\n- `https://www.googleapis.com/auth/chat.spaces.readonly`\n- `https://www.googleapis.com/auth/chat.bot`\n\nFor more information, see the [Authorization guide](/workspace/chat/authenticate-authorize)."]]