企业微信相关

企业微信:


cropid         企业id
userid         用户id
               部门id
tagid          标签id
agentid        应用id
secret         "权限钥匙"
access_token   获取信息需要的票据(有效期2小时)
jsapi_ticket   H5应用调用企业微信JS接口的临时票据(有效期2小时)


调用企业微信接口步骤:
1、创建发送内容
RequestBody requestBody = RequestBody.create(MediaType.parse(ProjectConsts.MEDIA_TYPE), TJson.objToStr(body));
2、创建请求
Request request = new Request.Builder().post(requestBody).url(MessageFormat.format(ProjectConsts.WEIXIN_CREATE_MENU, getAccessToken(), agentid)).build();
       .get
3、执行请求并接收返回结果
String responseResult = OkHttpUtil.executeString(request);
JSONObject object = JSONObject.parseObject(responseResult);
4、获取结果内容
Internet i = object.getInteger(ProjectConsts.ERRCODE)






WEIXIN_GET_TOKEN(获取权限票据)
https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid={0}&corpsecret={1}
return { access_token  expires_in过期时间/秒 }


WEIXIN_GET_TICKET(获取H5应用接口的临时票据)
https://qyapi.weixin.qq.com/cgi-bin/get_jsapi_ticket?access_token={0}
return { ticket expires_in }


WEIXIN_USER_SIMPLE_LIST(获取部门下所有成员简要信息,fetch_child为1表示递归获取子部门下面的成员)
https://qyapi.weixin.qq.com/cgi-bin/user/simplelist?access_token={0}&department_id={1}&fetch_child={2}
return { userid name department所属部门id列表 }


WEIXIN_READ_USER_DETAIL(通过userid获取用户详细信息)
https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token={0}&userid={1}
return { userid name department order部门内排序值从大到小[0-2^32) position职位信息 mobile gender性别1男0未定义 email isleader avatar头像url如果要小图将末尾"/0"改为"/100 telephone english_name extattr扩展属性 status激活状态,是否激活企业微信并关注微信插件 qr_code个人二维码 }


WEIXIN_GET_USER_INFO(通过code获取用户详细信息)
https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo?access_token={0}&code={1}


WEIXIN_DEPARTMENT_LIST(通过部门id获取子部门列表,不填id则获取全部)
https://qyapi.weixin.qq.com/cgi-bin/department/list?access_token={0}&id={1}"


WEIXIN_CREATE_MENU(创建菜单)
https://qyapi.weixin.qq.com/cgi-bin/menu/create?access_token={0}&agentid={1}


WEIXIN_GET_MENU(获取菜单列表)
https://qyapi.weixin.qq.com/cgi-bin/menu/get?access_token={0}&agentid={1}


WEIXIN_MESSAGE_SEND(发送消息)
https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token={0}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值