public class Department extends Object
| 构造器和说明 |
|---|
Department(Config config) |
public Department(Config config)
public BatchDepartmentResp batch(BatchDepartmentReq req, RequestOptions reqOptions) throws Exception
Exceptionpublic BatchDepartmentResp batch(BatchDepartmentReq req) throws Exception
Exceptionpublic ChildrenDepartmentResp children(ChildrenDepartmentReq req, RequestOptions reqOptions) throws Exception
Exceptionpublic ChildrenDepartmentResp children(ChildrenDepartmentReq req) throws Exception
Exceptionpublic CreateDepartmentResp create(CreateDepartmentReq req, RequestOptions reqOptions) throws Exception
Exceptionpublic CreateDepartmentResp create(CreateDepartmentReq req) throws Exception
Exceptionpublic DeleteDepartmentResp delete(DeleteDepartmentReq req, RequestOptions reqOptions) throws Exception
Exceptionpublic DeleteDepartmentResp delete(DeleteDepartmentReq req) throws Exception
Exceptionpublic GetDepartmentResp get(GetDepartmentReq req, RequestOptions reqOptions) throws Exception
Exceptionpublic GetDepartmentResp get(GetDepartmentReq req) throws Exception
Exceptionpublic ListDepartmentResp list(ListDepartmentReq req, RequestOptions reqOptions) throws Exception
本接口为历史版本接口,不再维护。推荐接口:;;-
查询指定部门的详细信息,可调用[获取单个部门信息](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/get)、[批量获取部门信息](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/batch)。;-
查询当前部门下子部门信息,可调用[获取子部门列表](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/children)。;-
查询当前部门的父部门信息,可调用[获取父部门信息](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/parent)。;-
通过关键词搜索部门,可调用[搜索部门](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/search)。;;-
使用 user_access_token
时,返回该用户组织架构可见性范围([登陆企业管理后台进行权限配置](https://www.feishu.cn/admin/security/permission/visibility))内的所有可见部门。当进行递归查询时,只筛查最多1000个部门的可见性。;;-
使用 ; tenant_access_token 则基于应用的通讯录权限范围进行权限校验与过滤。由于 ; parent_department_id
是非必填参数,填与不填存在两种数据权限校验与返回情况:;
1、请求设置了 ; parent_department_id 为A(根部门0),会检验A是否在通讯录权限内,若在( parent_department_id=0
时会校验是否为全员权限),则返回部门下子部门列表(根据fetch_child决定是否递归),否则返回无部门通讯录权限错误码。;
2、请求未带 ; parent_department_id 参数,如通讯录范围为全员权限,只返回根部门ID(部门ID为0),否则返回根据通讯录范围配置的部门ID及子部门(根据 ;
fetch_child 决定是否递归)。 ;
Exceptionpublic ListDepartmentResp list(ListDepartmentReq req) throws Exception
本接口为历史版本接口,不再维护。推荐接口:;;-
查询指定部门的详细信息,可调用[获取单个部门信息](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/get)、[批量获取部门信息](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/batch)。;-
查询当前部门下子部门信息,可调用[获取子部门列表](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/children)。;-
查询当前部门的父部门信息,可调用[获取父部门信息](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/parent)。;-
通过关键词搜索部门,可调用[搜索部门](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/search)。;;-
使用 user_access_token
时,返回该用户组织架构可见性范围([登陆企业管理后台进行权限配置](https://www.feishu.cn/admin/security/permission/visibility))内的所有可见部门。当进行递归查询时,只筛查最多1000个部门的可见性。;;-
使用 ; tenant_access_token 则基于应用的通讯录权限范围进行权限校验与过滤。由于 ; parent_department_id
是非必填参数,填与不填存在两种数据权限校验与返回情况:;
1、请求设置了 ; parent_department_id 为A(根部门0),会检验A是否在通讯录权限内,若在( parent_department_id=0
时会校验是否为全员权限),则返回部门下子部门列表(根据fetch_child决定是否递归),否则返回无部门通讯录权限错误码。;
2、请求未带 ; parent_department_id 参数,如通讯录范围为全员权限,只返回根部门ID(部门ID为0),否则返回根据通讯录范围配置的部门ID及子部门(根据 ;
fetch_child 决定是否递归)。 ;
Exceptionpublic ParentDepartmentResp parent(ParentDepartmentReq req, RequestOptions reqOptions) throws Exception
Exceptionpublic ParentDepartmentResp parent(ParentDepartmentReq req) throws Exception
Exceptionpublic PatchDepartmentResp patch(PatchDepartmentReq req, RequestOptions reqOptions) throws Exception
Exceptionpublic PatchDepartmentResp patch(PatchDepartmentReq req) throws Exception
Exceptionpublic SearchDepartmentResp search(SearchDepartmentReq req, RequestOptions reqOptions) throws Exception
Exceptionpublic SearchDepartmentResp search(SearchDepartmentReq req) throws Exception
Exceptionpublic UnbindDepartmentChatDepartmentResp unbindDepartmentChat(UnbindDepartmentChatDepartmentReq req, RequestOptions reqOptions) throws Exception
## 注意事项;;应用的通讯录权限范围内需要包含当前操作的部门。了解权限范围,参见[权限范围资源介绍](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 ;
Exceptionpublic UnbindDepartmentChatDepartmentResp unbindDepartmentChat(UnbindDepartmentChatDepartmentReq req) throws Exception
## 注意事项;;应用的通讯录权限范围内需要包含当前操作的部门。了解权限范围,参见[权限范围资源介绍](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority)。 ;
Exceptionpublic UpdateDepartmentResp update(UpdateDepartmentReq req, RequestOptions reqOptions) throws Exception
Exceptionpublic UpdateDepartmentResp update(UpdateDepartmentReq req) throws Exception
Exceptionpublic UpdateDepartmentIdDepartmentResp updateDepartmentId(UpdateDepartmentIdDepartmentReq req, RequestOptions reqOptions) throws Exception
Exceptionpublic UpdateDepartmentIdDepartmentResp updateDepartmentId(UpdateDepartmentIdDepartmentReq req) throws Exception
ExceptionCopyright © 2026. All rights reserved.