public class WxCpUserServiceImpl extends Object implements WxCpUserService
Created by BinaryWang on 2017/6/24.
| 构造器和说明 | 
|---|
| WxCpUserServiceImpl() | 
| 限定符和类型 | 方法和说明 | 
|---|---|
| void | authenticate(String userId)
   用在二次验证的时候. | 
| void | create(WxCpUser user)新建用户. | 
| void | delete(String... userIds)
 删除用户/批量删除成员. | 
| Integer | getActiveStat(Date date)
 获取企业活跃成员数。 | 
| WxCpUser | getById(String userid)获取用户. | 
| WxCpExternalContactInfo | getExternalContact(String userId)获取外部联系人详情. | 
| String | getJoinQrCode(int sizeType)
 获取加入企业二维码。 | 
| String | getUserId(String mobile)
 通过手机号获取其所对应的userid。 | 
| String | getUserIdByEmail(String email,
                int emailType)
 通过邮箱获取其所对应的userid。 | 
| WxCpDeptUserResult | getUserListId(String cursor,
             Integer limit)获取成员ID列表
 获取企业成员的userid与对应的部门ID列表,预计于2022年8月8号发布。 | 
| WxCpInviteResult | invite(List<String> userIds,
      List<String> partyIds,
      List<String> tagIds)
 邀请成员. | 
| List<WxCpUser> | listByDepartment(Long departId,
                Boolean fetchChild,
                Integer status)
 获取部门成员详情
 请求方式:GET(HTTPS)
 请求地址:https://qyapi.weixin.qq.com/cgi-bin/user/list? | 
| List<WxCpUser> | listSimpleByDepartment(Long departId,
                      Boolean fetchChild,
                      Integer status)
 获取部门成员. | 
| String | openid2UserId(String openid)
 openid转userid. | 
| WxCpOpenUseridToUseridResult | openUseridToUserid(List<String> openUseridList,
                  String sourceAgentId)open_userid转换为userid
 将代开发应用或第三方应用获取的密文open_userid转换为明文userid
 
 文档地址:https://developer.work.weixin.qq.com/document/path/95884#userid%E8%BD%AC%E6%8D%A2
 权限说明:
 需要使用自建应用或基础应用的access_token
 成员需要同时在access_token和source_agentid所对应应用的可见范围内
  | 
| void | update(WxCpUser user)更新用户. | 
| Map<String,String> | userId2Openid(String userId,
             Integer agentId)
  userid转openid. | 
| WxCpUseridToOpenUseridResult | useridToOpenUserid(ArrayList<String> useridList)userid转换为open_userid
 将自建应用或代开发应用获取的userid转换为第三方应用的userid
 https://developer.work.weixin.qq.com/document/path/95603 | 
public void authenticate(String userId) throws WxErrorException
WxCpUserService用在二次验证的时候. 企业在员工验证成功后,调用本方法告诉企业号平台该员工关注成功。
authenticate 在接口中 WxCpUserServiceuserId - 用户idWxErrorException - the wx error exceptionpublic void create(WxCpUser user) throws WxErrorException
WxCpUserServicecreate 在接口中 WxCpUserServiceuser - 用户对象WxErrorException - the wx error exceptionpublic void update(WxCpUser user) throws WxErrorException
WxCpUserServiceupdate 在接口中 WxCpUserServiceuser - 用户对象WxErrorException - the wx error exceptionpublic void delete(String... userIds) throws WxErrorException
WxCpUserService删除用户/批量删除成员. http://qydev.weixin.qq.com/wiki/index.php?title=管理成员#.E6.89.B9.E9.87.8F.E5.88.A0.E9.99.A4.E6.88.90.E5.91.98
delete 在接口中 WxCpUserServiceuserIds - 员工UserID列表。对应管理端的帐号WxErrorException - the wx error exceptionpublic WxCpUser getById(String userid) throws WxErrorException
WxCpUserServicegetById 在接口中 WxCpUserServiceuserid - 用户idWxErrorException - the wx error exceptionpublic List<WxCpUser> listByDepartment(Long departId, Boolean fetchChild, Integer status) throws WxErrorException
WxCpUserService获取部门成员详情 请求方式:GET(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/user/list?access_token=ACCESS_TOKEN&department_id=DEPARTMENT_ID&fetch_child=FETCH_CHILD 文档地址:https://work.weixin.qq.com/api/doc/90000/90135/90201
listByDepartment 在接口中 WxCpUserServicedepartId - 必填。部门idfetchChild - 非必填。1/0:是否递归获取子部门下面的成员status - 非必填。0获取全部员工,1获取已关注成员列表,2获取禁用成员列表,4获取未关注成员列表。status可叠加WxErrorException - the wx error exceptionpublic List<WxCpUser> listSimpleByDepartment(Long departId, Boolean fetchChild, Integer status) throws WxErrorException
WxCpUserService获取部门成员. http://qydev.weixin.qq.com/wiki/index.php?title=管理成员#.E8.8E.B7.E5.8F.96.E9.83.A8.E9.97.A8.E6.88.90.E5.91.98
listSimpleByDepartment 在接口中 WxCpUserServicedepartId - 必填。部门idfetchChild - 非必填。1/0:是否递归获取子部门下面的成员status - 非必填。0获取全部员工,1获取已关注成员列表,2获取禁用成员列表,4获取未关注成员列表。status可叠加WxErrorException - the wx error exceptionpublic WxCpInviteResult invite(List<String> userIds, List<String> partyIds, List<String> tagIds) throws WxErrorException
WxCpUserService邀请成员. 企业可通过接口批量邀请成员使用企业微信,邀请后将通过短信或邮件下发通知。 请求方式:POST(HTTPS) 请求地址: https://qyapi.weixin.qq.com/cgi-bin/batch/invite?access_token=ACCESS_TOKEN 文档地址:https://work.weixin.qq.com/api/doc#12543
invite 在接口中 WxCpUserServiceuserIds - 成员ID列表, 最多支持1000个。partyIds - 部门ID列表,最多支持100个。tagIds - 标签ID列表,最多支持100个。WxErrorException - the wx error exceptionpublic Map<String,String> userId2Openid(String userId, Integer agentId) throws WxErrorException
WxCpUserServiceuserid转openid. 该接口使用场景为微信支付、微信红包和企业转账。 在使用微信支付的功能时,需要自行将企业微信的userid转成openid。 在使用微信红包功能时,需要将应用id和userid转成appid和openid才能使用。 注:需要成员使用微信登录企业微信或者关注微信插件才能转成openid 文档地址:https://work.weixin.qq.com/api/doc#11279
userId2Openid 在接口中 WxCpUserServiceuserId - 企业内的成员idagentId - 非必填,整型,仅用于发红包。其它场景该参数不要填,如微信支付、企业转账、电子发票WxErrorException - the wx error exceptionpublic String openid2UserId(String openid) throws WxErrorException
WxCpUserServiceopenid转userid. 该接口主要应用于使用微信支付、微信红包和企业转账之后的结果查询。 开发者需要知道某个结果事件的openid对应企业微信内成员的信息时,可以通过调用该接口进行转换查询。 权限说明: 管理组需对openid对应的企业微信成员有查看权限。 文档地址:https://work.weixin.qq.com/api/doc#11279
openid2UserId 在接口中 WxCpUserServiceopenid - 在使用微信支付、微信红包和企业转账之后,返回结果的openidWxErrorException - the wx error exceptionpublic String getUserId(String mobile) throws WxErrorException
WxCpUserService通过手机号获取其所对应的userid。 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/user/getuserid?access_token=ACCESS_TOKEN 文档地址:https://work.weixin.qq.com/api/doc#90001/90143/91693
getUserId 在接口中 WxCpUserServicemobile - 手机号码。长度为5~32个字节WxErrorException - .public String getUserIdByEmail(String email, int emailType) throws WxErrorException
WxCpUserService通过邮箱获取其所对应的userid。 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/user/get_userid_by_email?access_token=ACCESS_TOKEN 文档地址:https://developer.work.weixin.qq.com/document/path/95895
getUserIdByEmail 在接口中 WxCpUserServiceemail - 邮箱emailType - 邮箱类型:1-企业邮箱;2-个人邮箱WxErrorException - .public WxCpExternalContactInfo getExternalContact(String userId) throws WxErrorException
WxCpUserService企业可通过此接口,根据外部联系人的userid,拉取外部联系人详情。权限说明: 企业需要使用外部联系人管理secret所获取的accesstoken来调用 第三方应用需拥有“企业客户”权限。 第三方应用调用时,返回的跟进人follow_user仅包含应用可见范围之内的成员。
getExternalContact 在接口中 WxCpUserServiceuserId - 外部联系人的useridWxErrorException - .public String getJoinQrCode(int sizeType) throws WxErrorException
WxCpUserService获取加入企业二维码。 请求方式:GET(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/corp/get_join_qrcode?access_token=ACCESS_TOKEN&size_type=SIZE_TYPE 文档地址:https://work.weixin.qq.com/api/doc/90000/90135/91714
getJoinQrCode 在接口中 WxCpUserServicesizeType - qrcode尺寸类型,1: 171 x 171; 2: 399 x 399; 3: 741 x 741; 4: 2052 x 2052WxErrorException - .public Integer getActiveStat(Date date) throws WxErrorException
WxCpUserService获取企业活跃成员数。 请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/user/get_active_stat?access_token=ACCESS_TOKEN 文档地址:https://developer.work.weixin.qq.com/document/path/92714
getActiveStat 在接口中 WxCpUserServicedate - 具体某天的活跃人数,最长支持获取30天前数据WxErrorException - .public WxCpUseridToOpenUseridResult useridToOpenUserid(ArrayList<String> useridList) throws WxErrorException
WxCpUserServiceuseridToOpenUserid 在接口中 WxCpUserServiceuseridList - the userid listWxErrorException - the wx error exceptionpublic WxCpOpenUseridToUseridResult openUseridToUserid(List<String> openUseridList, String sourceAgentId) throws WxErrorException
WxCpUserService文档地址:https://developer.work.weixin.qq.com/document/path/95884#userid%E8%BD%AC%E6%8D%A2 权限说明: 需要使用自建应用或基础应用的access_token 成员需要同时在access_token和source_agentid所对应应用的可见范围内
openUseridToUserid 在接口中 WxCpUserServiceopenUseridList - open_userid列表,最多不超过1000个。必须是source_agentid对应的应用所获取sourceAgentId - 企业授权的代开发自建应用或第三方应用的agentidWxErrorException - the wx error exceptionpublic WxCpDeptUserResult getUserListId(String cursor, Integer limit) throws WxErrorException
WxCpUserService请求方式:POST(HTTPS) 请求地址:https://qyapi.weixin.qq.com/cgi-bin/user/list_id?access_token=ACCESS_TOKEN
getUserListId 在接口中 WxCpUserServicecursor - the cursorlimit - the limitWxErrorException - the wx error exceptionCopyright © 2024. All rights reserved.