查询组织部门列表

通过 OpenAPI 查询组织部门列表。

适用版本

企业专属版、企业标准版

服务接入点

获取服务接入点,替换 API 请求语法中的 {domain}

授权信息

产品

资源

所需权限

组织管理

组织部门

只读

请求语法

GET https://{domain}/oapi/v1/platform/organizations/{organizationId}/departments

请求说明

企业标准版

查询组织部门列表

curl -X 'GET' \
  'https://openapi-rdc.aliyuncs.com/oapi/v1/platform/organizations/9a2b****5ef1/departments' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

查询某部门下的所有子部门列表

curl -X 'GET' \
  'https://openapi-rdc.aliyuncs.com/oapi/v1/platform/organizations/9a2b****5ef1/departments?parentId=99d1****71d4' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

企业专属版

查询组织部门列表

curl -X 'GET' \
  'https://test-domain-***.rdc.aliyuncs.com/oapi/v1/platform/organizations/9a2b****5ef1/departments' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

查询某部门下的所有子部门列表

curl -X 'GET' \
  'https://test-domain-***.rdc.aliyuncs.com/oapi/v1/platform/organizations/9a2b****5ef1/departments?parentId=99d1****71d4&page=1&perPage=100' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

请求头(Headers)

x-yunxiao-token string (必选)

个人访问令牌。您可参考个人访问令牌获取。

示例:pt-0fh3****0fbG_35af****0484。

请求参数

organizationId string (必选)

组织 ID。您可前往组织管理后台的基本信息页面获取组织ID(organizationId)

parentIdstring(可选)

父部门 ID。

page integer(可选)默认值为1

【仅专属版适用】当前页。

perPage integer(可选)默认为100

【仅专属版适用】每页数据条数,取值范围:[1,100]

返回参数

返回示例

[
    {
        "creatorId": "99d1****6124",
        "hasSub": true,
        "id": "99d1****6124",
        "name": "示例",
        "organizationId": "99d1****6124",
        "parentId": "99d1****6124"
    }
]

creatorId string

创建人 ID。

hasSub boolean

是否有子部门。

idstring

部门 ID。

name string

部门名称。

organizationIdstring

组织 ID。

parentIdstring

父部门 ID。

响应头

参数

描述

示例值

x-next-page

【仅专属版适用】下一页。

1

x-page

【仅专属版适用】当前页。

2

x-per-page

【仅专属版适用】每页数据条数。

1

x-prev-page

【仅专属版适用】上一页。

2

x-total

【仅专属版适用】总数据量。

1

x-total-pages

【仅专属版适用】总分页数。

10

错误码

访问错误码中心查看 API 相关错误码。