weixin4j-qy-api
微信企业号开发工具包
功能列表
-
DepartApi
部门管理API -
UserApi
成员管理API -
TagApi
标签管理API
如何使用
1.API工程可以单独打包到其他项目中使用,需新增或拷贝weixin.properties文件到项目的classpath中
weixin.properties说明
| 属性名 | 说明 |
|---|---|
| account | 微信企业号信息 json格式 |
| token_path | 使用FileTokenHolder时token保存的物理路径 |
示例(properties中换行用右斜杆\)
account={"id":"corpid","secret":"corpsecret", "token":"开放者的token 非必须", "encodingAesKey":"AES加密密钥"} token_path=/tmp/weixin/token
2.实例化一个WeixinProxy对象,调用API
WeixinProxy weixinProxy = new WeixinProxy();
// weixinProxy = new WeixinProxy(corpid,corpsecret);
// weixinProxy = new WeixinProxy(weixinAccount);
weixinProxy.getUser(userid);
3.针对token存储有两种方案,File存储/Redis存储,当然也可自己实现TokenHolder(继承AbstractTokenHolder并重写getToken方法),默认使用文件(xml)的方式保存token,如果环境中支持redis,建议使用RedisTokenHolder.
WeixinProxy weixinProxy = new WeixinProxy(new RedisTokenHolder());
// weixinProxy = new WeixinProxy(new RedisTokenHolder(weixinAccount));
4.mvn package.
更新LOG
-
2014-11-19
-
新增
部门管理接口 -
新增
用户管理接口 -
新增
标签管理接口
-