Method: orgunits.list

擷取帳戶中所有機構單位的清單。

HTTP 要求

GET https://admin.googleapis.com/admin/directory/v1/customer/{customerId}/orgunits

這個網址使用 gRPC 轉碼語法。

路徑參數

參數
customerId

string

客戶 Google Workspace 帳戶的專屬 ID。帳戶管理員也可以使用 my_customer 別名來代表帳戶的customerIdcustomerId 也會做為使用者資源的一部分傳回。

查詢參數

參數
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 所有子機構單位和指定的機構單位 (如未指定根機構單位)。