একটি ব্যবহারকারীর স্থান বিজ্ঞপ্তি সেটিংস আপডেট করুন, একটি ব্যবহারকারীর স্থান বিজ্ঞপ্তি সেটিংস আপডেট করুন, একটি ব্যবহারকারীর স্থান বিজ্ঞপ্তি সেটিংস আপডেট করুন, একটি ব্যবহারকারীর স্থান বিজ্ঞপ্তি সেটিংস আপডেট করুন
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
এই নির্দেশিকা ব্যাখ্যা করে যে কীভাবে একজন ব্যবহারকারীর স্পেস বিজ্ঞপ্তি সেটিংস আপডেট করতে Google Chat API-এর SpaceNotificationSetting রিসোর্সে patch() পদ্ধতি ব্যবহার করতে হয়।
SpaceNotificationSetting রিসোর্স হল একটি সিঙ্গলটন রিসোর্স যা একটি নির্দিষ্ট ব্যবহারকারীর স্পেস বিজ্ঞপ্তি সেটিংস সম্পর্কে বিশদ বিবরণ উপস্থাপন করে।
একটি ডেস্কটপ অ্যাপ্লিকেশনের জন্য OAuth ক্লায়েন্ট আইডি শংসাপত্র তৈরি করুন । এই গাইডে নমুনা চালানোর জন্য, আপনার স্থানীয় ডিরেক্টরিতে credentials.json নামে একটি JSON ফাইল হিসাবে শংসাপত্রগুলি সংরক্ষণ করুন৷
নির্দেশনার জন্য, এই কুইকস্টার্টে আপনার পরিবেশ সেট আপ করার পদক্ষেপগুলি সম্পূর্ণ করুন৷
chat.users.spacesettings অনুমোদনের সুযোগ নির্দিষ্ট করুন।
UpdateSpaceNotificationSetting() পদ্ধতিতে কল করুন, বিজ্ঞপ্তি সেটিংসে পরিবর্তনগুলি ধারণ করার জন্য UpdateSpaceNotificationSetting অনুরোধ পাস করুন৷ অনুরোধ অন্তর্ভুক্ত:
নিম্নলিখিত বৈশিষ্ট্য সহ spaceNotificationSetting :
name বৈশিষ্ট্যটি নির্দিষ্ট করে যে কোন স্পেস বিজ্ঞপ্তি সেটিংস আপডেট করতে হবে যার মধ্যে একটি ব্যবহারকারী আইডি বা উপনাম এবং একটি স্পেস আইডি অন্তর্ভুক্ত রয়েছে৷ স্পেস বিজ্ঞপ্তি সেটিংস আপডেট করা শুধুমাত্র কলিং ব্যবহারকারীর বিজ্ঞপ্তি সেটিংস আপডেট করা সমর্থন করে, যা নিম্নলিখিতগুলির একটি সেট করে নির্দিষ্ট করা যেতে পারে:
me উপনাম. উদাহরণস্বরূপ, users/me/spaces/ SPACE /spaceNotificationSetting .
কলিং ব্যবহারকারীর ওয়ার্কস্পেস ইমেল ঠিকানা। উদাহরণস্বরূপ, users/user@example.com/spaces/ SPACE /spaceNotificationSetting ।
কলিং ব্যবহারকারীর ব্যবহারকারী আইডি। উদাহরণস্বরূপ, users/ USER /spaces/ SPACE /spaceNotificationSetting সেটিং।
notificationSetting সেটিং : বিজ্ঞপ্তি স্তর সেট করে, যেমন ALL , OFF ।
muteSetting : মিউট চালু বা বন্ধ সেট করে, মানগুলি MUTED বা UNMUTED যেতে পারে।
updateMask : আপডেট ক্ষেত্র সেট করে, এতে notification_setting , mute_setting অন্তর্ভুক্ত থাকতে পারে।
নিম্নলিখিত উদাহরণটি কলিং ব্যবহারকারীর স্থান বিজ্ঞপ্তি সেটিং আপডেট করে:
import{createClientWithUserCredentials}from'./authentication-utils.js';constUSER_AUTH_OAUTH_SCOPES=['https://www.googleapis.com/auth/chat.users.spacesettings'];// This sample shows how to update the space notification setting for the calling userasyncfunctionmain(){// Create a clientconstchatClient=awaitcreateClientWithUserCredentials(USER_AUTH_OAUTH_SCOPES);// Initialize request argument(s), replace the SPACE_NAME with an actual space name.constrequest={spaceNotificationSetting:{name:'users/me/spaces/SPACE_NAME/spaceNotificationSetting',notificationSetting:'ALL',muteSetting:'UNMUTED'},updateMask:{paths:['notification_setting','mute_setting']}};// Make the requestconstresponse=awaitchatClient.updateSpaceNotificationSetting(request);// Handle the responseconsole.log(response);}main().catch(console.error);
এই নমুনাটি চালানোর জন্য, স্পেস এর name আইডি দিয়ে SPACE_NAME প্রতিস্থাপন করুন। আপনি ListSpaces() পদ্ধতিতে কল করে বা স্পেস এর URL থেকে আইডি পেতে পারেন।
Google Chat API নির্দিষ্ট স্থান বিজ্ঞপ্তি সেটিংস আপডেট করে এবং SpaceNotificationSetting এর একটি উদাহরণ প্রদান করে।
[null,null,["2025-08-04 UTC-তে শেষবার আপডেট করা হয়েছে।"],[],[],null,["# Update a user's space notification settings\n\nThis guide explains how to use the\n[`patch()`](/workspace/chat/api/reference/rpc/google.chat.v1#google.chat.v1.ChatService.UpdateSpaceNotificationSetting)\nmethod on the `SpaceNotificationSetting` resource of the Google Chat API to update\na user's space notification settings.\n\nThe\n[`SpaceNotificationSetting` resource](/workspace/chat/api/reference/rpc/google.chat.v1#google.chat.v1.SpaceNotificationSetting)\nis a singleton resource that represents details about a specified user's space\nnotification settings.\n\nPrerequisites\n-------------\n\n\n### Node.js\n\n- A Business or Enterprise [Google Workspace](https://support.google.com/a/answer/6043576) account with access to [Google Chat](https://workspace.google.com/products/chat/).\n\n\u003c!-- --\u003e\n\n- Set up your environment:\n - [Create a Google Cloud project](/workspace/guides/create-project).\n - [Configure the OAuth consent screen](/workspace/guides/configure-oauth-consent).\n - [Enable and configure the Google Chat API](/workspace/chat/configure-chat-api) with a name, icon, and description for your Chat app.\n - Install the Node.js [Cloud Client Library](/workspace/chat/libraries?tab=nodejs#cloud-client-libraries).\n - [Create OAuth client ID credentials](/workspace/chat/authenticate-authorize-chat-user#step-2:) for a desktop application. To run the sample in this guide, save the credentials as a JSON file named `credentials.json` to your local directory.\n\n For guidance, complete the steps for setting up your environment in this [quickstart](/workspace/chat/api/guides/quickstart/nodejs\n #set-up-environment).\n- [Choose an authorization scope](/workspace/chat/authenticate-authorize#asynchronous-chat-calls) that supports user authentication.\n\n\n| The code samples in this page use the gRPC API interface with the Google Cloud client libraries. Alternatively, you can use the REST API interface. For more information about the gRPC and REST interfaces, see [Google Chat API overview](/workspace/chat/api/reference).\n\n\u003cbr /\u003e\n\nUpdate the calling user's space notification settings\n-----------------------------------------------------\n\nTo update a user's space notification setting, include the following\nin your request:\n\n- Specify the `chat.users.spacesettings` authorization scope.\n- Call the [`UpdateSpaceNotificationSetting()`](/workspace/chat/api/reference/rpc/google.chat.v1#google.chat.v1.ChatService.UpdateSpaceNotificationSetting) method, passing `UpdateSpaceNotificationSetting` request to contain the changes to the notification settings. The request includes:\n - `spaceNotificationSetting` with the following properties:\n - The `name` property specifies which space notification settings to update which includes a user ID or alias and a space ID. Updating space notification settings only supports updating the notification settings of the calling user, which can be specified by setting one of the following:\n - The `me` alias. For example, `users/me/spaces/`\u003cvar translate=\"no\"\u003eSPACE\u003c/var\u003e`/spaceNotificationSetting`.\n - The calling user's Workspace email address. For example, `users/user@example.com/spaces/`\u003cvar translate=\"no\"\u003eSPACE\u003c/var\u003e`/spaceNotificationSetting`.\n - The calling user's user ID. For example, `users/`\u003cvar translate=\"no\"\u003eUSER\u003c/var\u003e`/spaces/`\u003cvar translate=\"no\"\u003eSPACE\u003c/var\u003e`/spaceNotificationSetting`.\n - The `notificationSetting`: sets the notification level, such as `ALL`, `OFF`.\n - The `muteSetting`: sets the mute on or off, values can be `MUTED` or `UNMUTED`.\n - `updateMask`: sets the update fields, it can include `notification_setting`, `mute_setting`.\n\nThe following example updates the calling user's space notification setting: \n\n### Node.js\n\nchat/client-libraries/cloud/update-space-notification-setting-user-cred.js \n[View on GitHub](https://github.com/googleworkspace/node-samples/blob/main/chat/client-libraries/cloud/update-space-notification-setting-user-cred.js) \n\n```javascript\nimport {createClientWithUserCredentials} from './authentication-utils.js';\n\nconst USER_AUTH_OAUTH_SCOPES = ['https://www.googleapis.com/auth/chat.users.spacesettings'];\n\n// This sample shows how to update the space notification setting for the calling user\nasync function main() {\n // Create a client\n const chatClient = await createClientWithUserCredentials(USER_AUTH_OAUTH_SCOPES);\n\n // Initialize request argument(s), replace the SPACE_NAME with an actual space name.\n const request = {\n spaceNotificationSetting : {\n \tname : 'users/me/spaces/SPACE_NAME/spaceNotificationSetting',\n \tnotificationSetting : 'ALL',\n \tmuteSetting : 'UNMUTED'\n },\n updateMask : { paths: ['notification_setting','mute_setting']}\n };\n\n // Make the request\n const response = await chatClient.updateSpaceNotificationSetting(request);\n\n // Handle the response\n console.log(response);\n}\n\nmain().catch(console.error);\n```\n\nTo run this sample, replace \u003cvar translate=\"no\"\u003eSPACE_NAME\u003c/var\u003e with the ID from\nthe space's\n[`name`](/workspace/chat/api/reference/rpc/google.chat.v1#google.chat.v1.Space.FIELDS.string.google.chat.v1.Space.name).\nYou can obtain the ID by calling the\n[`ListSpaces()`](/workspace/chat/api/reference/rpc/google.chat.v1#google.chat.v1.ChatService.ListSpaces)\nmethod or from the space's URL.\n\nThe Google Chat API updates the specified space notification settings and returns\nan instance of\n[`SpaceNotificationSetting`](/workspace/chat/api/reference/rpc/google.chat.v1#google.chat.v1.SpaceNotificationSetting).\n\nRelated topics\n--------------\n\n- [Get the calling user's space notification setting](/workspace/chat/get-space-notification-setting)."]]