|
||||||||||
| 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.TmplApi
public class TmplApi
模板消息相关API
| Constructor Summary | |
|---|---|
TmplApi(TokenManager tokenManager)
|
|
| Method Summary | |
|---|---|
ApiResult |
deleteTemplate(String templateId)
删除模板 |
List<TemplateMessageInfo> |
getAllTemplates()
获取模板列表 |
String |
getTemplateId(String shortId)
获取模板ID |
IndustryType[] |
getTmplIndustry()
获取设置的行业信息 |
String |
sendTmplMessage(TemplateMessage tplMessage)
发送模板消息 |
ApiResult |
setTmplIndustry(IndustryType... industryTypes)
设置所属行业(每月可修改行业1次,账号仅可使用所属行业中相关的模板) |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TmplApi(TokenManager tokenManager)
| Method Detail |
|---|
public ApiResult setTmplIndustry(IndustryType... industryTypes)
throws WeixinException
industryTypes - 所处行业 目前不超过两个
WeixinExceptionIndustryType,
设置所处行业
public IndustryType[] getTmplIndustry()
throws WeixinException
WeixinExceptionIndustryType,
获取设置的行业信息
public String getTemplateId(String shortId)
throws WeixinException
shortId - 模板库中模板的编号,有“TM**”和“OPENTMTM**”等形式
WeixinException
public List<TemplateMessageInfo> getAllTemplates()
throws WeixinException
WeixinExceptionTemplateMessageInfo,
获取模板列表
public ApiResult deleteTemplate(String templateId)
throws WeixinException
templateId - 公众帐号下模板消息ID
WeixinException
public String sendTmplMessage(TemplateMessage tplMessage)
throws WeixinException
tplMessage - 消息对象
WeixinExceptionTemplateMessage,
com.foxinmy.weixin4j.msg.event.TemplatesendjobfinishMessage
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||