public class WxCpTpUserServiceImpl extends Object implements WxCpTpUserService
Created by jamie on 2020/7/22.
| 构造器和说明 | 
|---|
| WxCpTpUserServiceImpl() | 
| 限定符和类型 | 方法和说明 | 
|---|---|
| void | authenticate(String userId)
   用在二次验证的时候. | 
| void | create(WxCpUser user)新建用户. | 
| void | delete(String... userIds)
 删除用户/批量删除成员. | 
| WxCpUser | getById(String userid,
       String corpId)获取用户. | 
| WxCpUserExternalContactInfo | getExternalContact(String userId)获取外部联系人详情. | 
| String | getUserId(String mobile,
         String corpId)
 通过手机号获取其所对应的userid。 | 
| WxCpInviteResult | invite(List<String> userIds,
      List<String> partyIds,
      List<String> tagIds)
 邀请成员. | 
| List<WxCpUser> | listByDepartment(Long departId,
                Boolean fetchChild,
                Integer status,
                String corpId)
 获取部门成员(详情). | 
| List<WxCpUser> | listSimpleByDepartment(Long departId,
                      Boolean fetchChild,
                      Integer status)
 获取部门成员. | 
| String | openid2UserId(String openid)
 openid转userid. | 
| void | update(WxCpUser user)更新用户. | 
| Map<String,String> | userId2Openid(String userId,
             Integer agentId)
  userid转openid. | 
public void authenticate(String userId) throws WxErrorException
WxCpTpUserService用在二次验证的时候. 企业在员工验证成功后,调用本方法告诉企业号平台该员工关注成功。
authenticate 在接口中 WxCpTpUserServiceuserId - 用户idWxErrorException - the wx error exceptionpublic void create(WxCpUser user) throws WxErrorException
WxCpTpUserServicecreate 在接口中 WxCpTpUserServiceuser - 用户对象WxErrorException - the wx error exceptionpublic void update(WxCpUser user) throws WxErrorException
WxCpTpUserServiceupdate 在接口中 WxCpTpUserServiceuser - 用户对象WxErrorException - the wx error exceptionpublic void delete(String... userIds) throws WxErrorException
WxCpTpUserService删除用户/批量删除成员. 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 在接口中 WxCpTpUserServiceuserIds - 员工UserID列表。对应管理端的帐号WxErrorException - the wx error exceptionpublic WxCpUser getById(String userid, String corpId) throws WxErrorException
WxCpTpUserServicegetById 在接口中 WxCpTpUserServiceuserid - 用户idcorpId - the corp idWxErrorException - the wx error exceptionpublic List<WxCpUser> listByDepartment(Long departId, Boolean fetchChild, Integer status, String corpId) throws WxErrorException
WxCpTpUserService获取部门成员(详情). 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.28.E8.AF.A6.E6.83.85.29
listByDepartment 在接口中 WxCpTpUserServicedepartId - 必填。部门idfetchChild - 非必填。1/0:是否递归获取子部门下面的成员status - 非必填。0获取全部员工,1获取已关注成员列表,2获取禁用成员列表,4获取未关注成员列表。status可叠加corpId - the corp idWxErrorException - the wx error exceptionpublic List<WxCpUser> listSimpleByDepartment(Long departId, Boolean fetchChild, Integer status) throws WxErrorException
WxCpTpUserService获取部门成员. 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 在接口中 WxCpTpUserServicedepartId - 必填。部门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
WxCpTpUserService邀请成员. 企业可通过接口批量邀请成员使用企业微信,邀请后将通过短信或邮件下发通知。 请求方式:POST(HTTPS) 请求地址: https://qyapi.weixin.qq.com/cgi-bin/batch/invite?access_token=ACCESS_TOKEN 文档地址:https://work.weixin.qq.com/api/doc#12543
invite 在接口中 WxCpTpUserServiceuserIds - 成员ID列表, 最多支持1000个。partyIds - 部门ID列表,最多支持100个。tagIds - 标签ID列表,最多支持100个。WxErrorException - the wx error exceptionpublic Map<String,String> userId2Openid(String userId, Integer agentId) throws WxErrorException
WxCpTpUserServiceuserid转openid. 该接口使用场景为微信支付、微信红包和企业转账。 在使用微信支付的功能时,需要自行将企业微信的userid转成openid。 在使用微信红包功能时,需要将应用id和userid转成appid和openid才能使用。 注:需要成员使用微信登录企业微信或者关注微信插件才能转成openid 文档地址:https://work.weixin.qq.com/api/doc#11279
userId2Openid 在接口中 WxCpTpUserServiceuserId - 企业内的成员idagentId - 非必填,整型,仅用于发红包。其它场景该参数不要填,如微信支付、企业转账、电子发票WxErrorException - the wx error exceptionpublic String openid2UserId(String openid) throws WxErrorException
WxCpTpUserServiceopenid转userid. 该接口主要应用于使用微信支付、微信红包和企业转账之后的结果查询。 开发者需要知道某个结果事件的openid对应企业微信内成员的信息时,可以通过调用该接口进行转换查询。 权限说明: 管理组需对openid对应的企业微信成员有查看权限。 文档地址:https://work.weixin.qq.com/api/doc#11279
openid2UserId 在接口中 WxCpTpUserServiceopenid - 在使用微信支付、微信红包和企业转账之后,返回结果的openidWxErrorException - the wx error exceptionpublic String getUserId(String mobile, String corpId) throws WxErrorException
WxCpTpUserService通过手机号获取其所对应的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 在接口中 WxCpTpUserServicemobile - 手机号码。长度为5~32个字节corpId - – the corp idWxErrorException - .public WxCpUserExternalContactInfo getExternalContact(String userId) throws WxErrorException
WxCpTpUserService企业可通过此接口,根据外部联系人的userid,拉取外部联系人详情。权限说明: 企业需要使用外部联系人管理secret所获取的accesstoken来调用 第三方应用需拥有“企业客户”权限。 第三方应用调用时,返回的跟进人follow_user仅包含应用可见范围之内的成员。
getExternalContact 在接口中 WxCpTpUserServiceuserId - 外部联系人的useridWxErrorException - .Copyright © 2024. All rights reserved.