|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.foxinmy.weixin4j.api.BaseApi
com.foxinmy.weixin4j.mp.api.MpApi
com.foxinmy.weixin4j.mp.api.MassApi
public class MassApi
群发相关API
| Constructor Summary | |
|---|---|
MassApi(TokenManager tokenManager)
|
|
| Method Summary | |
|---|---|
ApiResult |
deleteMassNews(String msgid)
删除群发消息 |
String |
getMassNewStatus(String msgId)
查询群发发送状态 |
String[] |
massArticleByGroupId(List<MpArticle> articles,
int groupId)
Deprecated. |
String[] |
massArticleByOpenIds(List<MpArticle> articles,
String... openIds)
根据openid群发图文消息 |
String[] |
massArticleByTagId(List<MpArticle> articles,
int tagId)
标签群发图文消息 |
String[] |
massByGroupId(MassTuple tuple,
boolean isToAll,
int groupId)
Deprecated. |
String[] |
massByOpenIds(MassTuple tuple,
String... openIds)
openId群发 |
String[] |
massByTagId(MassTuple tuple,
boolean isToAll,
int tagId)
标签群发 |
ApiResult |
previewMassNews(String toUser,
String toWxName,
MassTuple tuple)
预览群发消息 开发者可通过该接口发送消息给指定用户,在手机端查看消息的样式和排版 |
String |
uploadArticle(List<MpArticle> articles)
上传图文消息,一个图文消息支持1到10条图文 具备微信支付权限的公众号,在使用高级群发接口上传、群发图文消息类型时,可使用<a>标签加入外链 |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MassApi(TokenManager tokenManager)
| Method Detail |
|---|
public String uploadArticle(List<MpArticle> articles)
throws WeixinException
articles - 图片消息
WeixinExceptionMpArticle
@Deprecated
public String[] massByGroupId(MassTuple tuple,
boolean isToAll,
int groupId)
throws WeixinException
在返回成功时,意味着群发任务提交成功,并不意味着此时群发已经结束,所以,仍有可能在后续的发送过程中出现异常情况导致用户未收到消息, 如消息有时会进行审核、服务器不稳定等,此外,群发任务一般需要较长的时间才能全部发送完毕
tuple - 消息元件isToAll - 用于设定是否向全部用户发送,值为true或false,选择true该消息群发给所有用户,
选择false可根据group_id发送给指定群组的用户groupId - 分组ID
WeixinExceptionGroup,
Text,
Image,
Voice,
MpVideo,
MpNews,
Card,
MassTuple,
GroupApi#getGroups()},
根据分组群发
@Deprecated
public String[] massArticleByGroupId(List<MpArticle> articles,
int groupId)
throws WeixinException
articles - 图文列表groupId - 分组ID
WeixinException#massByGroupId(Tuple,int)},
MpArticle
public String[] massByTagId(MassTuple tuple,
boolean isToAll,
int tagId)
throws WeixinException
在返回成功时,意味着群发任务提交成功,并不意味着此时群发已经结束,所以,仍有可能在后续的发送过程中出现异常情况导致用户未收到消息, 如消息有时会进行审核、服务器不稳定等,此外,群发任务一般需要较长的时间才能全部发送完毕
tuple - 消息元件isToAll - 用于设定是否向全部用户发送,值为true或false,选择true该消息群发给所有用户,
选择false可根据group_id发送给指定群组的用户tagId - 标签ID
WeixinExceptionTag,
Text,
Image,
Voice,
MpVideo,
MpNews,
Card,
MassTuple,
TagApi#listTags()},
根据标签群发
public String[] massArticleByTagId(List<MpArticle> articles,
int tagId)
throws WeixinException
articles - 图文列表tagId - 标签ID
WeixinException#massByTagId(Tuple,int)},
MpArticle
public String[] massByOpenIds(MassTuple tuple,
String... openIds)
throws WeixinException
tuple - 消息元件openIds - openId列表
WeixinExceptionUser,
Text,
Image,
Voice,
MpVideo,
MpNews,
Card,
MassTuple,
根据openid群发,
UserApi#getUser(String)}
public String[] massArticleByOpenIds(List<MpArticle> articles,
String... openIds)
throws WeixinException
articles - 图文列表openIds - openId列表
WeixinException#massByOpenIds(Tuple,String...)},
MpArticle
public ApiResult deleteMassNews(String msgid)
throws WeixinException
请注意,只有已经发送成功的消息才能删除删除消息只是将消息的图文详情页失效,已经收到的用户,还是能在其本地看到消息卡片
msgid - 发送出去的消息ID
WeixinException#massByTagId(Tuple, int)},
#massByOpenIds(Tuple, String...)
public ApiResult previewMassNews(String toUser,
String toWxName,
MassTuple tuple)
throws WeixinException
toUser - 接收用户的openIDtoWxName - 接收用户的微信号 towxname和touser同时赋值时,以towxname优先tuple - 消息元件
WeixinExceptionMassTuple,
预览群发消息
public String getMassNewStatus(String msgId)
throws WeixinException
msgId - 消息ID
WeixinException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||