通过 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'
x-yunxiao-token string (必选)
个人访问令牌。您可参考个人访问令牌获取。
示例:pt-0fh30fbG_35af0484。
请求参数
organizationId
string
(必选)
组织 ID。您可前往组织管理后台的基本信息页面获取组织ID(organizationId) 。
parentIdstring(可选)
父部门 ID。
pageinteger(可选)默认值为1
【仅专属版适用】当前页。
perPageinteger(可选)默认为100
【仅专属版适用】每页数据条数,取值范围:[1,100]。
返回参数
[
{
"creatorId": "99d1****6124",
"hasSub": true,
"id": "99d1****6124",
"name": "示例",
"organizationId": "99d1****6124",
"parentId": "99d1****6124"
}
]
creatorId
string
创建人 ID。
hasSub
boolean
是否有子部门。
id
string
部门 ID。
name
string
部门名称。
organizationId
string
组织 ID。
parentId
string
父部门 ID。
响应头
| 参数 | 描述 | 示例值 |
|---|
| x-next-page | 【仅专属版适用】下一页。 | 1 |
| x-page | 【仅专属版适用】当前页。 | 2 |
| x-per-page | 【仅专属版适用】每页数据条数。 | 1 |
| x-prev-page | 【仅专属版适用】上一页。 | 2 |
| x-total | 【仅专属版适用】总数据量。 | 1 |
| x-total-pages | 【仅专属版适用】总分页数。 | 10 |
错误码
访问查看 API 相关错误码。