Method: groups.list
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
همه گروه های یک دامنه یا کاربری که یک userKey داده شده (صفحه بندی شده) را بازیابی می کند.
درخواست HTTP
GET https://admin.googleapis.com/admin/directory/v1/groups
URL از دستور GRPC Transcoding استفاده می کند.
پارامترهای پرس و جو
پارامترها |
---|
customer | string شناسه منحصر به فرد برای حساب Google Workspace مشتری. در مورد حساب چند دامنه ای، برای واکشی همه گروه ها برای مشتری، به جای domain از این فیلد استفاده کنید. همچنین می توانید از نام مستعار my_customer برای نشان دادن customerId حساب خود استفاده کنید. customerId نیز به عنوان بخشی از منبع کاربران بازگردانده می شود. شما باید یا customer یا پارامتر domain ارائه دهید. |
domain | string نام دامنه. از این فیلد برای دریافت گروه تنها از یک دامنه استفاده کنید. برای بازگرداندن همه دامنه ها برای حساب مشتری، به جای آن از پارامتر query customer استفاده کنید. |
maxResults | integer حداکثر تعداد نتایج برای بازگشت. حداکثر مقدار مجاز 200 است. |
orderBy | enum ( OrderBy ) ستون مورد استفاده برای مرتب سازی نتایج |
pageToken | string رمزی برای تعیین صفحه بعدی در لیست |
query | string جستجوی رشته پرس و جو باید به شکل " ". اسناد کامل در https://developers.google.com/workspace/admin/directory/v1/guides/search-groups موجود است |
sortOrder | enum ( SortOrder ) اینکه نتایج را به ترتیب صعودی یا نزولی برگرداند. فقط زمانی استفاده می شود که orderBy نیز استفاده می شود |
userKey | string ایمیل یا شناسه غیرقابل تغییر کاربر در صورتی که فقط آن گروه ها فهرست شوند، کاربر معین عضو آن است. اگر یک شناسه است، باید با شناسه شی کاربر مطابقت داشته باشد. نمی توان با پارامتر customer استفاده کرد. |
درخواست بدن
بدنه درخواست باید خالی باشد.
بدن پاسخگو
در صورت موفقیت آمیز بودن، بدنه پاسخ حاوی داده هایی با ساختار زیر است:
نمایندگی JSON |
---|
{
"kind": string,
"etag": string,
"groups": [
{
object (Group )
}
],
"nextPageToken": string
} |
فیلدها |
---|
kind | string نوعی منبع این است. |
etag | string ETag منبع |
groups[] | object ( Group ) لیستی از اشیاء گروهی |
nextPageToken | string رمز برای دسترسی به صفحه بعدی این نتیجه استفاده می شود. |
محدوده مجوز
به یکی از حوزه های OAuth زیر نیاز دارد:
-
https://apps-apis.google.com/a/feeds/groups/
-
https://www.googleapis.com/auth/admin.directory.group
-
https://www.googleapis.com/auth/admin.directory.group.readonly
برای اطلاعات بیشتر، به راهنمای مجوز مراجعه کنید.
مرتب سازی
Enums |
---|
ASCENDING | ترتیب صعودی |
DESCENDING | ترتیب نزولی |
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# Method: groups.list\n\nRetrieves all groups of a domain or of a user given a userKey (paginated).\n\n### HTTP request\n\n`GET https://admin.googleapis.com/admin/directory/v1/groups`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `customer` | `string` The unique ID for the customer's Google Workspace account. In case of a multi-domain account, to fetch all groups for a customer, use this field instead of `domain`. You can also use the `my_customer` alias to represent your account's `customerId`. The `customerId` is also returned as part of the [Users](https://developers.google.com/workspace/admin/directory/v1/reference/users) resource. You must provide either the `customer` or the `domain` parameter. |\n| `domain` | `string` The domain name. Use this field to get groups from only one domain. To return all domains for a customer account, use the `customer` query parameter instead. |\n| `maxResults` | `integer` Maximum number of results to return. Max allowed value is 200. |\n| `orderBy` | `enum (`[OrderBy](/workspace/admin/directory/reference/rest/v1/groups/list#OrderBy)`)` Column to use for sorting results |\n| `pageToken` | `string` Token to specify next page in the list |\n| `query` | `string` Query string search. Should be of the form \"\". Complete documentation is at https: //developers.google.com/workspace/admin/directory/v1/guides/search-groups |\n| `sortOrder` | `enum (`[SortOrder](/workspace/admin/directory/reference/rest/v1/groups/list#SortOrder)`)` Whether to return results in ascending or descending order. Only of use when orderBy is also used |\n| `userKey` | `string` Email or immutable ID of the user if only those groups are to be listed, the given user is a member of. If it's an ID, it should match with the ID of the user object. Cannot be used with the `customer` parameter. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"kind\": string, \"etag\": string, \"groups\": [ { object (/workspace/admin/directory/reference/rest/v1/groups#Group) } ], \"nextPageToken\": string } ``` |\n\n| Fields ||\n|-----------------|----------------------------------------------------------------------------------------------------------|\n| `kind` | `string` Kind of resource this is. |\n| `etag` | `string` ETag of the resource. |\n| `groups[]` | `object (`[Group](/workspace/admin/directory/reference/rest/v1/groups#Group)`)` A list of group objects. |\n| `nextPageToken` | `string` Token used to access next page of this result. |\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://apps-apis.google.com/a/feeds/groups/`\n- `\n https://www.googleapis.com/auth/admin.directory.group`\n- `\n https://www.googleapis.com/auth/admin.directory.group.readonly`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent).\n\nOrderBy\n-------\n\n| Enums ||\n|---------|---------------------|\n| `EMAIL` | Email of the group. |\n\nSortOrder\n---------\n\n| Enums ||\n|--------------|-------------------|\n| `ASCENDING` | Ascending order. |\n| `DESCENDING` | Descending order. |"]]