修改部门部分信息
PATCH
/open-apis/contact/v3/departments/{department_id}
自建应用
调用该接口需要具有该部门以及更新操作涉及的部门的通讯录权限。应用商店应用无权限调用此接口。
错误码
HTTP状态码 | 错误码 | 描述 | 排查建议 |
---|---|---|---|
400 | 43005 | duplicate order error | 部门的order必须唯一,请检查后重试。 |
400 | 40002 | process root dept error | 不能对根部门进行移除部门群处理 |
400 | 40003 | internal error | 内部错误,请提供 X-Request-Id向客服反馈。联系客服。 |
403 | 40004 | no dept authority error | 操作的部门需在通讯录权限范围中,了解更多 |
400 | 40008 | dept Info is null error | 部门的信息不能为空 |
403 | 40014 | no parent dept authority error | 没有父部门权限(组织架构可见范围权限)。 |
401 | 42008 | tenant id is invalid error | 请检查请求租户是否为合法租户。 |
400 | 43016 | leaders is repeat | 部门负责人重复 |
400 | 43017 | relate dept over limit | 关联部门超过限制 |
400 | 43018 | duplicate i18n name | 重复的i18n名字 |
400 | 43019 | exceed dept max level | 超过部门层级深度 |
400 | 43021 | department chat not exist | 部门群不存在 |
400 | 43022 | department name duplicate | 部门名重复 |
400 | 43023 | dept structure no permissione | 组织架构没有权限 |
400 | 43024 | dept structure tenant lock fail | 部门结构变动获取租户锁失败 |
400 | 43025 | top department leader unjoined | 用户未加入不能成为企业负责人 |
400 | 43026 | employee type is not valid | 请使用准确的雇员类型 |
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request PATCH 'https://open.feishu.cn/open-apis/contact/v3/departments/od-4e6ac4d14bcd5071a37a39de902c7141?user_id_type=open_id&department_id_type=open_department_id' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "DemoName",
"i18n_name": {
"zh_cn": "Demo名称",
"ja_jp": "デモ名",
"en_us": "Demo Name"
},
"parent_department_id": "D067",
"leader_user_id": "ou_7dab8a3d3cdcc9da365777c7ad535d62",
"order": "100",
"unit_ids": [
"custom_unit_id"
],
"create_group_chat": false,
"leaders": [
{
"leaderID": "ou_357368f98775f04bea02afc6b1d33478",
"leaderType": 1
}
],
}'
响应示例响应示例
{
"code": 0,
"msg": "success",
"data": {
"department": {
"name": "DemoName",
"i18n_name": {
"zh_cn": "Demo名称",
"ja_jp": "デモ名",
"en_us": "Demo Name"
},
"parent_department_id": "D067",
"department_id": "D096",
"open_department_id": "od-4e6ac4d14bcd5071a37a39de902c7141",
"leader_user_id": "ou_7dab8a3d3cdcc9da365777c7ad535d62",
"chat_id": "oc_5ad11d72b830411d72b836c20",
"order": "100",
"unit_ids": [
"custom_unit_id"
],
"member_count": 100,
"status": {
"is_deleted": false
}
}
}
}
请求参数
Path 参数
department_id
必需
示例值:
od-4e6ac4d14bcd5071a37a39de902c7141
Query 参数
user_id_type
必需
示例值:
open_id
department_id_type
必需
示例值:
open_department_id
Header 参数
Authorization
string
必需
默认值:
Bearer {{access_token}}
Content-Type
string
必需
默认值:
application/json; charset=utf-8
Body 参数application/json
返回响应
修改于 2023-01-12 05:54:03