public class User extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
BasicBatchUserResp |
basicBatch(BasicBatchUserReq req)
获取用户姓名,根据用户 ID 获取用户姓名,仅返回核心信息(姓名),不含扩展字段及敏感信息。
|
BasicBatchUserResp |
basicBatch(BasicBatchUserReq req,
RequestOptions reqOptions)
获取用户姓名,根据用户 ID 获取用户姓名,仅返回核心信息(姓名),不含扩展字段及敏感信息。
|
BatchUserResp |
batch(BatchUserReq req)
批量获取用户信息,调用该接口获取通讯录内一个或多个用户的信息,包括用户 ID、名称、邮箱、手机号、状态以及所属部门等信息。
|
BatchUserResp |
batch(BatchUserReq req,
RequestOptions reqOptions)
批量获取用户信息,调用该接口获取通讯录内一个或多个用户的信息,包括用户 ID、名称、邮箱、手机号、状态以及所属部门等信息。
|
BatchGetIdUserResp |
batchGetId(BatchGetIdUserReq req)
通过手机号或邮箱获取用户 ID,调用该接口通过手机号或邮箱获取一个或多个用户的 ID (包括 user_id、open_id、union_id)与状态信息。
|
BatchGetIdUserResp |
batchGetId(BatchGetIdUserReq req,
RequestOptions reqOptions)
通过手机号或邮箱获取用户 ID,调用该接口通过手机号或邮箱获取一个或多个用户的 ID (包括 user_id、open_id、union_id)与状态信息。
|
CreateUserResp |
create(CreateUserReq req)
创建用户,调用该接口向通讯录创建一个用户(该动作可以理解为员工入职)。
|
CreateUserResp |
create(CreateUserReq req,
RequestOptions reqOptions)
创建用户,调用该接口向通讯录创建一个用户(该动作可以理解为员工入职)。
|
DeleteUserResp |
delete(DeleteUserReq req)
删除用户,调用该接口从通讯录内删除一个指定用户(该动作可以理解为员工离职),删除时可通过请求参数将用户所有的群组、文档、日程和应用等数据转让至他人。
|
DeleteUserResp |
delete(DeleteUserReq req,
RequestOptions reqOptions)
删除用户,调用该接口从通讯录内删除一个指定用户(该动作可以理解为员工离职),删除时可通过请求参数将用户所有的群组、文档、日程和应用等数据转让至他人。
|
FindByDepartmentUserResp |
findByDepartment(FindByDepartmentUserReq req)
获取部门直属用户列表,调用该接口获取指定部门直属的用户信息列表。
|
FindByDepartmentUserResp |
findByDepartment(FindByDepartmentUserReq req,
RequestOptions reqOptions)
获取部门直属用户列表,调用该接口获取指定部门直属的用户信息列表。
|
GetUserResp |
get(GetUserReq req)
获取单个用户信息,调用该接口获取通讯录中某一用户的信息,包括用户 ID、名称、邮箱、手机号、状态以及所属部门等信息。
|
GetUserResp |
get(GetUserReq req,
RequestOptions reqOptions)
获取单个用户信息,调用该接口获取通讯录中某一用户的信息,包括用户 ID、名称、邮箱、手机号、状态以及所属部门等信息。
|
ListUserResp |
list(ListUserReq req)
获取用户列表,基于部门ID获取部门下直属用户列表。
|
ListUserResp |
list(ListUserReq req,
RequestOptions reqOptions)
获取用户列表,基于部门ID获取部门下直属用户列表。
|
PatchUserResp |
patch(PatchUserReq req)
修改用户部分信息,调用该接口更新通讯录中指定用户的信息,包括名称、邮箱、手机号、所属部门以及自定义字段等信息。
|
PatchUserResp |
patch(PatchUserReq req,
RequestOptions reqOptions)
修改用户部分信息,调用该接口更新通讯录中指定用户的信息,包括名称、邮箱、手机号、所属部门以及自定义字段等信息。
|
ResurrectUserResp |
resurrect(ResurrectUserReq req)
恢复已删除用户,该接口用于恢复已删除用户(已离职的成员)。
|
ResurrectUserResp |
resurrect(ResurrectUserReq req,
RequestOptions reqOptions)
恢复已删除用户,该接口用于恢复已删除用户(已离职的成员)。
|
UpdateUserResp |
update(UpdateUserReq req)
更新用户所有信息,该接口用于更新通讯录中用户的字段。
|
UpdateUserResp |
update(UpdateUserReq req,
RequestOptions reqOptions)
更新用户所有信息,该接口用于更新通讯录中用户的字段。
|
UpdateUserIdUserResp |
updateUserId(UpdateUserIdUserReq req)
更新用户ID,调用该接口更新用户的 user_id。
|
UpdateUserIdUserResp |
updateUserId(UpdateUserIdUserReq req,
RequestOptions reqOptions)
更新用户ID,调用该接口更新用户的 user_id。
|
public User(Config config)
public BasicBatchUserResp basicBatch(BasicBatchUserReq req, RequestOptions reqOptions) throws Exception
本接口不校验[通讯录授权范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority),将直接根据传入的用户 ID 返回对应基础信息(姓名),不受数据权限范围限制。 ;
Exceptionpublic BasicBatchUserResp basicBatch(BasicBatchUserReq req) throws Exception
本接口不校验[通讯录授权范围](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority),将直接根据传入的用户 ID 返回对应基础信息(姓名),不受数据权限范围限制。 ;
Exceptionpublic BatchUserResp batch(BatchUserReq req, RequestOptions reqOptions) throws Exception
官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch&project=contact&resource=user&version=v3 ;
Exceptionpublic BatchUserResp batch(BatchUserReq req) throws Exception
官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch&project=contact&resource=user&version=v3 ;
Exceptionpublic BatchGetIdUserResp batchGetId(BatchGetIdUserReq req, RequestOptions reqOptions) throws Exception
## 注意事项;;请求后不返回用户 ID 的可能原因:;- 请求头 Authorization 传入的 tenant_access_token 有误。例如,tenant_access_token 对应的应用与实际所需应用不一致。;- 输入的手机号或者邮箱不存在。;- 应用未开通 **获取用户 user ID** API 权限。;- 应用无权限查看用户信息。你需要在应用详情页为应用配置数据权限,具体说明参见[配置应用数据权限](https://open.feishu.cn/document/home/introduction-to-scope-and-authorization/configure-app-data-permissions)。;- 使用企业邮箱查询将无法返回用户 ID,必须使用用户的邮箱地址。;- 所查询的用户已离职,如果请求参数 include_resigned 取值为 false,则不会返回离职用户 ID。 ;
Exceptionpublic BatchGetIdUserResp batchGetId(BatchGetIdUserReq req) throws Exception
## 注意事项;;请求后不返回用户 ID 的可能原因:;- 请求头 Authorization 传入的 tenant_access_token 有误。例如,tenant_access_token 对应的应用与实际所需应用不一致。;- 输入的手机号或者邮箱不存在。;- 应用未开通 **获取用户 user ID** API 权限。;- 应用无权限查看用户信息。你需要在应用详情页为应用配置数据权限,具体说明参见[配置应用数据权限](https://open.feishu.cn/document/home/introduction-to-scope-and-authorization/configure-app-data-permissions)。;- 使用企业邮箱查询将无法返回用户 ID,必须使用用户的邮箱地址。;- 所查询的用户已离职,如果请求参数 include_resigned 取值为 false,则不会返回离职用户 ID。 ;
Exceptionpublic CreateUserResp create(CreateUserReq req, RequestOptions reqOptions) throws Exception
官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=contact&resource=user&version=v3 ;
Exceptionpublic CreateUserResp create(CreateUserReq req) throws Exception
官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=contact&resource=user&version=v3 ;
Exceptionpublic DeleteUserResp delete(DeleteUserReq req, RequestOptions reqOptions) throws Exception
官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=contact&resource=user&version=v3 ;
Exceptionpublic DeleteUserResp delete(DeleteUserReq req) throws Exception
官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=contact&resource=user&version=v3 ;
Exceptionpublic FindByDepartmentUserResp findByDepartment(FindByDepartmentUserReq req, RequestOptions reqOptions) throws Exception
Exceptionpublic FindByDepartmentUserResp findByDepartment(FindByDepartmentUserReq req) throws Exception
Exceptionpublic GetUserResp get(GetUserReq req, RequestOptions reqOptions) throws Exception
官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=contact&resource=user&version=v3 ;
Exceptionpublic GetUserResp get(GetUserReq req) throws Exception
官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=contact&resource=user&version=v3 ;
Exceptionpublic ListUserResp list(ListUserReq req, RequestOptions reqOptions) throws Exception
本接口已为历史版本,不再维护更新,不推荐使用。推荐你使用[获取部门直属用户列表](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/find_by_department)接口。;;-
使用 user_access_token
情况下根据个人组织架构的通讯录可见范围进行权限过滤,返回个人组织架构通讯录范围([登陆企业管理后台进行权限配置](https://www.feishu.cn/admin/security/permission/visibility))内可见的用户数据。;-
tenant_access_token 基于应用通讯录范围进行权限鉴定。由于 department_id 是非必填参数,填与不填存在两种数据权限校验与返回情况:
1、请求设置了 department_id ;(根部门为0),会检验所带部门ID是否具有通讯录权限(如果带上 ; department_id=0
会校验是否有全员权限),有则返回部门下直属的成员列表, 否则提示无部门权限的错误码返回。
2、请求未带 ; department_id 参数,则会返回权限范围内的独立用户(权限范围直接包含了某用户,则该用户视为权限范围内的独立用户)。 ;
官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=user&version=v3 ;
Exceptionpublic ListUserResp list(ListUserReq req) throws Exception
本接口已为历史版本,不再维护更新,不推荐使用。推荐你使用[获取部门直属用户列表](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/find_by_department)接口。;;-
使用 user_access_token
情况下根据个人组织架构的通讯录可见范围进行权限过滤,返回个人组织架构通讯录范围([登陆企业管理后台进行权限配置](https://www.feishu.cn/admin/security/permission/visibility))内可见的用户数据。;-
tenant_access_token 基于应用通讯录范围进行权限鉴定。由于 department_id 是非必填参数,填与不填存在两种数据权限校验与返回情况:
1、请求设置了 department_id ;(根部门为0),会检验所带部门ID是否具有通讯录权限(如果带上 ; department_id=0
会校验是否有全员权限),有则返回部门下直属的成员列表, 否则提示无部门权限的错误码返回。
2、请求未带 ; department_id 参数,则会返回权限范围内的独立用户(权限范围直接包含了某用户,则该用户视为权限范围内的独立用户)。 ;
官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=contact&resource=user&version=v3 ;
Exceptionpublic PatchUserResp patch(PatchUserReq req, RequestOptions reqOptions) throws Exception
官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=contact&resource=user&version=v3 ;
Exceptionpublic PatchUserResp patch(PatchUserReq req) throws Exception
官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=contact&resource=user&version=v3 ;
Exceptionpublic ResurrectUserResp resurrect(ResurrectUserReq req, RequestOptions reqOptions) throws Exception
Exceptionpublic ResurrectUserResp resurrect(ResurrectUserReq req) throws Exception
Exceptionpublic UpdateUserResp update(UpdateUserReq req, RequestOptions reqOptions) throws Exception
应用需要拥有待更新用户的通讯录授权,如果涉及到用户部门变更,还需要同时拥有变更前、后所有新部门的通讯录授权。;;本接口已为历史版本,不再维护更新,不推荐使用。推荐你使用[修改用户部分信息](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/patch)接口。 ;
官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=contact&resource=user&version=v3 ;
Exceptionpublic UpdateUserResp update(UpdateUserReq req) throws Exception
应用需要拥有待更新用户的通讯录授权,如果涉及到用户部门变更,还需要同时拥有变更前、后所有新部门的通讯录授权。;;本接口已为历史版本,不再维护更新,不推荐使用。推荐你使用[修改用户部分信息](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/patch)接口。 ;
官网API文档链接:https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=contact&resource=user&version=v3 ;
Exceptionpublic UpdateUserIdUserResp updateUserId(UpdateUserIdUserReq req, RequestOptions reqOptions) throws Exception
Exceptionpublic UpdateUserIdUserResp updateUserId(UpdateUserIdUserReq req) throws Exception
ExceptionCopyright © 2026. All rights reserved.