-
Notifications
You must be signed in to change notification settings - Fork 1.1k
MessageAPI
liyiorg edited this page Jan 9, 2015
·
3 revisions
//access_token
String access_token = "";
// 获取分组ID
Group group = UserAPI.groupsGet(access_token);
String gid = group.getGroups().get(0).getId();
//文本群发
MassTextMessage textMessage = new MassTextMessage("分组群发文本消息");
//设置分组
textMessage.setFilter(new Filter(false,gid));
MessageAPI.messageMassSendall(access_token, textMessage);
//媒体类型
//先上传图片文件 获取media_id
String media_id = "";
MassImageMessage imageMessage = new MassImageMessage(media_id);
imageMessage.setFilter(new Filter(false,gid));
MessageAPI.messageMassSendall(access_token,imageMessage);
//access_token
String access_token = "";
//根据openId 群发
//文本群发
MassTextMessage textMessage2 = new MassTextMessage("openId 列表群发文本消息");
textMessage2.setTouser(new HashSet<String>());
textMessage2.getTouser().add("openid_1");
textMessage2.getTouser().add("openid_2");
MessageAPI.messageMassSend(access_token,textMessage2);
- 图文消息 MessageAPI.mediaUploadnews
- 视频 MessageAPI.mediaUploadvideo
- 语音 MediaAPI.mediaUpload
- 图片 MediaAPI.mediaUpload
获取token
- TokenAPI access_token 获取
- MediaAPI 多媒体上传下载(临时素材)
- MaterialAPI 永久素材
- MenuAPI 菜单、个性化菜单
- MessageAPI 信息发送(客服消息、群发消息、模板消息)
- PayAPI 支付订单相关接口
- PayMchAPI 支付订单、红包、企业付款、代扣费(商户平台版)
- QrcodeAPI 二维码
- SnsAPI 网签授权
- UserAPI 用户管理、分组、标签、黑名单
- ShorturlAPI 长链接转短链接
- TicketAPI JSAPI ticket
- ComponentAPI 第三方平台开发
- CallbackipAPI 获取微信服务器IP地址
- ClearQuotaAPI 接口调用频次清零
- PoiAPI 微信门店 @Moyq5 (贡献)
- CardAPI 微信卡券 @Moyq5 (贡献)
- ShakearoundAPI 微信摇一摇周边 @Moyq5 (贡献)
- DatacubeAPI 数据统计 @Moyq5 (贡献)
- CustomserviceAPI 客服功能 @ConciseA (贡献)