Method: orgunits.list
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
فهرستی از تمام واحدهای سازمانی را برای یک حساب بازیابی می کند.
درخواست HTTP
GET https://admin.googleapis.com/admin/directory/v1/customer/{customerId}/orgunits
URL از دستور GRPC Transcoding استفاده می کند.
پارامترهای مسیر
پارامترها |
---|
customerId | string شناسه منحصر به فرد برای حساب Google Workspace مشتری. بهعنوان مدیر حساب، میتوانید از نام مستعار my_customer نیز برای نشان دادن customerId حساب خود استفاده کنید. customerId نیز به عنوان بخشی از منبع کاربران بازگردانده می شود. |
پارامترهای پرس و جو
پارامترها |
---|
orgUnitPath | string مسیر کامل واحد سازمانی یا شناسه منحصر به فرد آن. فرزندان واحد سازمانی مشخص شده را برمی گرداند. |
type | enum ( Type ) آیا برای بازگشت همه سازمان های فرعی یا فقط فرزندان فوری. |
درخواست بدن
بدنه درخواست باید خالی باشد.
بدن پاسخگو
در صورت موفقیت آمیز بودن، بدنه پاسخ حاوی داده هایی با ساختار زیر است:
نمایندگی JSON |
---|
{
"kind": string,
"etag": string,
"organizationUnits": [
{
object (OrgUnit )
}
]
} |
فیلدها |
---|
kind | string نوع منبع API. برای منابع واحد سازمان، نوع admin#directory#orgUnits است. |
etag | string ETag منبع |
organizationUnits[] | object ( OrgUnit ) فهرستی از اشیاء واحد سازمانی. |
محدوده مجوز
به یکی از حوزه های OAuth زیر نیاز دارد:
-
https://apps-apis.google.com/a/feeds/policies/
-
https://www.googleapis.com/auth/admin.directory.orgunit
-
https://www.googleapis.com/auth/admin.directory.orgunit.readonly
برای اطلاعات بیشتر، به راهنمای مجوز مراجعه کنید.
تایپ کنید
Enums |
---|
ALL | کلیه واحدهای زیر سازمانی |
CHILDREN | فقط کودکان فوری (پیشفرض). |
ALL_INCLUDING_PARENT | کلیه واحدهای زیر سازمانی و واحد سازمانی مشخص شده (در صورت عدم تعیین ریشه). |
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# Method: orgunits.list\n\nRetrieves a list of all organizational units for an account.\n\n### HTTP request\n\n`GET https://admin.googleapis.com/admin/directory/v1/customer/{customerId}/orgunits`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `customerId` | `string` The unique ID for the customer's Google Workspace account. As an account administrator, you can also use the `my_customer` alias to represent your account's `customerId`. The `customerId` is also returned as part of the [Users resource](https://developers.google.com/workspace/admin/directory/v1/reference/users). |\n\n### Query parameters\n\n| Parameters ||\n|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `orgUnitPath` | `string` The full path to the organizational unit or its unique ID. Returns the children of the specified organizational unit. |\n| `type` | `enum (`[Type](/workspace/admin/directory/reference/rest/v1/orgunits/list#Type)`)` Whether to return all sub-organizations or just immediate children. |\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, \"organizationUnits\": [ { object (/workspace/admin/directory/reference/rest/v1/orgunits#OrgUnit) } ] } ``` |\n\n| Fields ||\n|-----------------------|------------------------------------------------------------------------------------------------------------------------------|\n| `kind` | `string` The type of the API resource. For Org Unit resources, the type is `admin#directory#orgUnits`. |\n| `etag` | `string` ETag of the resource. |\n| `organizationUnits[]` | `object (`[OrgUnit](/workspace/admin/directory/reference/rest/v1/orgunits#OrgUnit)`)` A list of organizational unit objects. |\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://apps-apis.google.com/a/feeds/policies/`\n- `\n https://www.googleapis.com/auth/admin.directory.orgunit`\n- `\n https://www.googleapis.com/auth/admin.directory.orgunit.readonly`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent).\n\nType\n----\n\n| Enums ||\n|------------------------|---------------------------------------------------------------------------------------------|\n| `ALL` | All sub-organizational units. |\n| `CHILDREN` | Immediate children only (default). |\n| `ALL_INCLUDING_PARENT` | All sub-organizational units and the specified organizational unit (root if not specified). |"]]