Method: spaces.members.patch
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
सदस्यता को अपडेट करता है. उदाहरण के लिए, किसी स्पेस में उपयोगकर्ता की सदस्यता अपडेट करना देखें.
इन तरह के authentication के साथ काम करता है:
एडमिन की मंज़ूरी और अनुमति के दायरे के साथ ऐप्लिकेशन की पुष्टि करना:
https://www.googleapis.com/auth/chat.app.memberships
(सिर्फ़ उन स्पेस में जिन्हें ऐप्लिकेशन ने बनाया है)
उपयोगकर्ता की पुष्टि के लिए, अनुमति के इन स्कोप में से किसी एक का इस्तेमाल करें:
https://www.googleapis.com/auth/chat.memberships
https://www.googleapis.com/auth/chat.import
(सिर्फ़ इंपोर्ट मोड वाले स्पेस)
- उपयोगकर्ता की पुष्टि करने पर, एडमिन के अधिकारों को अनुमति मिलती है. ऐसा तब होता है, जब एडमिन खाता पुष्टि करता है,
useAdminAccess
true
होता है, और अनुमति के इस स्कोप का इस्तेमाल किया जाता है:
https://www.googleapis.com/auth/chat.admin.memberships
एचटीटीपी अनुरोध
PATCH https://chat.googleapis.com/v1/{membership.name=spaces/*/members/*}
यह यूआरएल, gRPC ट्रांसकोडिंग सिंटैक्स का इस्तेमाल करता है.
पाथ पैरामीटर
पैरामीटर |
membership.name |
string
आइडेंटिफ़ायर. सर्वर की ओर से असाइन की गई सदस्यता का संसाधन नाम. फ़ॉर्मैट: spaces/{space}/members/{member}
|
क्वेरी पैरामीटर
पैरामीटर |
updateMask |
string (FieldMask format)
ज़रूरी है. अपडेट करने के लिए फ़ील्ड पाथ. एक से ज़्यादा वैल्यू को कॉमा लगाकर अलग करें या सभी फ़ील्ड पाथ अपडेट करने के लिए, * का इस्तेमाल करें. फ़िलहाल, इन फ़ील्ड पाथ का इस्तेमाल किया जा सकता है:
|
useAdminAccess |
boolean
ज़रूरी नहीं. true होने पर, यह तरीका उपयोगकर्ता के Google Workspace एडमिन के अधिकारों का इस्तेमाल करके काम करता है. कॉल करने वाला व्यक्ति, Google Workspace एडमिन होना चाहिए. साथ ही, उसके पास चैट और स्पेस में होने वाली बातचीत को मैनेज करने का अधिकार होना चाहिए. इसके लिए, chat.admin.memberships OAuth 2.0 स्कोप की ज़रूरत होती है.
|
अनुरोध का मुख्य भाग
अनुरोध के मुख्य भाग में Membership
का उदाहरण है.
जवाब का मुख्य भाग
कामयाब रहने पर, जवाब के मुख्य हिस्से में Membership
का एक इंस्टेंस शामिल किया जाता है.
अनुमति के स्कोप
इसके लिए, इनमें से किसी एक OAuth स्कोप की ज़रूरत होती है:
https://www.googleapis.com/auth/chat.app.memberships
https://www.googleapis.com/auth/chat.admin.memberships
https://www.googleapis.com/auth/chat.import
https://www.googleapis.com/auth/chat.memberships
ज़्यादा जानकारी के लिए, अनुमति पाने से जुड़ी गाइड देखें.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-29 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-29 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eThis method updates a Google Chat membership, allowing you to modify aspects like user roles within a space.\u003c/p\u003e\n"],["\u003cp\u003eIt supports both app and user authentication, with an option for administrator privileges using \u003ccode\u003euseAdminAccess\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eRequires specifying fields to update with \u003ccode\u003eupdateMask\u003c/code\u003e and includes optional use of administrator privileges.\u003c/p\u003e\n"],["\u003cp\u003eYou need appropriate OAuth scopes such as \u003ccode\u003echat.app.memberships\u003c/code\u003e or \u003ccode\u003echat.admin.memberships\u003c/code\u003e for authorization.\u003c/p\u003e\n"]]],["This documentation details updating a membership via a `PATCH` HTTP request to `https://chat.googleapis.com/v1/{membership.name=spaces/*/members/*}`. Key actions include setting the `membership.name` path parameter and using the `updateMask` query parameter to specify fields for updating, such as `role`. Optionally, `useAdminAccess` can grant administrator privileges. The request body defines the new membership details, and the response body will contain updated membership information. Multiple authorization scopes are required.\n"],null,["# Method: spaces.members.patch\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\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\nUpdates a membership. For an example, see [Update a user's membership in a space](https://developers.google.com/workspace/chat/update-members).\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 [administrator approval](https://support.google.com/a?p=chat-app-auth) and the authorization scope:\n\n - `https://www.googleapis.com/auth/chat.app.memberships` (only in spaces the app created)\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.memberships`\n - `https://www.googleapis.com/auth/chat.import` (import mode spaces only)\n - User authentication grants administrator privileges when an administrator account authenticates, `useAdminAccess` is `true`, and the following authorization scope is used:\n - `https://www.googleapis.com/auth/chat.admin.memberships`\n\n### HTTP request\n\n`PATCH https://chat.googleapis.com/v1/{membership.name=spaces/*/members/*}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|-------------------|-------------------------------------------------------------------------------------------------------------------------|\n| `membership.name` | `string` Identifier. Resource name of the membership, assigned by the server. Format: `spaces/{space}/members/{member}` |\n\n### Query parameters\n\n| Parameters ||\n|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `updateMask` | `string (`[FieldMask](https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask)` format)` Required. The field paths to update. Separate multiple values with commas or use `*` to update all field paths. Currently supported field paths: - `role` |\n| `useAdminAccess` | `boolean` Optional. When `true`, the method runs using the user's Google Workspace administrator privileges. The calling user must be a Google Workspace administrator with the [manage chat and spaces conversations privilege](https://support.google.com/a/answer/13369245). Requires the `chat.admin.memberships` [OAuth 2.0 scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). |\n\n### Request body\n\nThe request body contains an instance of [Membership](/workspace/chat/api/reference/rest/v1/spaces.members#Membership).\n\n### Response body\n\nIf successful, the response body contains an instance of [Membership](/workspace/chat/api/reference/rest/v1/spaces.members#Membership).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/chat.app.memberships`\n- `https://www.googleapis.com/auth/chat.admin.memberships`\n- `https://www.googleapis.com/auth/chat.import`\n- `https://www.googleapis.com/auth/chat.memberships`\n\nFor more information, see the [Authorization guide](/workspace/chat/authenticate-authorize)."]]