public interface WxCpUserService
用户管理接口 Created by BinaryWang on 2017/6/24.
| 限定符和类型 | 方法和说明 |
|---|---|
void |
authenticate(String userId)
用在二次验证的时候
企业在员工验证成功后,调用本方法告诉企业号平台该员工关注成功。
|
void |
create(WxCpUser user)
新建用户
|
void |
delete(String... userIds)
删除用户/批量删除成员
http://qydev.weixin.qq.com/wiki/index.php?
|
WxCpUser |
getById(String userid)
获取用户
|
int |
invite(String userId,
String inviteTips)
已过时。
api obsoleted. 邀请关注的功能微信企业号已经下线了,
详细请参考该链接点击查看 https://qy.weixin.qq.com/cgi-bin/homepagenotify?action=get&id=46
|
List<WxCpUser> |
listByDepartment(Integer departId,
Boolean fetchChild,
Integer status)
获取部门成员(详情)
http://qydev.weixin.qq.com/wiki/index.php?
|
List<WxCpUser> |
listSimpleByDepartment(Integer departId,
Boolean fetchChild,
Integer status)
获取部门成员
http://qydev.weixin.qq.com/wiki/index.php?
|
String |
openid2UserId(String openid)
openid转userid
该接口主要应用于使用微信支付、微信红包和企业转账之后的结果查询。
|
void |
update(WxCpUser user)
更新用户
|
Map<String,String> |
userId2Openid(String userId,
Integer agentId)
userid转openid.
|
void authenticate(String userId) throws WxErrorException
用在二次验证的时候 企业在员工验证成功后,调用本方法告诉企业号平台该员工关注成功。
userId - 用户idWxErrorExceptionList<WxCpUser> listByDepartment(Integer departId, Boolean fetchChild, Integer status) throws WxErrorException
获取部门成员(详情) 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
departId - 必填。部门idfetchChild - 非必填。1/0:是否递归获取子部门下面的成员status - 非必填。0获取全部员工,1获取已关注成员列表,2获取禁用成员列表,4获取未关注成员列表。status可叠加WxErrorExceptionList<WxCpUser> listSimpleByDepartment(Integer departId, Boolean fetchChild, Integer status) throws WxErrorException
获取部门成员 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
departId - 必填。部门idfetchChild - 非必填。1/0:是否递归获取子部门下面的成员status - 非必填。0获取全部员工,1获取已关注成员列表,2获取禁用成员列表,4获取未关注成员列表。status可叠加WxErrorExceptionvoid create(WxCpUser user) throws WxErrorException
user - 用户对象WxErrorExceptionvoid update(WxCpUser user) throws WxErrorException
user - 用户对象WxErrorExceptionvoid delete(String... userIds) throws WxErrorException
删除用户/批量删除成员 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
userIds - 员工UserID列表。对应管理端的帐号WxErrorExceptionWxCpUser getById(String userid) throws WxErrorException
userid - 用户idWxErrorException@Deprecated int invite(String userId, String inviteTips) throws WxErrorException
邀请成员关注 http://qydev.weixin.qq.com/wiki/index.php?title=管理成员#.E9.82.80.E8.AF.B7.E6.88.90.E5.91.98.E5.85.B3.E6.B3.A8
userId - 用户的useridinviteTips - 推送到微信上的提示语(只有认证号可以使用)。当使用微信推送时,该字段默认为“请关注XXX企业号”,邮件邀请时,该字段无效。WxErrorExceptionMap<String,String> userId2Openid(String userId, Integer agentId) throws WxErrorException
userid转openid. 该接口使用场景为微信支付、微信红包和企业转账。 在使用微信支付的功能时,需要自行将企业微信的userid转成openid。 在使用微信红包功能时,需要将应用id和userid转成appid和openid才能使用。 注:需要成员使用微信登录企业微信或者关注微信插件才能转成openid 文档地址:https://work.weixin.qq.com/api/doc#11279
userId - 企业内的成员idagentId - 非必填,整型,仅用于发红包。其它场景该参数不要填,如微信支付、企业转账、电子发票WxErrorExceptionString openid2UserId(String openid) throws WxErrorException
openid转userid 该接口主要应用于使用微信支付、微信红包和企业转账之后的结果查询。 开发者需要知道某个结果事件的openid对应企业微信内成员的信息时,可以通过调用该接口进行转换查询。 权限说明: 管理组需对openid对应的企业微信成员有查看权限。 文档地址:https://work.weixin.qq.com/api/doc#11279
openid - 在使用微信支付、微信红包和企业转账之后,返回结果的openidWxErrorExceptionCopyright © 2018. All rights reserved.