Method: groups.list
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
אחזור כל הקבוצות של דומיין או של משתמש לפי userKey (חלוקה לדפים).
בקשת HTTP
GET https://admin.googleapis.com/admin/directory/v1/groups
כתובת ה-URL משתמשת בתחביר של Transcoding של gRPC.
פרמטרים של שאילתה
פרמטרים |
customer |
string
המזהה הייחודי של חשבון Google Workspace של הלקוח. בחשבון עם כמה דומיינים, כדי לאחזר את כל הקבוצות של לקוח, משתמשים בשדה הזה במקום ב-domain . אפשר גם להשתמש בכתובת החלופית my_customer כדי לייצג את customerId של החשבון. הערך customerId מוחזר גם כחלק מהמשאב Users. חובה לספק את הפרמטר customer או את הפרמטר domain .
|
domain |
string
שם הדומיין. משתמשים בשדה הזה כדי לקבל קבוצות מדומיין אחד בלבד. כדי להציג את כל הדומיינים של חשבון לקוח, צריך להשתמש במקום זאת בפרמטר השאילתה 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
מידע נוסף זמין במדריך ההרשאות.
OrderBy
טיפוסים בני מנייה (enum) |
EMAIL |
כתובת האימייל של הקבוצה. |
SortOrder
טיפוסים בני מנייה (enum) |
ASCENDING |
סדר עולה. |
DESCENDING |
בסדר יורד. |
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-25 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-25 (שעון UTC)."],[],[],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. |"]]