public class Department extends Object
Department(Config config)
BatchDepartmentResp
batch(BatchDepartmentReq req)
batch(BatchDepartmentReq req, RequestOptions reqOptions)
ChildrenDepartmentResp
children(ChildrenDepartmentReq req)
children(ChildrenDepartmentReq req, RequestOptions reqOptions)
CreateDepartmentResp
create(CreateDepartmentReq req)
create(CreateDepartmentReq req, RequestOptions reqOptions)
DeleteDepartmentResp
delete(DeleteDepartmentReq req)
delete(DeleteDepartmentReq req, RequestOptions reqOptions)
GetDepartmentResp
get(GetDepartmentReq req)
get(GetDepartmentReq req, RequestOptions reqOptions)
ListDepartmentResp
list(ListDepartmentReq req)
list(ListDepartmentReq req, RequestOptions reqOptions)
ParentDepartmentResp
parent(ParentDepartmentReq req)
parent(ParentDepartmentReq req, RequestOptions reqOptions)
PatchDepartmentResp
patch(PatchDepartmentReq req)
patch(PatchDepartmentReq req, RequestOptions reqOptions)
SearchDepartmentResp
search(SearchDepartmentReq req)
search(SearchDepartmentReq req, RequestOptions reqOptions)
UnbindDepartmentChatDepartmentResp
unbindDepartmentChat(UnbindDepartmentChatDepartmentReq req)
unbindDepartmentChat(UnbindDepartmentChatDepartmentReq req, RequestOptions reqOptions)
UpdateDepartmentResp
update(UpdateDepartmentReq req)
update(UpdateDepartmentReq req, RequestOptions reqOptions)
UpdateDepartmentIdDepartmentResp
updateDepartmentId(UpdateDepartmentIdDepartmentReq req)
updateDepartmentId(UpdateDepartmentIdDepartmentReq req, RequestOptions reqOptions)
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public Department(Config config)
public BatchDepartmentResp batch(BatchDepartmentReq req, RequestOptions reqOptions) throws Exception
官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch&project=contact&resource=department&version=v3 ;
使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/BatchDepartmentSample.java ;
Exception
public BatchDepartmentResp batch(BatchDepartmentReq req) throws Exception
public ChildrenDepartmentResp children(ChildrenDepartmentReq req, RequestOptions reqOptions) throws Exception
- 部门ID 必填,根部门的部门ID 为0。;- 使用 `user_access_token` 时,返回该用户组织架构可见性范围([登陆企业管理后台进行权限配置](https://www.feishu.cn/admin/security/permission/visibility))内的所有可见部门。当进行递归查询时,最多1000个部门对该用户可见。;;- 使用 ;`tenant_access_token` 则基于应用的通讯录权限范围进行权限校验与过滤。;如果部门ID为0,会检验应用是否有全员通讯录权限,如果是非0 部门ID,则会校验应用是否有该部门的通讯录权限。无部门权限返回无部门通讯录权限错误码,有权限则返回部门下子部门列表(根据fetch_child决定是否递归)。 ;
官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/children ;
使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ChildrenDepartmentSample.java ;
public ChildrenDepartmentResp children(ChildrenDepartmentReq req) throws Exception
public CreateDepartmentResp create(CreateDepartmentReq req, RequestOptions reqOptions) throws Exception
只可在应用的通讯录权限范围内的部门下创建部门。若需要在根部门下创建子部门,则应用通讯录权限范围需要设置为“全部成员”。应用商店应用无权限调用此接口。 ;
官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/create ;
使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/CreateDepartmentSample.java ;
public CreateDepartmentResp create(CreateDepartmentReq req) throws Exception
public DeleteDepartmentResp delete(DeleteDepartmentReq req, RequestOptions reqOptions) throws Exception
应用需要同时拥有待删除部门及其父部门的通讯录授权。 ;
官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/delete ;
使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/DeleteDepartmentSample.java ;
public DeleteDepartmentResp delete(DeleteDepartmentReq req) throws Exception
public GetDepartmentResp get(GetDepartmentReq req, RequestOptions reqOptions) throws Exception
- 使用`tenant_access_token`时,应用需要拥有待查询部门的通讯录授权。如果需要获取根部门信息,则需要拥有全员权限。;- 使用`user_access_token`时,用户需要有待查询部门的可见性,如果需要获取根部门信息,则要求员工可见所有人。 ;
官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/get ;
使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/GetDepartmentSample.java ;
public GetDepartmentResp get(GetDepartmentReq req) throws Exception
public ListDepartmentResp list(ListDepartmentReq req, RequestOptions reqOptions) throws Exception
官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=department&version=v3 ;
使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ListDepartmentSample.java ;
public ListDepartmentResp list(ListDepartmentReq req) throws Exception
public ParentDepartmentResp parent(ParentDepartmentReq req, RequestOptions reqOptions) throws Exception
使用`tenant_access_token`时,该接口只返回可见性范围内的父部门信息。;例如:A >>B>>C>>D四级部门,通讯录权限只到B,那么查询D部门的parent,会返回B和C两级部门。;使用user_access_token时,该接口只返回对于用户可见的父部门信息。 ;
官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/parent ;
使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/ParentDepartmentSample.java ;
public ParentDepartmentResp parent(ParentDepartmentReq req) throws Exception
public PatchDepartmentResp patch(PatchDepartmentReq req, RequestOptions reqOptions) throws Exception
调用该接口需要具有该部门以及更新操作涉及的部门的通讯录权限。 ;
官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/patch ;
使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/PatchDepartmentSample.java ;
public PatchDepartmentResp patch(PatchDepartmentReq req) throws Exception
public SearchDepartmentResp search(SearchDepartmentReq req, RequestOptions reqOptions) throws Exception
部门存在,但用户搜索不到并不一定是搜索有问题,可能是管理员在后台配置了权限控制,导致用户无法搜索到该部门。 ;
官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/search ;
使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/SearchDepartmentSample.java ;
public SearchDepartmentResp search(SearchDepartmentReq req) throws Exception
public UnbindDepartmentChatDepartmentResp unbindDepartmentChat(UnbindDepartmentChatDepartmentReq req, RequestOptions reqOptions) throws Exception
官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/unbind_department_chat ;
使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UnbindDepartmentChatDepartmentSample.java ;
public UnbindDepartmentChatDepartmentResp unbindDepartmentChat(UnbindDepartmentChatDepartmentReq req) throws Exception
public UpdateDepartmentResp update(UpdateDepartmentReq req, RequestOptions reqOptions) throws Exception
- 调用该接口需要具有该部门与更新部门信息涉及的通讯录权限。;; - 没有填写的字段会被置为空值(order字段除外)。 ;
官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/update ;
使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateDepartmentSample.java ;
public UpdateDepartmentResp update(UpdateDepartmentReq req) throws Exception
public UpdateDepartmentIdDepartmentResp updateDepartmentId(UpdateDepartmentIdDepartmentReq req, RequestOptions reqOptions) throws Exception
官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update_department_id&project=contact&resource=department&version=v3 ;
使用Demo链接: https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/contactv3/UpdateDepartmentIdDepartmentSample.java ;
public UpdateDepartmentIdDepartmentResp updateDepartmentId(UpdateDepartmentIdDepartmentReq req) throws Exception
Copyright © 2024. All rights reserved.