Method: orgunits.list
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
アカウントのすべての組織部門のリストを取得します。
HTTP リクエスト
GET https://admin.googleapis.com/admin/directory/v1/customer/{customerId}/orgunits
この URL は gRPC Transcoding 構文を使用します。
パスパラメータ
パラメータ |
customerId |
string
お客様の Google Workspace アカウントの一意の ID。アカウント管理者は、アカウントの customerId を表す my_customer エイリアスを使用することもできます。customerId は、ユーザー リソースの一部としても返されます。
|
クエリ パラメータ
パラメータ |
orgUnitPath |
string
組織部門のフルパスまたは一意の ID です。指定された組織部門の子部門を返します。
|
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 |
すべてのサブ組織部門と、指定した組織部門(指定されていない場合はルート) |
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。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). |"]]