Class SubscribeMessageApi


  • public class SubscribeMessageApi
    extends com.foxinmy.weixin4j.api.BaseApi
    发送订阅消息。 发送订阅消息
    Since:
    1.9
    • Constructor Detail

      • SubscribeMessageApi

        public SubscribeMessageApi​(com.foxinmy.weixin4j.token.TokenManager tokenManager)
      • SubscribeMessageApi

        public SubscribeMessageApi​(com.foxinmy.weixin4j.token.TokenManager tokenManager,
                                   Properties properties)
    • Method Detail

      • sendSubscribeMessage

        public void sendSubscribeMessage​(String toUser,
                                         String templateId,
                                         String page,
                                         Map<String,​String> data)
                                  throws com.foxinmy.weixin4j.exception.WeixinException
        发送订阅消息
        Parameters:
        toUser - 接收者(用户)的 openid。
        templateId - 所需下发的订阅模板id
        page - 点击模板卡片后的跳转页面,仅限本小程序内的页面。支持带参数,(示例index?foo=bar)。该字段不填则模板无跳转。
        data - 模板内容,格式形如 { "key1": { "value": any }, "key2": { "value": any } }
        Throws:
        com.foxinmy.weixin4j.exception.WeixinException - indicates getting access token failed, or sending template message failed.
        See Also:
        发送订阅消息
      • weixinBundle

        protected ResourceBundle weixinBundle()
        Specified by:
        weixinBundle in class com.foxinmy.weixin4j.api.BaseApi
      • getRequestUri

        protected String getRequestUri​(String key)
        Overrides:
        getRequestUri in class com.foxinmy.weixin4j.api.BaseApi