com.foxinmy.weixin4j.mp
Class WeixinProxy

java.lang.Object
  extended by com.foxinmy.weixin4j.mp.WeixinProxy

public class WeixinProxy
extends Object

微信公众平台接口实现

Since:
JDK 1.6
Author:
jinyu(foxinmy@gmail.com)
See Also:
api文档

Field Summary
static String VERSION
           
 
Constructor Summary
WeixinProxy()
          微信接口实现(使用weixin4j.properties配置的account账号信息, 使用FileCacheStorager文件方式缓存TOKEN)
WeixinProxy(CacheStorager<Token> cacheStorager)
          微信接口实现(使用weixin4j.properties配置的account账号信息)
WeixinProxy(PerTicketManager perTicketManager, TokenManager componentTokenManager)
          第三方组件方式创建微信接口实现(永久刷新令牌机制)
WeixinProxy(WeixinAccount weixinAccount, CacheStorager<Token> cacheStorager)
          微信接口实现
 
Method Summary
 ApiResult clearQuota()
          接口调用次数调用清零:公众号调用接口并不是无限制的。为了防止公众号的程序错误而引发微信服务器负载异常,默认情况下, 每个公众号调用接口都不能超过一定限制 ,当超过一定限制时,调用对应接口会收到{"errcode":45009,"errmsg":"api freq out of limit" }错误返回码。
 ApiResult closeKfSession(String userOpenId, String kfAccount, String text)
          关闭客服会话
 MediaCounter countMaterialMedia()
          获取永久媒体素材的总数
.图片和图文消息素材(包括单图文和多图文)的总数上限为5000,其他素材的总数上限为1000
 String createCardCoupon(CardCoupon cardCoupon)
          创建卡券:创建卡券接口是微信卡券的基础接口,用于创建一类新的卡券,获取card_id,创建成功并通过审核后, 商家可以通过文档提供的其他接口将卡券下发给用户,每次成功领取,库存数量相应扣除。 1.需自定义Code码的商家必须在创建卡券时候,设定use_custom_code为true,且在调用投放卡券接口时填入指定的Code码。 指定OpenID同理。特别注意:在公众平台创建的卡券均为非自定义Code类型。 2.can_share字段指领取卡券原生页面是否可分享,建议指定Code码、指定OpenID等强限制条件的卡券填写false。 3.创建成功后该卡券会自动提交审核 ,审核结果将通过事件通知商户。开发者可调用设置白名单接口设置用户白名单,领取未通过审核的卡券,测试整个卡券的使用流程。
 QRResult createCardQR(Integer expireSeconds, CardQR... cardQRs)
          创建卡券二维码: 开发者可调用该接口生成一张卡券二维码供用户扫码后添加卡券到卡包。
 String createCustomMenu(List<Button> buttons, MenuMatchRule matchRule)
          创建个性化菜单
 Group createGroup(String name)
          创建分组
 ApiResult createKfAccount(String id, String name, String pwd)
          新增客服账号
 ApiResult createKfSession(String userOpenId, String kfAccount, String text)
          创建客服会话
 ApiResult createMenu(List<Button> buttons)
          自定义菜单
 QRResult createQR(QRParameter parameter)
          生成带参数的二维码
 Tag createTag(String name)
          创建标签
 List<?> datacube(DatacubeType datacubeType, Date date)
          查询日期跨度为0的统计数据(当天)
 List<?> datacube(DatacubeType datacubeType, Date beginDate, Date endDate)
          数据统计
 List<?> datacube(DatacubeType datacubeType, Date beginDate, int offset)
          数据统计
 List<?> datacube(DatacubeType datacubeType, int offset, Date endDate)
          数据统计
 ApiResult deleteCustomMenu(String menuId)
          删除个性化菜单
 ApiResult deleteGroup(int groupId)
          删除用户分组,所有该分组内的用户自动进入默认分组.
 ApiResult deleteKfAccount(String id)
          删除客服账号
 ApiResult deleteMassNews(String msgid)
          删除群发消息
 ApiResult deleteMaterialMedia(String mediaId)
          删除永久媒体素材
 ApiResult deleteMenu()
          删除菜单
 ApiResult deleteTag(int tagId)
          删除标签
 ApiResult deleteTemplate(String templateId)
          删除模板
 List<MpArticle> downloadArticle(String mediaId)
          下载永久图文素材
 MediaDownloadResult downloadMedia(String mediaId, boolean isMaterial)
          下载媒体文件
 List<String> getAllBalcklistOpenIds()
          获取公众号全部的黑名单列表 请慎重使用
 List<User> getAllFollowing()
          获取公众号全部的关注者列表 请慎重使用
 List<String> getAllFollowingOpenIds()
          获取公众号全部的关注者列表 请慎重使用
 List<Menu> getAllMenu()
          查询全部菜单(包含个性化菜单)
 List<User> getAllTagFollowing(int tagId)
          获取标签下全部的粉丝列表 请慎重使用
 List<String> getAllTagFollowingOpenIds(int tagId)
          获取标签下全部的粉丝列表 请慎重使用
 List<TemplateMessageInfo> getAllTemplates()
          获取模板列表
 AutoReplySetting getAutoReplySetting()
          获取公众号当前使用的自动回复规则,包括关注后自动回复、消息自动回复(60分钟内触发一次)、关键词自动回复。
 Following getBalcklistOpenIds(String nextOpenId)
          获取公众号的黑名单列表
 Following getFollowing(String nextOpenId)
          获取公众号一定数量(10000)的关注者列表 请慎重使用
 Following getFollowingOpenIds(String nextOpenId)
          获取公众号一定数量(10000)的关注者列表
 int getGroupByOpenId(String openId)
          查询用户所在分组
 List<Group> getGroups()
          查询所有分组
 List<KfChatRecord> getKfChatRecord(Date startTime, Date endTime, int number)
          客服聊天记录
 KfSession getKfSession(String userOpenId)
          获取客户的会话状态:获取客户当前的会话状态。
 String getMassNewStatus(String msgId)
          查询群发发送状态
 List<Button> getMenu()
          查询菜单
 MenuSetting getMenuSetting()
          获取公众号当前使用的自定义菜单的配置,如果公众号是通过API调用设置的菜单,则返回菜单的开发配置, 而如果公众号是在公众平台官网通过网站功能发布菜单,则本接口返回运营者设置的菜单配置。
 OauthApi getOauthApi()
          获取oauth授权API
 String getShorturl(String url)
          长链接转短链接
 Following getTagFollowing(int tagId, String nextOpenId)
          获取标签下粉丝列表 请慎重使用
 Following getTagFollowingOpenIds(int tagId, String nextOpenId)
          获取标签下粉丝列表
 String getTemplateId(String shortId)
          获取模板ID
 TokenManager getTicketManager(TicketType ticketType)
          获取JSSDK Ticket的tokenManager
 TokenManager getTokenManager()
          token管理
 User getUser(String openId)
          获取用户信息
 User getUser(String openId, Lang lang)
          获取用户信息
 List<User> getUsers(Lang lang, String... openIds)
          批量获取用户信息
 List<User> getUsers(String... openIds)
          批量获取用户信息
 Integer[] getUserTags(String openId)
          获取用户身上的标签列表
 List<String> getWechatServerIp()
          获取微信服务器IP地址
 WeixinAccount getWeixinAccount()
          获取微信账号信息
 ApiResult inviteKfAccount(String kfAccount, String inviteAccount)
          邀请绑定客服帐号 新添加的客服帐号是不能直接使用的,只有客服人员用微信号绑定了客服账号后,方可登录Web客服进行操作。此接口发起一个绑定邀请到客服人员微信号 ,客服人员需要在微信客户端上用该微信号确认后帐号才可用。尚未绑定微信号的帐号可以进行绑定邀请操作,邀请未失效时不能对该帐号进行再次绑定微信号邀请。
 List<MediaItem> listAllMaterialMedia(MediaType mediaType)
          获取全部的媒体素材
 List<KfAccount> listKfAccount()
          获取公众号中所设置的客服基本信息,包括客服工号、客服昵称、客服登录账号
 List<KfSession> listKfSession(String kfAccount)
          获取客服的会话列表:获取某个客服正在接待的会话列表。
 KfSession.KfSessionCounter listKfWaitSession()
          获取未接入会话列表:获取当前正在等待队列中的会话列表,此接口最多返回最早进入队列的100个未接入会话
 MediaRecord listMaterialMedia(MediaType mediaType, Pageable pageable)
          获取媒体素材记录列表
 List<KfOnlineAccount> listOnlineKfAccount()
          获取在线客服在线状态(手机在线、PC客户端在线、手机和PC客户端全都在线)、客服自动接入最大值、 客服当前接待客户数
 List<Tag> listTags()
          获取标签
 String[] massArticleByGroupId(List<MpArticle> articles, int groupId)
          分组ID群发图文消息
 String[] massArticleByOpenIds(List<MpArticle> articles, String... openIds)
          根据openid群发图文消息
 String[] massArticleByTagId(List<MpArticle> articles, int tagId)
          标签群发图文消息
 String[] massByGroupId(MassTuple tuple, boolean isToAll, int groupId)
          群发消息
 String[] massByOpenIds(MassTuple tuple, String... openIds)
          openId群发
 String[] massByTagId(MassTuple tuple, boolean isToAll, int tagId)
          标签群发
 List<Button> matchCustomMenu(String userId)
          测试个性化菜单匹配结果
 ApiResult modifyGroup(int groupId, String name)
          修改分组名
 ApiResult moveGroup(int groupId, String... openIds)
          批量移动分组
 ApiResult moveGroup(int groupId, String openId)
          移动用户到分组
 ApiResult previewMassNews(String toUser, String toWxName, MassTuple tuple)
          预览群发消息
开发者可通过该接口发送消息给指定用户,在手机端查看消息的样式和排版
 ApiResult remarkUserName(String openId, String remark)
          设置用户备注名
 SemResult semantic(SemQuery semQuery)
          语义理解
 ApiResult sendNotify(NotifyMessage notify)
          发送客服消息(在48小时内不限制发送次数)
 ApiResult sendNotify(NotifyMessage notify, String kfAccount)
          发送客服消息(在48小时内不限制发送次数)
 String sendTmplMessage(TemplateMessage tplMessage)
          发送模板消息
 ApiResult setCardPayCell(String cardId, boolean isOpen)
          设置卡券买单:创建卡券之后,开发者可以通过设置微信买单接口设置该card_id支持微信买单功能。值得开发者注意的是, 设置买单的card_id必须已经配置了门店,否则会报错。
 ApiResult setCardSelfConsumeCell(String cardId, boolean isOpen)
          设置自助核销:创建卡券之后,开发者可以通过设置微信买单接口设置该card_id支持自助核销功能。值得开发者注意的是, 设置自助核销的card_id必须已经配置了门店,否则会报错。
 ApiResult setTmplIndustry(IndustryType... industryTypes)
          设置所属行业(每月可修改行业1次,账号仅可使用所属行业中相关的模板)
 ApiResult taggingUsers(int tagId, String... openIds)
          批量为用户打标签:标签功能目前支持公众号为用户打上最多三个标签
 ApiResult untaggingUsers(int tagId, String... openIds)
          批量为用户取消标签
 ApiResult updateKfAccount(String id, String name, String pwd)
          更新客服账号
 ApiResult updateMaterialArticle(String mediaId, int index, MpArticle article)
          更新永久图文素材
 ApiResult updateTag(Tag tag)
          更新标签
 String uploadImage(InputStream is, String fileName)
          上传图文消息内的图片获取URL 请注意,本接口所上传的图片不占用公众号的素材库中图片数量的5000个的限制。图片仅支持jpg/png格式,大小必须在1MB以下。
 ApiResult uploadKfAvatar(String accountId, InputStream is, String fileName)
          上传客服头像
 String uploadMassArticle(List<MpArticle> articles)
          上传群发的图文消息,一个图文消息支持1到10条图文
 String uploadMaterialArticle(List<MpArticle> articles)
          上传永久图文素材
 String uploadMaterialVideo(InputStream is, String fileName, String title, String introduction)
          上传永久视频素材
 MediaUploadResult uploadMedia(boolean isMaterial, InputStream is, String fileName)
          上传媒体文件
此接口只包含图片、语音、缩略图、视频(临时)四种媒体类型的上传
 MpVideo uploadVideo(InputStream is, String fileName, String title, String description)
          上传群发中的视频素材
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final String VERSION
See Also:
Constant Field Values
Constructor Detail

WeixinProxy

public WeixinProxy()
微信接口实现(使用weixin4j.properties配置的account账号信息, 使用FileCacheStorager文件方式缓存TOKEN)


WeixinProxy

public WeixinProxy(CacheStorager<Token> cacheStorager)
微信接口实现(使用weixin4j.properties配置的account账号信息)

Parameters:
cacheStorager - token管理

WeixinProxy

public WeixinProxy(WeixinAccount weixinAccount,
                   CacheStorager<Token> cacheStorager)
微信接口实现

Parameters:
weixinAccount - 账号信息
cacheStorager - token管理

WeixinProxy

public WeixinProxy(PerTicketManager perTicketManager,
                   TokenManager componentTokenManager)
第三方组件方式创建微信接口实现(永久刷新令牌机制)

Parameters:
perTicketManager - 第三方组件永久刷新token
componentTokenManager - 第三方组件凭证token
See Also:
ComponentApi, com.foxinmy.weixin4j.mp.api.ComponentApi#getPerCodeManager(String), ComponentApi.getTokenManager()
Method Detail

getWeixinAccount

public WeixinAccount getWeixinAccount()
获取微信账号信息

Returns:

getTokenManager

public TokenManager getTokenManager()
token管理

Returns:

getOauthApi

public OauthApi getOauthApi()
获取oauth授权API

Returns:
See Also:
OauthApi

getTicketManager

public TokenManager getTicketManager(TicketType ticketType)
获取JSSDK Ticket的tokenManager

Parameters:
ticketType - 票据类型
Returns:

uploadImage

public String uploadImage(InputStream is,
                          String fileName)
                   throws WeixinException
上传图文消息内的图片获取URL 请注意,本接口所上传的图片不占用公众号的素材库中图片数量的5000个的限制。图片仅支持jpg/png格式,大小必须在1MB以下。

Parameters:
is - 图片数据流
fileName - 文件名 为空时将自动生成
Returns:
图片URL 可用于后续群发中,放置到图文消息中
Throws:
WeixinException
See Also:
MediaApi

uploadVideo

public MpVideo uploadVideo(InputStream is,
                           String fileName,
                           String title,
                           String description)
                    throws WeixinException
上传群发中的视频素材

Parameters:
is - 图片数据流
fileName - 文件名 为空时将自动生成
title - 视频标题 非空
description - 视频描述 可为空
Returns:
群发视频消息对象
Throws:
WeixinException
See Also:
MediaApi, 高级群发, MpVideo

uploadMedia

public MediaUploadResult uploadMedia(boolean isMaterial,
                                     InputStream is,
                                     String fileName)
                              throws WeixinException
上传媒体文件
此接口只包含图片、语音、缩略图、视频(临时)四种媒体类型的上传

Parameters:
isMaterial - 是否永久上传
is - 媒体数据流
fileName - 文件名 为空时将自动生成
Returns:
上传到微信服务器返回的媒体标识
Throws:
WeixinException
See Also:
上传临时素材, 上传永久素材, MediaUploadResult, MediaType, MediaApi

downloadMedia

public MediaDownloadResult downloadMedia(String mediaId,
                                         boolean isMaterial)
                                  throws WeixinException
下载媒体文件

Parameters:
mediaId - 媒体ID
isMaterial - 是否永久素材
Returns:
媒体文件下载结果
Throws:
WeixinException
See Also:
MediaApi, MediaDownloadResult, 下载临时媒体素材, 下载永久媒体素材

uploadMaterialArticle

public String uploadMaterialArticle(List<MpArticle> articles)
                             throws WeixinException
上传永久图文素材

、新增的永久素材也可以在公众平台官网素材管理模块中看到,永久素材的数量是有上限的,请谨慎新增。图文消息素材和图片素材的上限为5000, 其他类型为1000

Parameters:
articles - 图文列表
Returns:
上传到微信服务器返回的媒体标识
Throws:
WeixinException
See Also:
MediaApi, MpArticle, 上传永久媒体素材

downloadArticle

public List<MpArticle> downloadArticle(String mediaId)
                                throws WeixinException
下载永久图文素材

Parameters:
mediaId - 媒体ID
Returns:
图文列表
Throws:
WeixinException
See Also:
#downloadMedia(String, boolean)}, MpArticle, MediaApi

updateMaterialArticle

public ApiResult updateMaterialArticle(String mediaId,
                                       int index,
                                       MpArticle article)
                                throws WeixinException
更新永久图文素材

Parameters:
mediaId - 要修改的图文消息的id
index - 要更新的文章在图文消息中的位置(多图文消息时,此字段才有意义),第一篇为0
article - 图文对象
Returns:
处理结果
Throws:
WeixinException
See Also:
MediaApi, MpArticle, 更新永久图文素材

deleteMaterialMedia

public ApiResult deleteMaterialMedia(String mediaId)
                              throws WeixinException
删除永久媒体素材

Parameters:
mediaId - 媒体素材的media_id
Returns:
处理结果
Throws:
WeixinException
See Also:
MediaApi, 删除永久媒体素材

uploadMaterialVideo

public String uploadMaterialVideo(InputStream is,
                                  String fileName,
                                  String title,
                                  String introduction)
                           throws WeixinException
上传永久视频素材

Parameters:
is - 大小不超过1M且格式为MP4的视频文件
fileName - 文件名 为空时将自动生成
title - 视频标题
introduction - 视频描述
Returns:
上传到微信服务器返回的媒体标识
Throws:
WeixinException
See Also:
上传永久媒体素材, MediaApi

countMaterialMedia

public MediaCounter countMaterialMedia()
                                throws WeixinException
获取永久媒体素材的总数
.图片和图文消息素材(包括单图文和多图文)的总数上限为5000,其他素材的总数上限为1000

Returns:
总数对象
Throws:
WeixinException
See Also:
com.com.foxinmy.weixin4j.model.media.MediaCounter, 获取素材总数, MediaApi

listMaterialMedia

public MediaRecord listMaterialMedia(MediaType mediaType,
                                     Pageable pageable)
                              throws WeixinException
获取媒体素材记录列表

Parameters:
mediaType - 素材的类型,图片(image)、视频(video)、语音 (voice)、图文(news)
pageable - 分页数据
Returns:
媒体素材的记录对象
Throws:
WeixinException
See Also:
MediaApi, com.com.foxinmy.weixin4j.model.media.MediaRecord, MediaType, MediaItem, Pageable, Pagedata, 获取素材列表

listAllMaterialMedia

public List<MediaItem> listAllMaterialMedia(MediaType mediaType)
                                     throws WeixinException
获取全部的媒体素材

Parameters:
mediaType - 媒体类型
Returns:
素材列表
Throws:
WeixinException
See Also:
MediaApi, #listMaterialMedia(MediaType, Pageable)}

sendNotify

public ApiResult sendNotify(NotifyMessage notify)
                     throws WeixinException
发送客服消息(在48小时内不限制发送次数)

Parameters:
notify - 客服消息对象
Returns:
处理结果
Throws:
WeixinException
See Also:
#sendNotify(NotifyMessage,String) }

sendNotify

public ApiResult sendNotify(NotifyMessage notify,
                            String kfAccount)
                     throws WeixinException
发送客服消息(在48小时内不限制发送次数)

Parameters:
notify - 客服消息对象
kfAccount - 客服账号 可为空
Returns:
处理结果
Throws:
WeixinException
See Also:
发送客服消息, Text, Image, Voice, Video, Music, News, NotifyApi

getKfChatRecord

public List<KfChatRecord> getKfChatRecord(Date startTime,
                                          Date endTime,
                                          int number)
                                   throws WeixinException
客服聊天记录

Parameters:
startTime - 查询开始时间
endTime - 查询结束时间 每次查询不能跨日查询
number - 最多10000条
Throws:
WeixinException
See Also:
com.foxinmy.weixin4j.mp.model.CustomRecord, CustomApi, 查询客服聊天记录, 查询客服聊天记录

listKfAccount

public List<KfAccount> listKfAccount()
                              throws WeixinException
获取公众号中所设置的客服基本信息,包括客服工号、客服昵称、客服登录账号

Returns:
多客服信息列表
Throws:
WeixinException
See Also:
KfAccount, CustomApi, 获取客服基本信息

listOnlineKfAccount

public List<KfOnlineAccount> listOnlineKfAccount()
                                          throws WeixinException
获取在线客服在线状态(手机在线、PC客户端在线、手机和PC客户端全都在线)、客服自动接入最大值、 客服当前接待客户数

Returns:
多客服在线信息列表
Throws:
WeixinException
See Also:
KfOnlineAccount, CustomApi, 获取客服在线信息

createKfAccount

public ApiResult createKfAccount(String id,
                                 String name,
                                 String pwd)
                          throws WeixinException
新增客服账号

Parameters:
id - 完整客服账号,格式为:账号前缀@公众号微信号,账号前缀最多10个字符,必须是英文或者数字字符。如果没有公众号微信号, 请前往微信公众平台设置。
name - 客服昵称,最长6个汉字或12个英文字符
pwd - 客服账号登录密码
Returns:
处理结果
Throws:
WeixinException
See Also:
客服管理接口返回码, 新增客服账号

updateKfAccount

public ApiResult updateKfAccount(String id,
                                 String name,
                                 String pwd)
                          throws WeixinException
更新客服账号

Parameters:
id - 完整客服账号,格式为:账号前缀@公众号微信号,账号前缀最多10个字符,必须是英文或者数字字符。如果没有公众号微信号, 请前往微信公众平台设置。
name - 客服昵称,最长6个汉字或12个英文字符
pwd - 客服账号登录密码
Returns:
处理结果
Throws:
WeixinException
See Also:
CustomApi, 更新客服账号

inviteKfAccount

public ApiResult inviteKfAccount(String kfAccount,
                                 String inviteAccount)
                          throws WeixinException
邀请绑定客服帐号 新添加的客服帐号是不能直接使用的,只有客服人员用微信号绑定了客服账号后,方可登录Web客服进行操作。此接口发起一个绑定邀请到客服人员微信号 ,客服人员需要在微信客户端上用该微信号确认后帐号才可用。尚未绑定微信号的帐号可以进行绑定邀请操作,邀请未失效时不能对该帐号进行再次绑定微信号邀请。

Parameters:
kfAccount - 完整客服帐号,格式为:帐号前缀@公众号微信号
inviteAccount - 接收绑定邀请的客服微信号
Returns:
处理结果
Throws:
WeixinException
See Also:
CustomApi, 邀请绑定客服帐号

uploadKfAvatar

public ApiResult uploadKfAvatar(String accountId,
                                InputStream is,
                                String fileName)
                         throws WeixinException
上传客服头像

Parameters:
accountId - 完整客服账号,格式为:账号前缀@公众号微信号
is - 头像图片文件必须是jpg格式,推荐使用640*640大小的图片以达到最佳效果
fileName - 文件名 为空时将自动生成
Returns:
处理结果
Throws:
WeixinException
See Also:
CustomApi, 上传客服头像

deleteKfAccount

public ApiResult deleteKfAccount(String id)
                          throws WeixinException
删除客服账号

Parameters:
id - 完整客服账号,格式为:账号前缀@公众号微信号
Returns:
处理结果
Throws:
WeixinException
See Also:
CustomApi, 删除客服账号

createKfSession

public ApiResult createKfSession(String userOpenId,
                                 String kfAccount,
                                 String text)
                          throws WeixinException
创建客服会话

开发者可以使用本接口,为多客服的客服工号创建会话,将某个客户直接指定给客服工号接待,需要注意此接口不会受客服自动接入数以及自动接入开关限制。 只能为在线的客服(PC客户端在线,或者已绑定多客服助手)创建会话。

Parameters:
userOpenId - 用户的userOpenId
kfAccount - 完整客服账号,格式为:账号前缀@公众号微信号
text - 附加信息,文本会展示在客服人员的多客服客户端
Returns:
处理结果
Throws:
WeixinException
See Also:
CustomApi, 创建会话

closeKfSession

public ApiResult closeKfSession(String userOpenId,
                                String kfAccount,
                                String text)
                         throws WeixinException
关闭客服会话

Parameters:
userOpenId - 用户的userOpenId
kfAccount - 完整客服账号,格式为:账号前缀@公众号微信号
text - 附加信息,文本会展示在客服人员的多客服客户端
Returns:
处理结果
Throws:
WeixinException
See Also:
CustomApi, 关闭会话

getKfSession

public KfSession getKfSession(String userOpenId)
                       throws WeixinException
获取客户的会话状态:获取客户当前的会话状态。

Parameters:
userOpenId - 用户的openid
Returns:
会话对象
Throws:
WeixinException
See Also:
CustomApi, KfSession, 获取会话状态

listKfSession

public List<KfSession> listKfSession(String kfAccount)
                              throws WeixinException
获取客服的会话列表:获取某个客服正在接待的会话列表。

Parameters:
kfAccount - 完整客服账号,格式为:账号前缀@公众号微信号,账号前缀最多10个字符,必须是英文或者数字字符。
Returns:
会话列表
Throws:
WeixinException
See Also:
CustomApi, KfSession, 获取客服的会话列表

listKfWaitSession

public KfSession.KfSessionCounter listKfWaitSession()
                                             throws WeixinException
获取未接入会话列表:获取当前正在等待队列中的会话列表,此接口最多返回最早进入队列的100个未接入会话

Returns:
会话列表
Throws:
WeixinException
See Also:
CustomApi, KfSession, KfSession.KfSessionCounter, 获取客服的会话列表

uploadMassArticle

public String uploadMassArticle(List<MpArticle> articles)
                         throws WeixinException
上传群发的图文消息,一个图文消息支持1到10条图文

Parameters:
articles - 图片消息
Returns:
媒体ID
Throws:
WeixinException
See Also:
上传图文素材, MpArticle, MassApi

massByGroupId

public String[] massByGroupId(MassTuple tuple,
                              boolean isToAll,
                              int groupId)
                       throws WeixinException
群发消息

在返回成功时,意味着群发任务提交成功,并不意味着此时群发已经结束,所以,仍有可能在后续的发送过程中出现异常情况导致用户未收到消息, 如消息有时会进行审核、服务器不稳定等,此外,群发任务一般需要较长的时间才能全部发送完毕

Parameters:
MassTuple - 消息元件
isToAll - 用于设定是否向全部用户发送,值为true或false,选择true该消息群发给所有用户, 选择false可根据group_id发送给指定群组的用户
groupId - 分组ID
Returns:
第一个元素为消息发送任务的ID,第二个元素为消息的数据ID,该字段只有在群发图文消息时,才会出现,可以用于在图文分析数据接口中
Throws:
WeixinException
See Also:
Group, Text, Image, Voice, MpVideo, MpNews, MassApi, MassTuple, #getGroups()}, 根据分组群发

massArticleByGroupId

public String[] massArticleByGroupId(List<MpArticle> articles,
                                     int groupId)
                              throws WeixinException
分组ID群发图文消息

Parameters:
articles - 图文列表
groupId - 分组ID
Returns:
第一个元素为消息发送任务的ID,第二个元素为消息的数据ID,该字段只有在群发图文消息时,才会出现,可以用于在图文分析数据接口中
Throws:
WeixinException
See Also:
#massByGroupId(Tuple,int)}, 根据分组群发, MpArticle

massByTagId

public String[] massByTagId(MassTuple tuple,
                            boolean isToAll,
                            int tagId)
                     throws WeixinException
标签群发

在返回成功时,意味着群发任务提交成功,并不意味着此时群发已经结束,所以,仍有可能在后续的发送过程中出现异常情况导致用户未收到消息, 如消息有时会进行审核、服务器不稳定等,此外,群发任务一般需要较长的时间才能全部发送完毕

Parameters:
tuple - 消息元件
isToAll - 用于设定是否向全部用户发送,值为true或false,选择true该消息群发给所有用户, 选择false可根据group_id发送给指定群组的用户
tagId - 标签ID
Returns:
第一个元素为消息发送任务的ID,第二个元素为消息的数据ID,该字段只有在群发图文消息时,才会出现,可以用于在图文分析数据接口中
Throws:
WeixinException
See Also:
Tag, Text, Image, Voice, MpVideo, MpNews, Card, MassTuple, TagApi#listTags()}, 根据标签群发

massArticleByTagId

public String[] massArticleByTagId(List<MpArticle> articles,
                                   int tagId)
                            throws WeixinException
标签群发图文消息

Parameters:
articles - 图文列表
tagId - 标签ID
Returns:
第一个元素为消息发送任务的ID,第二个元素为消息的数据ID,该字段只有在群发图文消息时,才会出现。
Throws:
WeixinException
See Also:
根据标签群发, #massByTagId(Tuple,int)}, MpArticle

massByOpenIds

public String[] massByOpenIds(MassTuple tuple,
                              String... openIds)
                       throws WeixinException
openId群发

在返回成功时,意味着群发任务提交成功,并不意味着此时群发已经结束,所以,仍有可能在后续的发送过程中出现异常情况导致用户未收到消息, 如消息有时会进行审核、服务器不稳定等,此外,群发任务一般需要较长的时间才能全部发送完毕

Parameters:
tuple - 消息元件
openIds - openId列表
Returns:
第一个元素为消息发送任务的ID,第二个元素为消息的数据ID,该字段只有在群发图文消息时,才会出现,可以用于在图文分析数据接口中
Throws:
WeixinException
See Also:
User, Text, Image, Voice, MpVideo, MpNews, MassApi, MassTuple, 根据openid群发, #getUser(String)}

massArticleByOpenIds

public String[] massArticleByOpenIds(List<MpArticle> articles,
                                     String... openIds)
                              throws WeixinException
根据openid群发图文消息

Parameters:
articles - 图文列表
openIds - openId列表
Returns:
第一个元素为消息发送任务的ID,第二个元素为消息的数据ID,该字段只有在群发图文消息时,才会出现,可以用于在图文分析数据接口中
Throws:
WeixinException
See Also:
根据openid群发, #massByOpenIds(Tuple,String...)}, MpArticle

deleteMassNews

public ApiResult deleteMassNews(String msgid)
                         throws WeixinException
删除群发消息

请注意,只有已经发送成功的消息才能删除删除消息只是将消息的图文详情页失效,已经收到的用户,还是能在其本地看到消息卡片

Parameters:
msgid - 发送出去的消息ID
Throws:
WeixinException
See Also:
删除群发, MassApi, #massByGroupId(Tuple, int)}, #massByOpenIds(Tuple, String...)

previewMassNews

public ApiResult previewMassNews(String toUser,
                                 String toWxName,
                                 MassTuple tuple)
                          throws WeixinException
预览群发消息
开发者可通过该接口发送消息给指定用户,在手机端查看消息的样式和排版

Parameters:
toUser - 接收用户的openID
toWxName - 接收用户的微信号 towxname和touser同时赋值时,以towxname优先
tuple - 消息元件
Returns:
处理结果
Throws:
WeixinException
See Also:
MassApi, MassTuple, 预览群发消息

getMassNewStatus

public String getMassNewStatus(String msgId)
                        throws WeixinException
查询群发发送状态

Parameters:
msgId - 消息ID
Returns:
消息发送状态
Throws:
WeixinException
See Also:
MassApi, 查询群发状态

getUser

public User getUser(String openId)
             throws WeixinException
获取用户信息

Parameters:
openId - 用户对应的ID
Returns:
用户对象
Throws:
WeixinException
See Also:
获取用户信息, User, UserApi, #getUser(String,Lang)}

getUser

public User getUser(String openId,
                    Lang lang)
             throws WeixinException
获取用户信息

在关注者与公众号产生消息交互后,公众号可获得关注者的OpenID(加密后的微信号,每个用户对每个公众号的OpenID是唯一的,对于不同公众号, 同一用户的openid不同),公众号可通过本接口来根据OpenID获取用户基本信息,包括昵称、头像、性别、所在城市、语言和关注时间

Parameters:
openId - 用户对应的ID
lang - 国家地区语言版本
Returns:
用户对象
Throws:
WeixinException
See Also:
获取用户信息, Lang, User, UserApi

getUsers

public List<User> getUsers(String... openIds)
                    throws WeixinException
批量获取用户信息

Parameters:
openIds - 用户ID
Returns:
用户列表
Throws:
WeixinException
See Also:
获取用户信息, User, UserApi, #getUsers(Lang,String[])}

getUsers

public List<User> getUsers(Lang lang,
                           String... openIds)
                    throws WeixinException
批量获取用户信息

Parameters:
lang - 国家地区语言版本
openIds - 用户ID
Returns:
用户列表
Throws:
WeixinException
See Also:
获取用户信息, Lang, User, UserApi

getFollowing

public Following getFollowing(String nextOpenId)
                       throws WeixinException
获取公众号一定数量(10000)的关注者列表 请慎重使用

Parameters:
nextOpenId - 下一次拉取数据的openid 不填写则默认从头开始拉取
Returns:
关注者信息 包含用户的详细信息
Throws:
WeixinException
See Also:
获取关注者列表, 批量获取用户信息, UserApi, Following, User

getFollowingOpenIds

public Following getFollowingOpenIds(String nextOpenId)
                              throws WeixinException
获取公众号一定数量(10000)的关注者列表

Parameters:
nextOpenId - 下一次拉取数据的openid 不填写则默认从头开始拉取
Returns:
关注者信息 不包含用户的详细信息
Throws:
WeixinException
See Also:
获取关注者列表, UserApi, Following

getAllFollowing

public List<User> getAllFollowing()
                           throws WeixinException
获取公众号全部的关注者列表 请慎重使用

当公众号关注者数量超过10000时,可通过填写next_openid的值,从而多次拉取列表的方式来满足需求, 将上一次调用得到的返回中的next_openid值,作为下一次调用中的next_openid值

Returns:
用户对象集合
Throws:
WeixinException
See Also:
获取关注者列表, 批量获取用户信息, UserApi, Following, User, getFollowing(String)

getAllFollowingOpenIds

public List<String> getAllFollowingOpenIds()
                                    throws WeixinException
获取公众号全部的关注者列表 请慎重使用

当公众号关注者数量超过10000时,可通过填写next_openid的值,从而多次拉取列表的方式来满足需求, 将上一次调用得到的返回中的next_openid值,作为下一次调用中的next_openid值

Returns:
用户openid集合
Throws:
WeixinException
See Also:
获取关注者列表, UserApi, getFollowingOpenIds(String)

remarkUserName

public ApiResult remarkUserName(String openId,
                                String remark)
                         throws WeixinException
设置用户备注名

Parameters:
openId - 用户ID
remark - 备注名
Throws:
WeixinException
See Also:
设置用户备注名, UserApi

createGroup

public Group createGroup(String name)
                  throws WeixinException
创建分组

Parameters:
name - 组名称
Returns:
group对象
Throws:
WeixinException
See Also:
创建分组, Group, Group.toCreateJson(), GroupApi

getGroups

public List<Group> getGroups()
                      throws WeixinException
查询所有分组

Returns:
组集合
Throws:
WeixinException
See Also:
查询所有分组, Group, GroupApi

getGroupByOpenId

public int getGroupByOpenId(String openId)
                     throws WeixinException
查询用户所在分组

Parameters:
openId - 用户对应的ID
Returns:
组ID
Throws:
WeixinException
See Also:
查询用户所在分组, Group, GroupApi

modifyGroup

public ApiResult modifyGroup(int groupId,
                             String name)
                      throws WeixinException
修改分组名

Parameters:
groupId - 组ID
name - 组名称
Throws:
WeixinException
See Also:
修改分组名, Group, GroupApi

moveGroup

public ApiResult moveGroup(int groupId,
                           String openId)
                    throws WeixinException
移动用户到分组

Parameters:
groupId - 组ID
openId - 用户对应的ID
Throws:
WeixinException
See Also:
移动分组, Group, GroupApi

moveGroup

public ApiResult moveGroup(int groupId,
                           String... openIds)
                    throws WeixinException
批量移动分组

Parameters:
groupId - 组ID
openIds - 用户ID列表(不能超过50个)
Throws:
WeixinException
See Also:
批量移动分组, Group, GroupApi

deleteGroup

public ApiResult deleteGroup(int groupId)
                      throws WeixinException
删除用户分组,所有该分组内的用户自动进入默认分组.

Parameters:
groupId - 组ID
Throws:
WeixinException
See Also:
删除用户分组, Group, GroupApi

createMenu

public ApiResult createMenu(List<Button> buttons)
                     throws WeixinException
自定义菜单

Parameters:
buttons - 菜单列表
Throws:
WeixinException
See Also:
创建自定义菜单, Button, ButtonType, MenuApi

getMenu

public List<Button> getMenu()
                     throws WeixinException
查询菜单

Returns:
菜单集合
Throws:
WeixinException
See Also:
查询菜单, Button, MenuApi

getAllMenu

public List<Menu> getAllMenu()
                      throws WeixinException
查询全部菜单(包含个性化菜单)

Returns:
菜单集合
Throws:
WeixinException
See Also:
普通菜单, 个性化菜单, Button, Menu, MenuApi

deleteMenu

public ApiResult deleteMenu()
                     throws WeixinException
删除菜单

Returns:
处理结果
Throws:
WeixinException
See Also:
删除菜单, MenuApi

createCustomMenu

public String createCustomMenu(List<Button> buttons,
                               MenuMatchRule matchRule)
                        throws WeixinException
创建个性化菜单

Parameters:
buttons - 菜单列表
matchRule - 匹配规则 至少要有一个匹配信息是不为空
Returns:
菜单ID
Throws:
WeixinException
See Also:
创建个性化菜单, MenuApi, Button

deleteCustomMenu

public ApiResult deleteCustomMenu(String menuId)
                           throws WeixinException
删除个性化菜单

Returns:
处理结果
Throws:
WeixinException
See Also:
删除个性化菜单, MenuApi

matchCustomMenu

public List<Button> matchCustomMenu(String userId)
                             throws WeixinException
测试个性化菜单匹配结果

Parameters:
userId - 可以是粉丝的OpenID,也可以是粉丝的微信号。
Returns:
匹配到的菜单配置
Throws:
WeixinException
See Also:
测试个性化菜单, Button, MenuApi

createQR

public QRResult createQR(QRParameter parameter)
                  throws WeixinException
生成带参数的二维码

Parameters:
parameter - 二维码参数
Returns:
二维码结果对象
Throws:
WeixinException
See Also:
QRResult, QRParameter, QrApi, 生成二维码

setTmplIndustry

public ApiResult setTmplIndustry(IndustryType... industryTypes)
                          throws WeixinException
设置所属行业(每月可修改行业1次,账号仅可使用所属行业中相关的模板)

Parameters:
industryTypes - 所处行业 目前不超过两个
Returns:
操作结果
Throws:
WeixinException
See Also:
IndustryType, TmplApi, 设置所处行业

getTemplateId

public String getTemplateId(String shortId)
                     throws WeixinException
获取模板ID

Parameters:
shortId - 模板库中模板的编号,有“TM**”和“OPENTMTM**”等形式
Returns:
模板ID
Throws:
WeixinException
See Also:
获得模板ID, TmplApi

getAllTemplates

public List<TemplateMessageInfo> getAllTemplates()
                                          throws WeixinException
获取模板列表

Returns:
模板列表
Throws:
WeixinException
See Also:
TemplateMessageInfo, 获取模板列表, TmplApi

deleteTemplate

public ApiResult deleteTemplate(String templateId)
                         throws WeixinException
删除模板

Parameters:
templateId - 公众帐号下模板消息ID
Returns:
处理结果
Throws:
WeixinException
See Also:
删除模板, TmplApi

sendTmplMessage

public String sendTmplMessage(TemplateMessage tplMessage)
                       throws WeixinException
发送模板消息

Parameters:
tplMessage - 模板消息主体
Returns:
发送的消息ID
Throws:
WeixinException
See Also:
模板消息, 运营规范, TemplateMessage, TmplApi

getShorturl

public String getShorturl(String url)
                   throws WeixinException
长链接转短链接

Parameters:
url - 待转换的链接
Returns:
短链接
Throws:
WeixinException
See Also:
长链接转短链接, HelperApi

semantic

public SemResult semantic(SemQuery semQuery)
                   throws WeixinException
语义理解

Parameters:
semQuery - 语义理解协议
Returns:
语义理解结果
Throws:
WeixinException
See Also:
SemQuery, SemResult, 语义理解, HelperApi

getWechatServerIp

public List<String> getWechatServerIp()
                               throws WeixinException
获取微信服务器IP地址

Returns:
IP地址
Throws:
WeixinException
See Also:
获取IP地址, HelperApi

clearQuota

public ApiResult clearQuota()
                     throws WeixinException
接口调用次数调用清零:公众号调用接口并不是无限制的。为了防止公众号的程序错误而引发微信服务器负载异常,默认情况下, 每个公众号调用接口都不能超过一定限制 ,当超过一定限制时,调用对应接口会收到{"errcode":45009,"errmsg":"api freq out of limit" }错误返回码。

Returns:
操作结果
Throws:
WeixinException
See Also:
接口清零, HelperApi

getMenuSetting

public MenuSetting getMenuSetting()
                           throws WeixinException
获取公众号当前使用的自定义菜单的配置,如果公众号是通过API调用设置的菜单,则返回菜单的开发配置, 而如果公众号是在公众平台官网通过网站功能发布菜单,则本接口返回运营者设置的菜单配置。

Returns:
菜单集合
Throws:
WeixinException
See Also:
#getMenu()}, 获取自定义菜单配置, Button, MpArticle, HelperApi

getAutoReplySetting

public AutoReplySetting getAutoReplySetting()
                                     throws WeixinException
获取公众号当前使用的自动回复规则,包括关注后自动回复、消息自动回复(60分钟内触发一次)、关键词自动回复。

Throws:
WeixinException
See Also:
AutoReplySetting, HelperApi, 获取自动回复规则

datacube

public List<?> datacube(DatacubeType datacubeType,
                        Date beginDate,
                        Date endDate)
                 throws WeixinException
数据统计

Parameters:
datacubeType - 数据统计类型
beginDate - 获取数据的起始日期,begin_date和end_date的差值需小于“最大时间跨度”(比如最大时间跨度为1时, begin_date和end_date的差值只能为0,才能小于1),否则会报错
endDate - 获取数据的结束日期,end_date允许设置的最大值为昨日
Returns:
统计结果
Throws:
WeixinException
See Also:
DataApi, UserSummary, ArticleSummary, ArticleTotal, ArticleDatacubeShare, UpstreamMsg, UpstreamMsgDist, InterfaceSummary, 用户分析, 图文分析, 消息分析, 接口分析

datacube

public List<?> datacube(DatacubeType datacubeType,
                        Date beginDate,
                        int offset)
                 throws WeixinException
数据统计

Parameters:
datacubeType - 统计类型
beginDate - 开始日期
offset - 增量 表示向前几天 比如 offset=1 则查询 beginDate的后一天之间的数据
Throws:
WeixinException
See Also:
#datacube(DatacubeType, Date,Date)}, DataApi

datacube

public List<?> datacube(DatacubeType datacubeType,
                        int offset,
                        Date endDate)
                 throws WeixinException
数据统计

Parameters:
datacubeType - 统计类型
offset - 增量 表示向后几天 比如 offset=1 则查询 beginDate的前一天之间的数据
endDate - 截至日期
Throws:
WeixinException
See Also:
#datacube(DatacubeType, Date,Date)}, DataApi

datacube

public List<?> datacube(DatacubeType datacubeType,
                        Date date)
                 throws WeixinException
查询日期跨度为0的统计数据(当天)

Parameters:
datacubeType - 统计类型
date - 统计日期
Throws:
WeixinException
See Also:
#datacube(DatacubeType, Date,Date)}, DataApi

createTag

public Tag createTag(String name)
              throws WeixinException
创建标签

Parameters:
name - 标签名(30个字符以内)
Returns:
标签对象
Throws:
WeixinException
See Also:
TagApi, Tag, 创建标签

listTags

public List<Tag> listTags()
                   throws WeixinException
获取标签

Returns:
标签列表
Throws:
WeixinException
See Also:
TagApi, Tag, 获取标签

updateTag

public ApiResult updateTag(Tag tag)
                    throws WeixinException
更新标签

Parameters:
tag - 标签对象
Returns:
操作结果
Throws:
WeixinException
See Also:
TagApi, Tag, 更新标签

deleteTag

public ApiResult deleteTag(int tagId)
                    throws WeixinException
删除标签

Parameters:
tagId - 标签id
Returns:
操作结果
Throws:
WeixinException
See Also:
TagApi, 删除标签

taggingUsers

public ApiResult taggingUsers(int tagId,
                              String... openIds)
                       throws WeixinException
批量为用户打标签:标签功能目前支持公众号为用户打上最多三个标签

Parameters:
tagId - 标签ID
openIds - 用户ID
Returns:
操作结果
Throws:
WeixinException
See Also:
TagApi, 批量为用户打标签

untaggingUsers

public ApiResult untaggingUsers(int tagId,
                                String... openIds)
                         throws WeixinException
批量为用户取消标签

Parameters:
tagId - 标签ID
openIds - 用户ID
Returns:
操作结果
Throws:
WeixinException
See Also:
TagApi, 批量为用户取消标签

getTagFollowingOpenIds

public Following getTagFollowingOpenIds(int tagId,
                                        String nextOpenId)
                                 throws WeixinException
获取标签下粉丝列表

Parameters:
tagId - 标签ID
nextOpenId - 第一个拉取的OPENID,不填默认从头开始拉取
Returns:
用户openid列表
Throws:
WeixinException
See Also:
TagApi, 获取标签下粉丝列表

getTagFollowing

public Following getTagFollowing(int tagId,
                                 String nextOpenId)
                          throws WeixinException
获取标签下粉丝列表 请慎重使用

Parameters:
tagId - 标签ID
nextOpenId - 第一个拉取的OPENID,不填默认从头开始拉取
Returns:
被打标签者信息 包含用户的详细信息
Throws:
WeixinException
See Also:
TagApi, 获取标签下粉丝列表

getAllTagFollowingOpenIds

public List<String> getAllTagFollowingOpenIds(int tagId)
                                       throws WeixinException
获取标签下全部的粉丝列表 请慎重使用

Parameters:
tagId - 标签ID
Returns:
用户openid列表
Throws:
WeixinException
See Also:
TagApi, getTagFollowingOpenIds(int,String), 获取标签下粉丝列表

getAllTagFollowing

public List<User> getAllTagFollowing(int tagId)
                              throws WeixinException
获取标签下全部的粉丝列表 请慎重使用

Parameters:
tagId - 标签ID
Returns:
被打标签者信息 包含用户的详细信息
Throws:
WeixinException
See Also:
TagApi, getTagFollowing(int,String), 获取标签下粉丝列表

getUserTags

public Integer[] getUserTags(String openId)
                      throws WeixinException
获取用户身上的标签列表

Parameters:
openId - 用户ID
Returns:
标签ID集合
Throws:
WeixinException
See Also:
TagApi, 获取用户身上的标签列表

getBalcklistOpenIds

public Following getBalcklistOpenIds(String nextOpenId)
                              throws WeixinException
获取公众号的黑名单列表

Parameters:
nextOpenId - 下一次拉取数据的openid 不填写则默认从头开始拉取
Returns:
拉黑用户列表 不包含用户的详细信息
Throws:
WeixinException
See Also:
获取黑名单列表, TagApi, Following

getAllBalcklistOpenIds

public List<String> getAllBalcklistOpenIds()
                                    throws WeixinException
获取公众号全部的黑名单列表 请慎重使用

当公众号关注者数量超过10000时,可通过填写next_openid的值,从而多次拉取列表的方式来满足需求, 将上一次调用得到的返回中的next_openid值,作为下一次调用中的next_openid值

Returns:
用户openid集合
Throws:
WeixinException
See Also:
TagApi, 获取黑名单列表, getFollowingOpenIds(String)

createCardCoupon

public String createCardCoupon(CardCoupon cardCoupon)
                        throws WeixinException
创建卡券:创建卡券接口是微信卡券的基础接口,用于创建一类新的卡券,获取card_id,创建成功并通过审核后, 商家可以通过文档提供的其他接口将卡券下发给用户,每次成功领取,库存数量相应扣除。
  • 1.需自定义Code码的商家必须在创建卡券时候,设定use_custom_code为true,且在调用投放卡券接口时填入指定的Code码。 指定OpenID同理。特别注意:在公众平台创建的卡券均为非自定义Code类型。
  • 2.can_share字段指领取卡券原生页面是否可分享,建议指定Code码、指定OpenID等强限制条件的卡券填写false。
  • 3.创建成功后该卡券会自动提交审核 ,审核结果将通过事件通知商户。开发者可调用设置白名单接口设置用户白名单,领取未通过审核的卡券,测试整个卡券的使用流程。

    Parameters:
    cardCoupon - 卡券对象
    Returns:
    卡券ID
    Throws:
    WeixinException
    See Also:
    创建卡券, CardCoupons, MediaApi.uploadImage(java.io.InputStream, String), CardApi

  • setCardPayCell

    public ApiResult setCardPayCell(String cardId,
                                    boolean isOpen)
                             throws WeixinException
    设置卡券买单:创建卡券之后,开发者可以通过设置微信买单接口设置该card_id支持微信买单功能。值得开发者注意的是, 设置买单的card_id必须已经配置了门店,否则会报错。

    Parameters:
    cardId - 卡券ID
    isOpen - 是否开启买单功能,填true/false
    Returns:
    操作结果
    Throws:
    WeixinException
    See Also:
    createCardCoupon(CardCoupon), CardApi

    setCardSelfConsumeCell

    public ApiResult setCardSelfConsumeCell(String cardId,
                                            boolean isOpen)
                                     throws WeixinException
    设置自助核销:创建卡券之后,开发者可以通过设置微信买单接口设置该card_id支持自助核销功能。值得开发者注意的是, 设置自助核销的card_id必须已经配置了门店,否则会报错。

    Parameters:
    cardId - 卡券ID
    isOpen - 是否开启买单功能,填true/false
    Returns:
    操作结果
    Throws:
    WeixinException
    See Also:
    createCardCoupon(CardCoupon), CardApi

    createCardQR

    public QRResult createCardQR(Integer expireSeconds,
                                 CardQR... cardQRs)
                          throws WeixinException
    创建卡券二维码: 开发者可调用该接口生成一张卡券二维码供用户扫码后添加卡券到卡包。

    Parameters:
    expireSeconds - 指定二维码的有效时间,范围是60 ~ 1800秒。不填默认为365天有效
    cardQRs - 二维码参数:二维码领取单张卡券/多张卡券
    Returns:
    二维码结果对象
    Throws:
    WeixinException
    See Also:
    QRResult, QRParameter, CardApi, 投放卡券


    Copyright © 2014–2017. All rights reserved.