Google চ্যাট ব্যবহারকারীদের চিহ্নিত করুন এবং নির্দিষ্ট করুন
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
এই পৃষ্ঠাটি ব্যাখ্যা করে যে কীভাবে Google চ্যাট অ্যাপ চ্যাট ব্যবহারকারীদের সনাক্ত করতে বা নির্দিষ্ট করতে পারে।
নিম্নলিখিত যেকোন একটি করতে, একটি চ্যাট অ্যাপকে অবশ্যই একজন ব্যবহারকারীকে নির্দিষ্ট করতে হবে:
চ্যাট কীভাবে ব্যবহারকারীদের সনাক্ত করে
Google Chat API চ্যাট ব্যবহার করে এমন প্রতিটি ব্যক্তির জন্য একটি User
সম্পদ তৈরি করে। নিম্নলিখিত দুটি গুরুত্বপূর্ণ User
ক্ষেত্র:
-
name
হল রিসোর্সের জন্য রিসোর্স নাম, users/{user}
হিসাবে ফর্ম্যাট করা হয়েছে, যেখানে {user}
একটি অনন্য এবং স্থিতিশীল শনাক্তকারীকে উপস্থাপন করে। users/app
কলিং চ্যাট অ্যাপের উপনাম হিসাবে ব্যবহার করা যেতে পারে। -
type
হল ব্যবহারকারীর ধরন। এই টাইপ Chat কে বলে যে ব্যবহারকারী একজন চ্যাট অ্যাপ নাকি একজন ব্যক্তি। চ্যাট অ্যাপের জন্য, মান হল BOT
। মানুষের কাছে মান হল HUMAN
।
Google Chat API-এ একটি কলে একজন ব্যবহারকারীকে নির্দিষ্ট করুন
একজন ব্যবহারকারীকে নির্দিষ্ট করতে, {user}
মানের জন্য নিম্নলিখিত মানগুলি ব্যবহার করুন:
আপনার Google Workspace সংস্থার ব্যবহারকারীদের জন্য, নিম্নলিখিত পদ্ধতিগুলির মধ্যে একটি ব্যবহার করুন:
- চ্যাট এপিআই-এ
User
সম্পদের name
, যেমন users/123456789
। - People API-এ
Person
সম্পদের নামের জন্য {person_id}
, যেখানে resourceName
হল people/{person_id}
—উদাহরণস্বরূপ, চ্যাট API-এ users/123456789
জনগণের API-তে একই ব্যক্তিকে প্রতিনিধিত্ব করে people/123456789
। - ডাইরেক্টরি এপিআই-এ
User
রিসোর্সের id
—উদাহরণস্বরূপ, চ্যাট এপিআই-এ users/123456789
একই ব্যক্তিকে প্রতিনিধিত্ব করে যেমন users/123456789
ডিরেক্টরি API-তে।
একটি বাহ্যিক Google Workspace সংস্থার ব্যবহারকারী বা Google অ্যাকাউন্ট ব্যবহার করেন এমন ব্যবহারকারীর জন্য একটি ইমেল উপনাম ব্যবহার করুন—উদাহরণস্বরূপ, users/ EMAIL_USERNAME @ WORKSPACE_DOMAIN .com
বা users/ EMAIL_USERNAME @gmail.com
।
একটি ইন্টারঅ্যাকশন ইভেন্ট থেকে একজন ব্যবহারকারীকে শনাক্ত করুন
প্রতিবার একজন ব্যবহারকারী একটি চ্যাট অ্যাপের সাথে ইন্টারঅ্যাকশন করে, চ্যাট ইন্টারঅ্যাকশন এবং ব্যবহারকারী সম্পর্কে তথ্য সহ একটি ইন্টারঅ্যাকশন ইভেন্ট পাঠায়। উদাহরণস্বরূপ, যখন কোনও ব্যবহারকারী কোনও বার্তায় একটি চ্যাট অ্যাপ উল্লেখ করেন, তখন চ্যাট অ্যাপটি বার্তাটি কী বলে এবং কে এটি পাঠিয়েছে সেগুলি সহ মিথস্ক্রিয়া সম্পর্কে তথ্য পায়। চ্যাট রিসোর্স সম্পর্কে তথ্য পুনরুদ্ধার করার সময় চ্যাট অ্যাপগুলি ব্যবহারকারীদের উল্লেখ করে।
যে ব্যবহারকারী একটি চ্যাট অ্যাপের সাথে ইন্টারঅ্যাক্ট করেছেন তাকে সনাক্ত করতে, User
সম্পদে name
সম্পত্তির মান পান, যা আপনি Event.user.name
থেকে পেতে পারেন।
নিম্নলিখিত JSON উদাহরণটি একটি চ্যাট অ্যাপের সাথে ইন্টারঅ্যাকশনে ব্যবহারকারী পরিচয়ের প্রত্যাশিত ফর্ম্যাট দেখায়:
{
...,
"user": {
"name": "users/12345678901234567890",
"displayName": "Sasha",
"avatarUrl": "https://lh3.googleusercontent.com/.../photo.jpg",
"email": "sasha@example.com"
}
}
একটি বার্তা একটি নির্দিষ্ট ধরনের মিথস্ক্রিয়া। একটি চ্যাট অ্যাপে একটি বার্তা পাঠিয়েছেন এমন একজন ব্যবহারকারীকে শনাক্ত করতে, নিম্নলিখিতগুলির যেকোন একটি ব্যবহার করে User
সম্পদে name
সম্পত্তির মান পান:
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2024-12-17 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2024-12-17 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eGoogle Chat apps can identify users through a unique \u003ccode\u003eUser\u003c/code\u003e resource with a \u003ccode\u003ename\u003c/code\u003e and \u003ccode\u003etype\u003c/code\u003e field to distinguish between bots and humans.\u003c/p\u003e\n"],["\u003cp\u003eYou can specify a user in API calls using their resource name, Person resource ID, Directory API ID, or email alias depending on their location and account type.\u003c/p\u003e\n"],["\u003cp\u003eChat apps receive user information during interactions through the \u003ccode\u003eUser\u003c/code\u003e resource within the event data, allowing identification and actions based on user details.\u003c/p\u003e\n"],["\u003cp\u003eUser identification enables features like mentioning users in messages, adding them to spaces, managing memberships, sending private messages, and subscribing to events.\u003c/p\u003e\n"],["\u003cp\u003eResources such as the \u003ccode\u003eUser\u003c/code\u003e and \u003ccode\u003ePerson\u003c/code\u003e objects, along with API guides, are available for further understanding and implementing user management in Chat apps.\u003c/p\u003e\n"]]],["Google Chat apps specify users to perform actions like @-mentioning, adding users to spaces, finding direct messages, retrieving membership details, sending private messages, and subscribing for membership change events. Users are identified via a `User` resource, with a unique `name` (e.g., `users/123456789`) and `type` (`BOT` or `HUMAN`). External users are specified using email aliases. Interactions with the Chat app include the user's `name` in the `Event.user.name` property.\n"],null,["# Identify and specify Google Chat users\n\nThis page explains the ways Google Chat apps can identify or specify\nChat users.\n\nTo do any of the following, a Chat app\nmust specify a user:\n\n- Create a message that [@ mentions a user](/workspace/chat/format-messages#messages-@mention).\n- Invite or add a user to an [existing space](/workspace/chat/create-members), or add a user to a [new space](/workspace/chat/set-up-spaces).\n- [Find direct messages](/workspace/chat/find-direct-message-in-spaces) between the Chat app and a specified user, or between two users.\n- [Get a user's membership details in a space](/workspace/chat/get-members).\n- [Send a private message](/workspace/chat/private-messages) to a user.\n- [Subscribe to a user](/workspace/chat/events-overview) using the Google Workspace Events API to get events about their membership changes.\n\nHow Chat identifies users\n-------------------------\n\nThe Google Chat API generates a\n[`User` resource](/workspace/chat/api/reference/rest/v1/User)\nfor each person that uses Chat. The following are two important\n`User` fields:\n\n- `name` is the resource name for the resource, formatted as `users/{user}`, where `{user}` represents a unique and stable identifier. `users/app` can be used as an alias for the calling Chat app.\n- `type` is the type of user. This type tells Chat whether the user is a Chat app or a person. For Chat apps, the value is `BOT`. For people, the value is `HUMAN`.\n\nSpecify a user in a call to the Google Chat API\n-----------------------------------------------\n\nTo specify a user, use the following values for the `{user}` value:\n\n- For users in your Google Workspace organization, use one of the\n following approaches:\n\n - The `name` of the [`User` resource](/workspace/chat/api/reference/rest/v1/User) in the Chat API, such as `users/123456789`.\n - The `{person_id}` for the name of a [`Person` resource](/people/api/rest/v1/people) in the People API, where the `resourceName` is `people/{person_id}`---for example, `users/123456789` in the Chat API represents the same person as `people/123456789` in the People API.\n - The `id` for a `User` resource in the Directory API---for example, `users/123456789` in the Chat API represents the same person as `users/123456789` in the Directory API.\n- For a user in an external Google Workspace organization, or a user\n who uses a Google Account, use an email alias---for example,\n `users/`\u003cvar translate=\"no\"\u003eEMAIL_USERNAME\u003c/var\u003e`@`\u003cvar translate=\"no\"\u003eWORKSPACE_DOMAIN\u003c/var\u003e`.com`\n or `users/`\u003cvar translate=\"no\"\u003eEMAIL_USERNAME\u003c/var\u003e`@gmail.com`.\n\nIdentify a user from an interaction event\n-----------------------------------------\n\nEvery time a user interacts with a Chat app,\nChat sends an\n[interaction event](/workspace/chat/receive-respond-interactions) with information about the\ninteraction and the user. For example, when a\nuser mentions a Chat app in a message, the\nChat app receives information about the interaction,\nincluding what the message says, and who sent it. Chat apps\nreference users when retrieving information about Chat resources.\n\nTo identify the user who interacted with a Chat app,\nget the value of the `name` property on the\n[`User` resource](/workspace/chat/api/reference/rest/v1/User),\nwhich you can get from\n[`Event.user.name`](/workspace/chat/api/reference/rest/v1/Event).\n\nThe following JSON example shows the expected format of the user identity in an\ninteraction with a Chat app: \n\n {\n ...,\n \"user\": {\n \"name\": \"users/12345678901234567890\",\n \"displayName\": \"Sasha\",\n \"avatarUrl\": \"https://lh3.googleusercontent.com/.../photo.jpg\",\n \"email\": \"sasha@example.com\"\n }\n }\n\nA message is a specific type of interaction. To identify a user who sent\na message to a Chat app,\nget the value of the `name` property on the\n[`User` resource](/workspace/chat/api/reference/rest/v1/User), using either of the\nfollowing:\n\n- [`spaces.messages.sender.name`](/workspace/chat/api/reference/rest/v1/spaces.messages)\n- [`Event.user.name`](/workspace/chat/api/reference/rest/v1/Event)\n\nRelated topics\n--------------\n\n- [Add a user to a space](/workspace/chat/api/guides/v1/members/create-members).\n- [Manage members in a space](/workspace/chat/list-members).\n- [@ mention a user in a message](/workspace/chat/format-messages#messages-@mention)."]]