Method: orgunits.list

检索某个帐号的所有组织部门的列表。

HTTP 请求

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

网址采用 gRPC 转码语法。

路径参数

参数
customerId

string

客户的 Google Workspace 帐号的唯一 ID。作为帐号管理员,您还可以使用 my_customer 别名来表示您帐号的 customerIdcustomerId 也会作为 Users 资源的一部分返回。

查询参数

参数
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 所有下级组织部门和指定的组织部门(如果未指定,则为根级组织部门)。