1.前置条件
企业微信appId
企业微信secret
企业微信绑定小程序
小程序的appId
2.发送示例
2.1 获取access_token(HTTPS-GET)
请求URL:
https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=corpid&corpsecret=corpsecret
示例入参:
corpid=wx161we55e1fe5e4fr
corpsecret=Rspav9pmjem3zve8fkjqe6yTtCs78Rwdabn6tNdU1g
2.2 发送
完整代码示例(建议异步)
Java
运行代码
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
class WXQYUser {
private String userid;
private String name;
private String mobile;
private String hisid;
public String getUserid() {
return userid;
}
public void setUserid(String userid) {
this.userid = userid;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getHisid() {
return hisid;
}
public void setHisid(String hisid) {
this.hisid = hisid;
}
}