部门
全量同步部门
注意:慎用,全量同步将重置整个部门关系
鉴权方式
HAP 组织授权开放接口为每个组织提供一套独立的密钥信息(AppKey 和 SecretKey),组织可通过此密钥信息安全调用 HAP 平台开放的各类接口,包括人员组织管理、汇报关系管理、应用管理、流程待办等数据接口。
版本
请求地址
Body 参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
appKey | string | 是 | AppKey |
sign | string | 是 | 签名 |
timestamp | integer | 是 | 时间戳 |
projectId | string | 是 | HAP组织Id |
departments | object[] | 是 | 第三方部门列表 |
departments.corpDepartmentId | string | 是 | 第三方部门Id |
departments.name | string | 是 | 部门名称 |
departments.parentId | string | 否 | 父部门Id |
departments.order | integer | 否 | 排序 |
响应参数
200| 名称 | 类型 | 描述 |
|---|---|---|
code | integer | 状态码,1表示操作完成;非1表示操作异常,非1时data字段不存在 |
message | string | 状态描述 |
data | object[] | 部门关系列表 |
data.corpDepartmentId | string | 第三方部门Id |
data.projectId | string | HAP组织Id |
data.departmentId | string | HAP部门Id |
curl -X POST "https://example.com/v2/department/syncAllDepartments" \ -H "Content-Type: application/json" \ -d '{ "appKey": "string", "sign": "string", "timestamp": 0, "projectId": "string", "departments": [ { "corpDepartmentId": "string", "name": "string" } ] }'{ "code": 0, "message": "string", "data": [ { "corpDepartmentId": "string", "projectId": "string", "departmentId": "string" } ]}