Directory API: ग्रुप के सदस्य
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
किसी सदस्य को ग्रुप में जोड़ना
किसी सदस्य को ग्रुप में जोड़ने के लिए, यहां दिए गए POST
अनुरोध का इस्तेमाल करें. साथ ही, अनुरोधों को अनुमति दें में बताई गई अनुमति शामिल करें. ग्रुप का सदस्य कोई उपयोगकर्ता या कोई दूसरा ग्रुप हो सकता है. groupKey
, नए सदस्य का ग्रुप ईमेल पता या ग्रुप का यूनीक id
है. अनुरोध और रिस्पॉन्स प्रॉपर्टी के लिए, एपीआई का रेफ़रंस देखें:
POST https://admin.googleapis.com/admin/directory/v1/groups/groupKey/members
अगर किसी ग्रुप को किसी दूसरे ग्रुप के सदस्य के तौर पर जोड़ा जाता है, तो चाइल्ड ग्रुप के सदस्यों को पैरंट ग्रुप के सदस्यों के तौर पर दिखने में 10 मिनट लग सकते हैं. इसके अलावा, एपीआई ग्रुप की सदस्यताओं के साइकल के लिए गड़बड़ी का मैसेज दिखाता है. उदाहरण के लिए, अगर ग्रुप1, ग्रुप2 का सदस्य है, तो ग्रुप2, ग्रुप1 का सदस्य नहीं हो सकता.
JSON अनुरोध
यहां दिया गया JSON अनुरोध, अनुरोध बॉडी का एक सैंपल दिखाता है. इससे ग्रुप में किसी सदस्य को जोड़ा जा सकता है. सदस्य का ईमेल पता liz@example.com है और ग्रुप में उसकी भूमिका MEMBER
है. POST
अनुरोध में groupKey
के लिए NNNNN का इस्तेमाल किया गया है:
POST https://admin.googleapis.com/admin/directory/v1/groups/NNNNN/members
{
"email": "liz@example.com",
"role": "MEMBER"
}
ग्रुप के किसी सदस्य का role
:
OWNER
– इस भूमिका वाले व्यक्ति के पास ग्रुप में मैसेज भेजने, सदस्यों को जोड़ने या हटाने, सदस्यों की भूमिकाएं बदलने, ग्रुप की सेटिंग बदलने, और ग्रुप को मिटाने का विकल्प होता है. OWNER
, ग्रुप का सदस्य होना चाहिए.
MANAGER
– यह भूमिका सिर्फ़ तब उपलब्ध होती है, जब Admin console का इस्तेमाल करके Google Workspace चालू किया गया हो. मैनेजर की भूमिका वाले व्यक्ति के पास, ग्रुप के मालिक की भूमिका वाले व्यक्ति के पास मौजूद सभी अधिकार होते हैं. हालांकि, वह किसी सदस्य को ग्रुप का मालिक नहीं बना सकता और न ही ग्रुप को मिटा सकता है. किसी ग्रुप में, एक से ज़्यादा मालिक और मैनेजर हो सकते हैं.
MEMBER
– इस भूमिका वाले लोग, किसी ग्रुप की सदस्यता ले सकते हैं, बातचीत के संग्रह देख सकते हैं, और ग्रुप की सदस्यता की सूची देख सकते हैं. सदस्यों की भूमिकाओं के बारे में ज़्यादा जानकारी के लिए, एडमिन से जुड़े सहायता केंद्र पर जाएं.
JSON का रिस्पॉन्स
सही जवाब में एचटीटीपी 200 स्टेटस कोड और सदस्य की सदस्यता की जानकारी दिखती है. id
, सदस्य का यूनीक सदस्यता आईडी है:
{
"kind": "directory#member",
"id": "group member's unique ID",
"email": "liz@example.com",
"role": "MEMBER",
"type": "GROUP"
}
ग्रुप के किसी सदस्य का type
:
GROUP
– वह सदस्य किसी दूसरे ग्रुप का सदस्य है.
MEMBER
– सदस्य एक उपयोगकर्ता है
ग्रुप की सदस्यता अपडेट करना
ग्रुप की सदस्यता अपडेट करने के लिए, यहां दिए गए PUT
अनुरोध का इस्तेमाल करें. साथ ही, अनुरोधों को अनुमति दें में बताए गए अनुमति फ़ॉर्मैट का इस्तेमाल करें. groupKey
, ग्रुप का ईमेल पता या ग्रुप का यूनीक id
होता है. वहीं, memberKey
, उपयोगकर्ता या ग्रुप का मुख्य ईमेल पता, उपयोगकर्ता का दूसरा ईमेल पता या उपयोगकर्ता का यूनीक id
होता है. अनुरोध और रिस्पॉन्स प्रॉपर्टी के लिए, एपीआई का रेफ़रंस देखें:
PUT https://admin.googleapis.com/admin/directory/v1/groups/groupKey/members/memberKey
JSON अनुरोध
यहां दिए गए JSON अनुरोध में, अनुरोध बॉडी का एक सैंपल दिखाया गया है. इससे ग्रुप की सदस्यता की सेटिंग अपडेट होती है. सदस्य का ईमेल पता liz@example.com है और ग्रुप में उसकी भूमिका MEMBER
से बदलकर MANAGER
हो गई है. इस उदाहरण में, PUT
अनुरोध का groupKey
NNNNN है. सदस्य, मालिक, और मैनेजर की भूमिकाओं के बारे में जानकारी पाने के लिए, एडमिन से जुड़े सहायता केंद्र पर जाएं:
PUT https://admin.googleapis.com/admin/directory/v1/groups/NNNNN/members/liz@example.com
{
"email": "liz@example.com",
"role": "MANAGER"
}
JSON का रिस्पॉन्स
सही जवाब में, एचटीटीपी 200 स्टेटस कोड और सदस्यता की अपडेट की गई जानकारी दिखती है. id
, सदस्य का यूनीक सदस्यता आईडी है:
{
"kind": "directory#member",
"id": "group member's unique ID",
"email": "liz@example.com",
"role": "MANAGER",
"type": "GROUP"
}
ग्रुप के किसी सदस्य की जानकारी पाना
ग्रुप की सदस्यता वापस पाने के लिए, नीचे दिए गए GET
अनुरोध का इस्तेमाल करें. साथ ही, अनुरोधों को अनुमति दें में बताई गई अनुमति शामिल करें. groupKey
, ग्रुप का ईमेल पता या ग्रुप का यूनीक id
होता है. वहीं, memberKey
, उपयोगकर्ता या ग्रुप का मुख्य ईमेल पता, उपयोगकर्ता का दूसरा ईमेल पता या उपयोगकर्ता का यूनीक id
होता है. अनुरोध और रिस्पॉन्स प्रॉपर्टी के लिए, एपीआई का रेफ़रंस देखें:
GET https://admin.googleapis.com/admin/directory/v1/groups/groupKey/members/memberKey
JSON का रिस्पॉन्स
सही जवाब में एचटीटीपी 200 स्टेटस कोड और सदस्य की सदस्यता की जानकारी दिखती है. id
, सदस्य का यूनीक सदस्यता आईडी है:
{
"kind": "directory#member",
"id": "group member's unique ID",
"email": "liz@example.com",
"role": "MANAGER",
"type": "GROUP"
}
ग्रुप के सभी सदस्यों की जानकारी पाना
ग्रुप के सभी सदस्यों की जानकारी पाने के लिए, यहां दिए गए GET
अनुरोध का इस्तेमाल करें. साथ ही, अनुरोधों को अनुमति दें में बताई गई अनुमति शामिल करें. groupKey
, ग्रुप का ईमेल पता या ग्रुप का यूनीक id
होता है. roles
क्वेरी स्ट्रिंग एक फ़िल्टर है. इसकी मदद से, ग्रुप के सदस्यों को उनकी भूमिका के हिसाब से देखा जा सकता है. साथ ही, भूमिका के हिसाब से मिले कलेक्शन, roles
फ़िल्टर में दिए गए क्रम में दिखते हैं. हालांकि, roles
क्वेरी स्ट्रिंग का इस्तेमाल करना ज़रूरी नहीं है. अनुरोध और रिस्पॉन्स प्रॉपर्टी के लिए, एपीआई का रेफ़रंस देखें. इस उदाहरण में, आसानी से पढ़ने के लिए लाइन रिटर्न का इस्तेमाल किया गया है:
GET https://admin.googleapis.com/admin/directory/v1/groups/groupKey/members
?pageToken=pagination token
&roles=one or more of OWNER,MANAGER,MEMBER separated by a comma
&maxResults=maximum results per response page
सभी सदस्यों को उनके ईमेल पतों के वर्णमाला के क्रम में दिखाया जाता है. साथ ही, ज़्यादा सदस्यों के जवाबों के लिए, pageToken
क्वेरी स्ट्रिंग का इस्तेमाल करें. पेजेशन के मामले में, रिस्पॉन्स में nextPageToken
प्रॉपर्टी दिखती है. इसमें रिस्पॉन्स के नतीजों के अगले पेज का टोकन होता है. आपका अगला अनुरोध, इस टोकन का इस्तेमाल pageToken
क्वेरी स्ट्रिंग वैल्यू के तौर पर करता है.
JSON का रिस्पॉन्स
सही जवाब मिलने पर, एचटीटीपी 200 स्टेटस कोड और सदस्य की जानकारी वाली सूची दिखती है. id
, सदस्य का यूनीक सदस्यता आईडी है. इस जवाब में, ग्रुप के सदस्यों की फ़ॉलो-अप सूची के लिए nextPageToken
है:
{
"kind": "directory#members",
"members": [
{
"kind": "directory#member",
"id": "group member's unique ID",
"email": "liz@example.com",
"role": "MANAGER",
"type": "USER"
},
{
"kind": "directory#member",
"id": "group member's unique ID",
"email": "radhe@example.com",
"role": "MANAGER",
"type": "USER"
}
],
"nextPageToken": "NNNNN"
}
किसी ग्रुप की सदस्यता मिटाना
किसी सदस्य की सदस्यता को ग्रुप से मिटाने के लिए, नीचे दिए गए DELETE
अनुरोध का इस्तेमाल करें. साथ ही, अनुरोधों को अनुमति दें में बताए गए अनुमति फ़ॉर्मैट का इस्तेमाल करें. groupKey
, ग्रुप का यूनीक id
है और memberKey
, मिटाए गए उपयोगकर्ता या ग्रुप के सदस्य का मुख्य ईमेल पता या उपयोगकर्ता का यूनीक id
है. अनुरोध और रिस्पॉन्स प्रॉपर्टी के लिए, एपीआई का रेफ़रंस देखें.:
DELETE https://admin.googleapis.com/admin/directory/v1/groups/groupKey/members/memberKey
उदाहरण के लिए, यह DELETE
अनुरोध उस सदस्य को मिटा देता है जिसका groupKey
nnn है और जिसका memberKey
उपयोगकर्ता का मुख्य ईमेल पता, liz@example.com है:
DELETE https://admin.googleapis.com/admin/directory/v1/groups/nnnn/members/liz@example.com
अनुरोध पूरा होने पर, एचटीटीपी 200 स्टेटस कोड दिखता है.
किसी सदस्य को मिटाने पर:
- ग्रुप से हटाए गए सदस्यों को, ग्रुप के लिए भेजे गए ईमेल नहीं मिलेंगे.
- किसी सदस्य को ग्रुप से हटाने पर, उसका खाता नहीं मिटता.
- ग्रुप के मालिक को मिटाने के बाद भी, ग्रुप सामान्य रूप से काम करता रहेगा. एडमिन के तौर पर, आपके पास ग्रुप को मैनेज करने या ग्रुप के किसी अन्य सदस्य को मालिकाना हक असाइन करने का विकल्प होता है
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-08-29 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-08-29 (UTC) को अपडेट किया गया."],[],[],null,["# Directory API: Group Members\n\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| 1. [Add a member to a group](#create_member) 2. [Update a group membership](#update_member) 3. [Retrieve a group's member](#get_member) 4. [Retrieve all group members](#get_all_members) 5. [Delete membership in a group](#delete_member) |\n\nAdd a member to a group\n-----------------------\n\nTo add a member to a group, use the following `POST` request and include the authorization described in [Authorize requests](/workspace/admin/directory/v1/guides/authorizing). A group member can be a user or another group. The `groupKey` is the new member's group email address or the group's unique `id`. For the request and response properties, see the [API Reference](/workspace/admin/directory/v1/reference/members/insert): \n\n```\nPOST https://admin.googleapis.com/admin/directory/v1/groups/groupKey/members\n```\n\nIf you add a group as a member of another group, there may be a delay of up to 10 minutes before the child group's members appear as members of the parent group. In addtion, the API returns an error for cycles in group memberships. For example, if group1 is a member of group2, group2 cannot be a member of group1.\n\n### JSON request\n\nThe following JSON request shows a sample request body that creates a group member. The member's email address is liz@example.com and the member's role in the group is as a `MEMBER`. The `POST` request uses NNNNN for the `groupKey`: \n\n```\nPOST https://admin.googleapis.com/admin/directory/v1/groups/NNNNN/members\n``` \n\n```transact-sql\n{\n \"email\": \"liz@example.com\",\n \"role\": \"MEMBER\"\n}\n```\n\nA group member's `role` can be:\n\n- `OWNER` -- This role can change send messages to the group, add or remove members, change member roles, change group's settings, and delete the group. An `OWNER` must be a member of the group.\n- `MANAGER` -- This role is only available if the Google Workspace is enabled using the Admin console. A MANAGER role can do everything done by an OWNER role except make a member an OWNER or delete the group. A group can have multiple OWNER and MANAGER members.\n- `MEMBER` -- This role can subscribe to a group, view discussion archives, and view the group's membership list. For more information about member roles, see the [administration help center](http://support.google.com/a/bin/answer.py?answer=167094).\n\n\u003cbr /\u003e\n\n### JSON response\n\nA successful response returns an [HTTP 200 status code](http://wikipedia.org/wiki/List_of_HTTP_status_codes) and the member's membership information. The `id` is the member's unique membership ID: \n\n```carbon\n{\n \"kind\": \"directory#member\",\n \"id\": \"group member's unique ID\",\n \"email\": \"liz@example.com\",\n \"role\": \"MEMBER\",\n \"type\": \"GROUP\"\n }\n```\n\nA group member's `type` can be:\n\n- `GROUP` -- The member is another group.\n- `MEMBER` -- The member is a user\n\n\u003cbr /\u003e\n\nUpdate a group membership\n-------------------------\n\nTo update a group membership, use the following `PUT` request and include the authorization described in [Authorize requests](/workspace/admin/directory/v1/guides/authorizing). The `groupKey` is the group's email address or the group's unique `id`, and the `memberKey` is the user's or group's primary email address, a user's alias email address, or the user's unique `id`. For the request and response properties, see the [API Reference](/workspace/admin/directory/v1/reference/members/update): \n\n```\nPUT https://admin.googleapis.com/admin/directory/v1/groups/groupKey/members/memberKey\n```\n| **Note:** The API also supports the [patch semantics](/workspace/admin/directory/v1/guides/performance#patch).\n\n### JSON request\n\nThe following JSON request shows a sample request body that updates a group membership settings. The member's email address is liz@example.com and the member's role in the group is changed from a `MEMBER` to a `MANAGER`. The `PUT` request's `groupKey` in this example is NNNNN. For information about the MEMBER, OWNER and MANAGER roles, see the [administration help center](http://support.google.com/a/bin/answer.py?answer=167094): \n\n```\nPUT https://admin.googleapis.com/admin/directory/v1/groups/NNNNN/members/liz@example.com\n``` \n\n```transact-sql\n{\n \"email\": \"liz@example.com\",\n \"role\": \"MANAGER\"\n}\n```\n\n### JSON response\n\nA successful response returns an [HTTP 200 status code](http://wikipedia.org/wiki/List_of_HTTP_status_codes) and the updated membership information. The `id` is the member's unique membership ID: \n\n```carbon\n{\n \"kind\": \"directory#member\",\n \"id\": \"group member's unique ID\",\n \"email\": \"liz@example.com\",\n \"role\": \"MANAGER\",\n \"type\": \"GROUP\"\n }\n```\n\nRetrieve a group's member\n-------------------------\n\nTo retrieve a group membership, use the following `GET` request and include the authorization described in [Authorize requests](/workspace/admin/directory/v1/guides/authorizing). The `groupKey` is the group's email address or the group's unique `id`, and the `memberKey` is the user's or group's primary email address, a user's alias email address, or the user's unique `id`. For the request and response properties, see the [API Reference](/workspace/admin/directory/v1/reference/members/get): \n\n```\nGET https://admin.googleapis.com/admin/directory/v1/groups/groupKey/members/memberKey\n```\n\n### JSON response\n\nA successful response returns an [HTTP 200 status code](http://wikipedia.org/wiki/List_of_HTTP_status_codes) and the member's membership information. The `id` is the member's unique membership ID: \n\n```carbon\n{\n \"kind\": \"directory#member\",\n \"id\": \"group member's unique ID\",\n \"email\": \"liz@example.com\",\n \"role\": \"MANAGER\",\n \"type\": \"GROUP\"\n }\n```\n\nRetrieve all group members\n--------------------------\n\nTo retrieve all group members, use the following `GET` request and include the authorization described in [Authorize requests](/workspace/admin/directory/v1/guides/authorizing). The `groupKey` is the group's email address or the group's unique `id`. The optional `roles` query string is a filter allowing you to retrieve group members by role and the resulting role collections are in the order given in the `roles` filter. For the request and response properties, see the [API Reference](/workspace/admin/directory/v1/reference/members/list). For readability, this example uses line returns: \n\n```\nGET https://admin.googleapis.com/admin/directory/v1/groups/groupKey/members\n?pageToken=pagination token\n&roles=one or more of OWNER,MANAGER,MEMBER separated by a comma\n&maxResults=maximum results per response page\n```\n\nAll members are returned in the alphabetical order of the members' email addresses. And use the `pageToken` query string for responses with large number of members. In the case of pagination, the response returns the `nextPageToken` property which has a token for the next page of response results. Your next request uses this token as the `pageToken` query string value.\n\n### JSON response\n\nA successful response returns an [HTTP 200 status code](http://wikipedia.org/wiki/List_of_HTTP_status_codes) and the list of member information. The `id` is the member's unique membership ID. There is a `nextPageToken` for the follow-on list of group members in this response: \n\n```carbon\n{\n \"kind\": \"directory#members\",\n \"members\": [\n {\n \"kind\": \"directory#member\",\n \"id\": \"group member's unique ID\",\n \"email\": \"liz@example.com\",\n \"role\": \"MANAGER\",\n \"type\": \"USER\"\n },\n {\n \"kind\": \"directory#member\",\n \"id\": \"group member's unique ID\",\n \"email\": \"radhe@example.com\",\n \"role\": \"MANAGER\",\n \"type\": \"USER\"\n }\n ],\n \"nextPageToken\": \"NNNNN\"\n}\n```\n\nDelete membership in a group\n----------------------------\n\nTo delete a member's membership in a group, use the following `DELETE` request and include the authorization described in [Authorize requests](/workspace/admin/directory/v1/guides/authorizing). The `groupKey` is the group's unique `id`, and `memberKey` is the deleted user or group member's primary email address or the user's unique `id`. For the request and response properties, see the [API Reference](/workspace/admin/directory/v1/reference/members/delete).: \n\n```\nDELETE https://admin.googleapis.com/admin/directory/v1/groups/groupKey/members/memberKey\n```\nFor example, this `DELETE` request deletes the member whose `groupKey` is nnn and whose `memberKey` is the user's primary email address, liz@example.com: \n\n```\nDELETE https://admin.googleapis.com/admin/directory/v1/groups/nnnn/members/liz@example.com\n```\n\nA successful response returns an [HTTP 200 status code](http://wikipedia.org/wiki/List_of_HTTP_status_codes).\n\nWhen a member is deleted:\n\n- Members you remove no longer receive email addressed to the group.\n- Removing a member from a group does not delete the user's account.\n- If you delete the group owner, the group still works normally. As an administrator, you can manage the group or assign ownership to another group member\n\n\u003cbr /\u003e"]]