Method: orgunits.list
Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
Получает список всех организационных подразделений учетной записи.
HTTP-запрос
GET https://admin.googleapis.com/admin/directory/v1/customer/{customerId}/orgunits
URL-адрес использует синтаксис транскодирования gRPC .
Параметры пути
Параметры |
---|
customerId | string Уникальный идентификатор аккаунта Google Workspace клиента. Как администратор учетной записи вы также можете использовать псевдоним my_customer для представления customerId вашей учетной записи. customerId также возвращается как часть ресурса Users . |
Параметры запроса
Параметры |
---|
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
Дополнительную информацию см. в руководстве по авторизации .
Тип
Перечисления |
---|
ALL | Все суборганизационные подразделения. |
CHILDREN | Только непосредственные дети (по умолчанию). |
ALL_INCLUDING_PARENT | Все дочерние подразделения и указанное организационное подразделение (корневое, если не указано). |
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-07-25 UTC.
[null,null,["Последнее обновление: 2025-07-25 UTC."],[],[],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). |"]]