You need to enable JavaScript to run this app.
文档中心
ArkClaw 企业版

ArkClaw 企业版

复制全文
下载 pdf
UserManagement
GetDepartmentTree - 获取部门树详情
复制全文
下载 pdf
GetDepartmentTree - 获取部门树详情
获取部门树详情。
请求参数
下方仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数
Action string 必选 示例值:GetDepartmentTree
要执行的操作,取值:GetDepartmentTree。
Version string 必选 示例值:2026-05-01
API的版本,取值:2026-05-01。
SpaceId string 必选 示例值:csi-yei8347ta8xmf5qd****
部门所属空间 ID。
RootDepartmentId string 必选 示例值:root
根部门 ID。用于指定树结构的起始节点:
  • root:表示从顶层开始,获取全量部门树。
  • 传指定部门 ID:获取以该部门为根节点的子树(包含该部门及其所有下属部门)。
Filter.Name string 可选 示例值:Frontend
通过部门名称查询。
Filter.ExternalId string 可选 示例值:ext-123456
通过外部系统中的部门唯一标识 ID 查询,支持精准匹配。
Filter.NameMatchMode integer 可选 示例值:0
名称匹配模式,取值:
  • 0(默认):精确匹配。
  • 1:模糊匹配。
FilterResultMode integer 可选 示例值:0
过滤结果模式。取值:
  • 0(默认):仅返回匹配的部门节点。
  • 1:保留树结构,返回匹配的部门节点,以及从请求根部门(RootDepartmentId)到匹配节点之间的所有上级部门。
返回参数
下方仅列出本接口特有的返回参数。更多信息请参见返回结构
Roots object[] 示例值:--
根层节点列表。
Children object[] 示例值:--
子节点列表。
Department object 示例值:--
部门实体。
CreateTime string 示例值:2026-01-01T00:00:00Z
部门的创建时间,时间格式为 RFC3339 UTC。
DepartmentId string 示例值:2479e108-1a5c-4311-****
部门 ID。
Description string 示例值:负责平台前端研发
部门描述。
DirectChildrenCount integer 示例值:3
直属子部门数量。
DirectMemberCount integer 示例值:10
部门直属成员数(仅统计当前部门,不包含子部门)。
ExternalId string 示例值:ext-123456
外部系统中的部门唯一标识 ID。
MemberCount integer 示例值:42
部门成员总数(统计当前部门及其所有子部门的成员)。
Name string 示例值:Frontend
部门名称。
NamePath string 示例值:/Engineering/Frontend
部门名称路径,表示该部门在部门树中的层级位置(由各级部门名称拼接)。
ParentDepartmentId string 示例值:root
上级部门 ID,返回 "root" 表示根部门。
Path string 示例值:/root/fdeeba37-51e7-****/2479e108-1a5c-4311-****
部门 ID 路径,表示该部门在部门树中的层级位置(由各级部门 ID 拼接,包含 root)。
SpaceId string 示例值:csi-yei8347ta8xmf5qd****
部门所属空间 ID。
UpdateTime string 示例值:2026-01-01T00:00:00Z
部门的更新时间,时间格式为 RFC3339 UTC。
请求示例
GET /?Action=GetDepartmentTree&Version=2026-05-01&SpaceId=csi-yei8347ta8xmf5qd****&RootDepartmentId=root&Filter.Name=Frontend&Filter.ExternalId=ext-123456&Filter.NameMatchMode=0&FilterResultMode=0 HTTP/1.1
Host: https://arkclaw.cn-beijing.volcengineapi.com
X-Date: 20260902T104851Z
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20260902/cn-beijing/arkclaw/request, SignedHeaders=host;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f
返回示例
{
"ResponseMetadata": {
"RequestId": "202609021848552361521990****",
"Action": "GetDepartmentTree",
"Version": "2026-05-01",
"Service": "arkclaw",
"Region": "cn-beijing"
},
"Result": {
"Roots": [
{
"Children": [],
"Department": {
"CreateTime": "2026-01-01T00:00:00Z",
"DepartmentId": "2479e108-1a5c-4311-****",
"Description": "负责平台前端研发",
"DirectChildrenCount": 3,
"DirectMemberCount": 10,
"ExternalId": "ext-123456",
"MemberCount": 42,
"Name": "Frontend",
"NamePath": "/Engineering/Frontend",
"ParentDepartmentId": "root",
"Path": "/root/fdeeba37-51e7-****/2479e108-1a5c-4311-****",
"SpaceId": "csi-yei8347ta8xmf5qd****",
"UpdateTime": "2026-01-01T00:00:00Z"
}
}
]
}
}
错误码
下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。
状态码
错误码
错误信息
说明
400
MissingParameter.SpaceId
The required parameter SpaceId is not supplied.
参数SpaceId不能为空。
400
MissingParameter.RootDepartmentId
The required parameter RootDepartmentId is not supplied.
参数RootDepartmentId不能为空。
404
InvalidSpace.NotFound
The specified space does not exist.
指定的ClawSpace不存在。
404
InvalidResource.NotFound
The specified resource does not exist.
指定资源不存在。
500
ErrGetClawSpaceFailed
get claw space failed.
space获取失败。
500
InternalError
An internal error has occurred.
内部错误,请重试。如果多次尝试失败,请提交工单。
最近更新时间:2026.09.08 14:33:47
这个页面对您有帮助吗?
有用
有用
无用
无用