public interface WxMpService
| 限定符和类型 | 字段和说明 |
|---|---|
static SimpleDateFormat |
SIMPLE_DATE_FORMAT |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
checkJSSDKCallbackDataSignature(Map<String,String> kvm,
String signature)
计算Map键值对是否和签名相符,
按照字段名的 ASCII 码从小到大排序(字典序)后,使用 URL 键值对的 格式(即 key1=value1&key2=value2...)拼接成字符串
|
boolean |
checkSignature(String timestamp,
String nonce,
String signature)
验证推送过来的消息的正确性
详情请见: http://mp.weixin.qq.com/wiki/index.php?
|
String |
consumeCardCode(String code)
卡券Code核销。
|
String |
consumeCardCode(String code,
String cardId)
卡券Code核销。
|
WxCardApiSignature |
createCardApiSignature(String... optionalSignParam)
创建调用卡券api时所需要的签名
详情请见:http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e0456bf8dd9148dd613f.html#.E9.99.84.E5.BD
.954-.E5.8D.A1.E5.88.B8.E6.89.A9.E5.B1.95.E5.AD.97.E6.AE.B5.E5.8F.8A.E7.AD.BE.E5.90.8D.E7.94
.9F.E6.88.90.E7.AE.97.E6.B3.95
|
WxJsapiSignature |
createJsapiSignature(String url)
创建调用jsapi时所需要的签名
详情请见:http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e0456bf8dd9148dd613f.html#.E9.99.84.E5.BD.951-JS-SDK.E4.BD.BF.E7.94.A8.E6.9D.83.E9.99.90.E7.AD.BE.E5.90.8D.E7.AE.97.E6.B3.95
|
void |
customMessageSend(WxMpCustomMessage message)
发送客服消息
详情请见: http://mp.weixin.qq.com/wiki/index.php?
|
String |
decryptCardCode(String encryptCode)
卡券Code解码
|
<T,E> T |
execute(RequestExecutor<T,E> executor,
String uri,
E data)
Service没有实现某个API的时候,可以用这个,
比
get(java.lang.String, java.lang.String)和post(java.lang.String, java.lang.String)方法更灵活,可以自己构造RequestExecutor用来处理不同的参数和不同的返回类型。 |
String |
get(String url,
String queryParam)
当本Service没有实现某个API的时候,可以用这个,针对所有微信API中的GET请求
|
String |
getAccessToken()
获取access_token, 不强制刷新access_token
|
String |
getAccessToken(boolean forceRefresh)
获取access_token,本方法线程安全
且在多线程同时刷新时只刷新一次,避免超出2000次/日的调用次数上限
另:本service的所有方法都会在access_token过期是调用此方法
程序员在非必要情况下尽量不要主动调用此方法
详情请见: http://mp.weixin.qq.com/wiki/index.php?
|
String[] |
getCallbackIP()
获取微信服务器IP地址
http://mp.weixin.qq.com/wiki/0/2ad4b6bfd29f30f71d39616c2a0fcedc.html
|
String |
getCardApiTicket()
获得卡券api_ticket,不强制刷新卡券api_ticket
|
String |
getCardApiTicket(boolean forceRefresh)
获得卡券api_ticket
获得时会检查卡券apiToken是否过期,如果过期了,那么就刷新一下,否则就什么都不干
详情请见:http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e0456bf8dd9148dd613f.html#.E9.99.84.E5.BD.954-.E5.8D.A1.E5.88.B8.E6.89.A9.E5.B1.95.E5.AD.97.E6.AE.B5.E5.8F.8A.E7.AD.BE.E5.90.8D.E7.94.9F.E6.88.90.E7.AE.97.E6.B3.95
|
String |
getCardDetail(String cardId)
查看卡券详情接口
详见 https://mp.weixin.qq.com/wiki/14/8dd77aeaee85f922db5f8aa6386d385e.html#.E6.9F.A5.E7.9C.8B.E5.8D.A1.E5.88.B8.E8.AF.A6.E6.83.85
|
WxMpIndustry |
getIndustry()
获取设置的行业信息
详情请见:http://mp.weixin.qq.com/wiki/5/6dde9eaa909f83354e0094dc3ad99e05.html#.E8.AE.BE.E7.BD.AE.E6.89.80.E5.B1.9E.E8.A1.8C.E4.B8.9A
|
Map<String,String> |
getJsapiPayInfo(String openId,
String outTradeNo,
double amt,
String body,
String ip,
String notifyUrl)
已过时。
Use me.chanjar.weixin.mp.api.WxMpService.getPayInfo(Map
|
String |
getJsapiTicket()
获得jsapi_ticket,不强制刷新jsapi_ticket
|
String |
getJsapiTicket(boolean forceRefresh)
获得jsapi_ticket
获得时会检查jsapiToken是否过期,如果过期了,那么就刷新一下,否则就什么都不干
详情请见:http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e0456bf8dd9148dd613f.html#.E9.99.84.E5.BD.951-JS-SDK.E4.BD.BF.E7.94.A8.E6.9D.83.E9.99.90.E7.AD.BE.E5.90.8D.E7.AE.97.E6.B3.95
|
WxMpPayCallback |
getJSSDKCallbackData(String xmlData)
读取支付结果通知
详见http://pay.weixin.qq.com/wiki/doc/api/jsapi.php?
|
WxMpPayResult |
getJSSDKPayResult(String transactionId,
String outTradeNo)
该接口提供所有微信支付订单的查询,当支付通知处理异常戒丢失的情冴,商户可以通过该接口查询订单支付状态。
|
WxMpKefuService |
getKefuService()
返回客服接口方法实现类,以方便调用个其各种接口
|
Map<String,String> |
getNativePayInfo(String productId,
String outTradeNo,
double amt,
String body,
String ip,
String notifyUrl)
已过时。
Use me.chanjar.weixin.mp.api.WxMpService.getPayInfo(Map
|
Map<String,String> |
getPayInfo(Map<String,String> parameters)
该接口调用“统一下单”接口,并拼装发起支付请求需要的参数
详见http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e0456bf8dd9148dd613f.html#.E5.8F.91.E8.B5.B7.E4.B8.80.E4.B8.AA.E5.BE.AE.E4.BF.A1.E6.94.AF.E4.BB.98.E8.AF.B7.E6.B1.82
|
WxMpPrepayIdResult |
getPrepayId(Map<String,String> parameters)
统一下单(详见http://pay.weixin.qq.com/wiki/doc/api/jsapi.php?
|
WxMpPrepayIdResult |
getPrepayId(String openId,
String outTradeNo,
double amt,
String body,
String tradeType,
String ip,
String notifyUrl)
已过时。
Use me.chanjar.weixin.mp.api.WxMpService.getPrepayId(Map
|
List<WxMpUserCumulate> |
getUserCumulate(Date beginDate,
Date endDate)
获取累计用户数据
http://mp.weixin.qq.com/wiki/3/ecfed6e1a0a03b5f35e5efac98e864b7.html
|
List<WxMpUserSummary> |
getUserSummary(Date beginDate,
Date endDate)
获取用户增减数据
http://mp.weixin.qq.com/wiki/3/ecfed6e1a0a03b5f35e5efac98e864b7.html
|
WxMpGroup |
groupCreate(String name)
分组管理接口 - 创建分组
最多支持创建500个分组
详情请见: http://mp.weixin.qq.com/wiki/index.php?
|
List<WxMpGroup> |
groupGet()
分组管理接口 - 查询所有分组
详情请见: http://mp.weixin.qq.com/wiki/index.php?
|
void |
groupUpdate(WxMpGroup group)
分组管理接口 - 修改分组名
详情请见: http://mp.weixin.qq.com/wiki/index.php?
|
void |
markCardCode(String code,
String cardId,
String openId,
boolean isMark)
卡券Mark接口。
|
WxMpMassSendResult |
massGroupMessageSend(WxMpMassGroupMessage message)
分组群发消息
如果发送图文消息,必须先使用
massNewsUpload(me.chanjar.weixin.mp.bean.WxMpMassNews) 获得media_id,然后再发送
如果发送视频消息,必须先使用 massVideoUpload(me.chanjar.weixin.mp.bean.WxMpMassVideo) 获得media_id,然后再发送
详情请见: http://mp.weixin.qq.com/wiki/index.php? |
WxMpMassSendResult |
massMessagePreview(WxMpMassPreviewMessage wxMpMassPreviewMessage)
预览接口
详情请见:http://mp.weixin.qq.com/wiki/15/40b6865b893947b764e2de8e4a1fb55f.html#.E9.A2.84.E8.A7.88.E6.8E.A5.E5.8F.A3.E3.80.90.E8.AE.A2.E9.98.85.E5.8F.B7.E4.B8.8E.E6.9C.8D.E5.8A.A1.E5.8F.B7.E8.AE.A4.E8.AF.81.E5.90.8E.E5.9D.87.E5.8F.AF.E7.94.A8.E3.80.91
|
WxMpMassUploadResult |
massNewsUpload(WxMpMassNews news)
上传群发用的图文消息,上传后才能群发图文消息
详情请见: http://mp.weixin.qq.com/wiki/index.php?
|
WxMpMassSendResult |
massOpenIdsMessageSend(WxMpMassOpenIdsMessage message)
按openId列表群发消息
如果发送图文消息,必须先使用
massNewsUpload(me.chanjar.weixin.mp.bean.WxMpMassNews) 获得media_id,然后再发送
如果发送视频消息,必须先使用 massVideoUpload(me.chanjar.weixin.mp.bean.WxMpMassVideo) 获得media_id,然后再发送
详情请见: http://mp.weixin.qq.com/wiki/index.php? |
WxMpMassUploadResult |
massVideoUpload(WxMpMassVideo video)
上传群发用的视频,上传后才能群发视频消息
详情请见: http://mp.weixin.qq.com/wiki/index.php?
|
WxMpMaterialCountResult |
materialCount()
获取各类素材总数
详情请见: http://mp.weixin.qq.com/wiki/16/8cc64f8c189674b421bee3ed403993b8.html
|
boolean |
materialDelete(String media_id)
删除永久素材
详情请见: http://mp.weixin.qq.com/wiki/5/e66f61c303db51a6c0f90f46b15af5f5.html
|
WxMpMaterialFileBatchGetResult |
materialFileBatchGet(String type,
int offset,
int count)
分页获取其他媒体素材列表
详情请见: http://mp.weixin.qq.com/wiki/12/2108cd7aafff7f388f41f37efa710204.html
|
WxMpMaterialUploadResult |
materialFileUpload(String mediaType,
WxMpMaterial material)
上传非图文永久素材
上传的多媒体文件有格式和大小限制,如下:
图片(image): 图片大小不超过2M,支持bmp/png/jpeg/jpg/gif格式
语音(voice):语音大小不超过5M,长度不超过60秒,支持mp3/wma/wav/amr格式
视频(video):在上传视频素材时需要POST另一个表单,id为description,包含素材的描述信息,内容格式为JSON
缩略图(thumb):文档未说明
详情请见: http://mp.weixin.qq.com/wiki/14/7e6c03263063f4813141c3e17dd4350a.html
|
InputStream |
materialImageOrVoiceDownload(String media_id)
下载声音或者图片永久素材
详情请见: http://mp.weixin.qq.com/wiki/4/b3546879f07623cb30df9ca0e420a5d0.html
|
WxMpMaterialNewsBatchGetResult |
materialNewsBatchGet(int offset,
int count)
分页获取图文素材列表
详情请见: http://mp.weixin.qq.com/wiki/12/2108cd7aafff7f388f41f37efa710204.html
|
WxMpMaterialNews |
materialNewsInfo(String media_id)
获取图文永久素材的信息
详情请见: http://mp.weixin.qq.com/wiki/4/b3546879f07623cb30df9ca0e420a5d0.html
|
boolean |
materialNewsUpdate(WxMpMaterialArticleUpdate wxMpMaterialArticleUpdate)
更新图文永久素材
详情请见: http://mp.weixin.qq.com/wiki/4/19a59cba020d506e767360ca1be29450.html
|
WxMpMaterialUploadResult |
materialNewsUpload(WxMpMaterialNews news)
上传永久图文素材
详情请见: http://mp.weixin.qq.com/wiki/14/7e6c03263063f4813141c3e17dd4350a.html
|
WxMpMaterialVideoInfoResult |
materialVideoInfo(String media_id)
获取视频永久素材的信息和下载地址
详情请见: http://mp.weixin.qq.com/wiki/4/b3546879f07623cb30df9ca0e420a5d0.html
|
File |
mediaDownload(String media_id)
获取临时素材
本接口即为原“下载多媒体文件”接口。
|
WxMediaImgUploadResult |
mediaImgUpload(File file)
上传图文消息内的图片获取URL
详情请见:http://mp.weixin.qq.com/wiki/15/40b6865b893947b764e2de8e4a1fb55f.html#.E4.B8.8A.E4.BC.A0.E5.9B.BE.E6.96.87.E6.B6.88.E6.81.AF.E5.86.85.E7.9A.84.E5.9B.BE.E7.89.87.E8.8E.B7.E5.8F.96URL.E3.80.90.E8.AE.A2.E9.98.85.E5.8F.B7.E4.B8.8E.E6.9C.8D.E5.8A.A1.E5.8F.B7.E8.AE.A4.E8.AF.81.E5.90.8E.E5.9D.87.E5.8F.AF.E7.94.A8.E3.80.91
|
WxMediaUploadResult |
mediaUpload(String mediaType,
File file)
新增临时素材
|
WxMediaUploadResult |
mediaUpload(String mediaType,
String fileType,
InputStream inputStream)
新增临时素材
本接口即为原“上传多媒体文件”接口。
|
void |
menuCreate(WxMenu menu)
自定义菜单创建接口
详情请见: http://mp.weixin.qq.com/wiki/index.php?
|
void |
menuDelete()
自定义菜单删除接口
详情请见: http://mp.weixin.qq.com/wiki/index.php?
|
void |
menuDelete(String menuid)
删除个性化菜单接口
详情请见: http://mp.weixin.qq.com/wiki/0/c48ccd12b69ae023159b4bfaa7c39c20.html
|
WxMenu |
menuGet()
自定义菜单查询接口
详情请见: http://mp.weixin.qq.com/wiki/index.php?
|
WxMenu |
menuTryMatch(String userid)
测试个性化菜单匹配结果
详情请见: http://mp.weixin.qq.com/wiki/0/c48ccd12b69ae023159b4bfaa7c39c20.html
|
String |
oauth2buildAuthorizationUrl(String scope,
String state)
构造oauth2授权的url连接
详情请见: http://mp.weixin.qq.com/wiki/index.php?
|
String |
oauth2buildAuthorizationUrl(String redirectURI,
String scope,
String state)
构造oauth2授权的url连接
详情请见: http://mp.weixin.qq.com/wiki/index.php?
|
WxMpOAuth2AccessToken |
oauth2getAccessToken(String code)
用code换取oauth2的access token
详情请见: http://mp.weixin.qq.com/wiki/index.php?
|
WxMpUser |
oauth2getUserInfo(WxMpOAuth2AccessToken oAuth2AccessToken,
String lang)
用oauth2获取用户信息, 当前面引导授权时的scope是snsapi_userinfo的时候才可以
|
WxMpOAuth2AccessToken |
oauth2refreshAccessToken(String refreshToken)
刷新oauth2的access token
|
boolean |
oauth2validateAccessToken(WxMpOAuth2AccessToken oAuth2AccessToken)
验证oauth2的access token是否有效
|
String |
post(String url,
String postData)
当本Service没有实现某个API的时候,可以用这个,针对所有微信API中的POST请求
|
WxMpQrCodeTicket |
qrCodeCreateLastTicket(int scene_id)
换取永久二维码ticket
详情请见: 生成带参数的二维码
|
WxMpQrCodeTicket |
qrCodeCreateLastTicket(String scene_str)
换取永久字符串二维码ticket
详情请见: 生成带参数的二维码
|
WxMpQrCodeTicket |
qrCodeCreateTmpTicket(int scene_id,
Integer expire_seconds)
换取临时二维码ticket
详情请见: 生成带参数的二维码
|
File |
qrCodePicture(WxMpQrCodeTicket ticket)
换取二维码图片文件,jpg格式
详情请见: 生成带参数的二维码
|
String |
qrCodePictureUrl(String ticket)
换取二维码图片url地址
详情请见: 生成带参数的二维码
|
String |
qrCodePictureUrl(String ticket,
boolean needShortUrl)
换取二维码图片url地址(可以选择是否生成压缩的网址)
详情请见: 生成带参数的二维码
|
WxMpCardResult |
queryCardCode(String cardId,
String code,
boolean checkConsume)
卡券Code查询
|
WxMpPayRefundResult |
refundPay(Map<String,String> parameters)
微信支付-申请退款
详见 https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?
|
WxMpSemanticQueryResult |
semanticQuery(WxMpSemanticQuery semanticQuery)
语义查询接口
详情请见:http://mp.weixin.qq.com/wiki/index.php?
|
WxRedpackResult |
sendRedpack(Map<String,String> parameters)
发送微信红包给个人用户
需要传入的必填参数如下:
mch_billno//商户订单号
send_name//商户名称
re_openid//用户openid
total_amount//红包总额
total_num//红包发放总人数
wishing//红包祝福语
client_ip//服务器Ip地址
act_name//活动名称
remark //备注
文档详见:https://pay.weixin.qq.com/wiki/doc/api/tools/cash_coupon.php?
|
String |
setIndustry(WxMpIndustry wxMpIndustry)
设置所属行业
官方文档中暂未告知响应内容
详情请见:http://mp.weixin.qq.com/wiki/5/6dde9eaa909f83354e0094dc3ad99e05.html#.E8.AE.BE.E7.BD.AE.E6.89.80.E5.B1.9E.E8.A1.8C.E4.B8.9A
|
void |
setMaxRetryTimes(int maxRetryTimes)
设置当微信系统响应系统繁忙时,最大重试次数
默认:5次
|
void |
setRetrySleepMillis(int retrySleepMillis)
设置当微信系统响应系统繁忙时,要等待多少 retrySleepMillis(ms) * 2^(重试次数 - 1) 再发起重试
默认:1000ms
|
void |
setWxMpConfigStorage(WxMpConfigStorage wxConfigProvider)
注入
WxMpConfigStorage 的实现 |
String |
shortUrl(String long_url)
长链接转短链接接口
详情请见: http://mp.weixin.qq.com/wiki/index.php?
|
String |
templateSend(WxMpTemplateMessage templateMessage)
发送模板消息
详情请见: http://mp.weixin.qq.com/wiki/index.php?
|
long |
userGetGroup(String openid)
分组管理接口 - 查询用户所在分组
详情请见: http://mp.weixin.qq.com/wiki/index.php?
|
WxMpUser |
userInfo(String openid,
String lang)
获取用户基本信息
详情请见: http://mp.weixin.qq.com/wiki/index.php?
|
WxMpUserList |
userList(String next_openid)
获取关注者列表
详情请见: http://mp.weixin.qq.com/wiki/index.php?
|
void |
userUpdateGroup(String openid,
long to_groupid)
分组管理接口 - 移动用户分组
详情请见: http://mp.weixin.qq.com/wiki/index.php?
|
void |
userUpdateRemark(String openid,
String remark)
设置用户备注名接口
详情请见: http://mp.weixin.qq.com/wiki/index.php?
|
static final SimpleDateFormat SIMPLE_DATE_FORMAT
boolean checkSignature(String timestamp, String nonce, String signature)
验证推送过来的消息的正确性 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=验证消息真实性
timestamp - nonce - signature - String getAccessToken() throws WxErrorException
WxErrorExceptiongetAccessToken(boolean)String getAccessToken(boolean forceRefresh) throws WxErrorException
获取access_token,本方法线程安全 且在多线程同时刷新时只刷新一次,避免超出2000次/日的调用次数上限 另:本service的所有方法都会在access_token过期是调用此方法 程序员在非必要情况下尽量不要主动调用此方法 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=获取access_token
forceRefresh - 强制刷新WxErrorExceptionString getJsapiTicket() throws WxErrorException
WxErrorExceptiongetJsapiTicket(boolean)String getJsapiTicket(boolean forceRefresh) throws WxErrorException
获得jsapi_ticket 获得时会检查jsapiToken是否过期,如果过期了,那么就刷新一下,否则就什么都不干 详情请见:http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e0456bf8dd9148dd613f.html#.E9.99.84.E5.BD.951-JS-SDK.E4.BD.BF.E7.94.A8.E6.9D.83.E9.99.90.E7.AD.BE.E5.90.8D.E7.AE.97.E6.B3.95
forceRefresh - 强制刷新WxErrorExceptionWxJsapiSignature createJsapiSignature(String url) throws WxErrorException
创建调用jsapi时所需要的签名 详情请见:http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e0456bf8dd9148dd613f.html#.E9.99.84.E5.BD.951-JS-SDK.E4.BD.BF.E7.94.A8.E6.9D.83.E9.99.90.E7.AD.BE.E5.90.8D.E7.AE.97.E6.B3.95
url - urlWxErrorExceptionWxMediaUploadResult mediaUpload(String mediaType, String fileType, InputStream inputStream) throws WxErrorException, IOException
新增临时素材 本接口即为原“上传多媒体文件”接口。 上传的多媒体文件有格式和大小限制,如下: 图片(image): 1M,支持JPG格式 语音(voice):2M,播放长度不超过60s,支持AMR\MP3格式 视频(video):10MB,支持MP4格式 缩略图(thumb):64KB,支持JPG格式 详情请见: 新增临时素材
mediaType - 媒体类型, 请看WxConstsfileType - 文件类型,请看WxConstsinputStream - 输入流WxErrorExceptionIOExceptionWxMpMaterialUploadResult materialFileUpload(String mediaType, WxMpMaterial material) throws WxErrorException
上传非图文永久素材 上传的多媒体文件有格式和大小限制,如下: 图片(image): 图片大小不超过2M,支持bmp/png/jpeg/jpg/gif格式 语音(voice):语音大小不超过5M,长度不超过60秒,支持mp3/wma/wav/amr格式 视频(video):在上传视频素材时需要POST另一个表单,id为description,包含素材的描述信息,内容格式为JSON 缩略图(thumb):文档未说明 详情请见: http://mp.weixin.qq.com/wiki/14/7e6c03263063f4813141c3e17dd4350a.html
mediaType - 媒体类型, 请看WxConstsmaterial - 上传的素材, 请看WxMpMaterialWxErrorExceptionWxMpMaterialUploadResult materialNewsUpload(WxMpMaterialNews news) throws WxErrorException
上传永久图文素材 详情请见: http://mp.weixin.qq.com/wiki/14/7e6c03263063f4813141c3e17dd4350a.html
news - 上传的图文消息, 请看WxMpMaterialNewsWxErrorExceptionInputStream materialImageOrVoiceDownload(String media_id) throws WxErrorException
下载声音或者图片永久素材 详情请见: http://mp.weixin.qq.com/wiki/4/b3546879f07623cb30df9ca0e420a5d0.html
media_id - 永久素材的idWxErrorExceptionWxMpMaterialVideoInfoResult materialVideoInfo(String media_id) throws WxErrorException
获取视频永久素材的信息和下载地址 详情请见: http://mp.weixin.qq.com/wiki/4/b3546879f07623cb30df9ca0e420a5d0.html
media_id - 永久素材的idWxErrorExceptionWxMpMaterialNews materialNewsInfo(String media_id) throws WxErrorException
获取图文永久素材的信息 详情请见: http://mp.weixin.qq.com/wiki/4/b3546879f07623cb30df9ca0e420a5d0.html
media_id - 永久素材的idWxErrorExceptionboolean materialNewsUpdate(WxMpMaterialArticleUpdate wxMpMaterialArticleUpdate) throws WxErrorException
更新图文永久素材 详情请见: http://mp.weixin.qq.com/wiki/4/19a59cba020d506e767360ca1be29450.html
wxMpMaterialArticleUpdate - 用来更新图文素材的bean, 请看WxMpMaterialArticleUpdateWxErrorExceptionboolean materialDelete(String media_id) throws WxErrorException
删除永久素材 详情请见: http://mp.weixin.qq.com/wiki/5/e66f61c303db51a6c0f90f46b15af5f5.html
media_id - 永久素材的idWxErrorExceptionWxMpMaterialCountResult materialCount() throws WxErrorException
获取各类素材总数 详情请见: http://mp.weixin.qq.com/wiki/16/8cc64f8c189674b421bee3ed403993b8.html
WxErrorExceptionWxMpMaterialNewsBatchGetResult materialNewsBatchGet(int offset, int count) throws WxErrorException
分页获取图文素材列表 详情请见: http://mp.weixin.qq.com/wiki/12/2108cd7aafff7f388f41f37efa710204.html
offset - 从全部素材的该偏移位置开始返回,0表示从第一个素材 返回count - 返回素材的数量,取值在1到20之间WxErrorExceptionWxMpMaterialFileBatchGetResult materialFileBatchGet(String type, int offset, int count) throws WxErrorException
分页获取其他媒体素材列表 详情请见: http://mp.weixin.qq.com/wiki/12/2108cd7aafff7f388f41f37efa710204.html
type - 媒体类型, 请看WxConstsoffset - 从全部素材的该偏移位置开始返回,0表示从第一个素材 返回count - 返回素材的数量,取值在1到20之间WxErrorExceptionWxMediaUploadResult mediaUpload(String mediaType, File file) throws WxErrorException
mediaType - file - WxErrorExceptionmediaUpload(String, String, InputStream)File mediaDownload(String media_id) throws WxErrorException
获取临时素材 本接口即为原“下载多媒体文件”接口。 根据微信文档,视频文件下载不了,会返回null 详情请见: 获取临时素材
WxErrorExceptionvoid customMessageSend(WxMpCustomMessage message) throws WxErrorException
发送客服消息 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=发送客服消息
message - WxErrorExceptionWxMpMassUploadResult massNewsUpload(WxMpMassNews news) throws WxErrorException
上传群发用的图文消息,上传后才能群发图文消息 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=高级群发接口
WxMpMassUploadResult massVideoUpload(WxMpMassVideo video) throws WxErrorException
上传群发用的视频,上传后才能群发视频消息 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=高级群发接口
WxMpMassSendResult massGroupMessageSend(WxMpMassGroupMessage message) throws WxErrorException
分组群发消息 如果发送图文消息,必须先使用massNewsUpload(me.chanjar.weixin.mp.bean.WxMpMassNews)获得media_id,然后再发送 如果发送视频消息,必须先使用massVideoUpload(me.chanjar.weixin.mp.bean.WxMpMassVideo)获得media_id,然后再发送 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=高级群发接口
message - WxErrorExceptionWxMpMassSendResult massOpenIdsMessageSend(WxMpMassOpenIdsMessage message) throws WxErrorException
按openId列表群发消息 如果发送图文消息,必须先使用massNewsUpload(me.chanjar.weixin.mp.bean.WxMpMassNews)获得media_id,然后再发送 如果发送视频消息,必须先使用massVideoUpload(me.chanjar.weixin.mp.bean.WxMpMassVideo)获得media_id,然后再发送 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=高级群发接口
message - WxErrorExceptionvoid menuCreate(WxMenu menu) throws WxErrorException
自定义菜单创建接口 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=自定义菜单创建接口 如果要创建个性化菜单,请设置matchrule属性 详情请见:http://mp.weixin.qq.com/wiki/0/c48ccd12b69ae023159b4bfaa7c39c20.html
menu - WxErrorExceptionvoid menuDelete()
throws WxErrorException
自定义菜单删除接口 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=自定义菜单删除接口
WxErrorExceptionvoid menuDelete(String menuid) throws WxErrorException
删除个性化菜单接口 详情请见: http://mp.weixin.qq.com/wiki/0/c48ccd12b69ae023159b4bfaa7c39c20.html
menuid - WxErrorExceptionWxMenu menuGet() throws WxErrorException
自定义菜单查询接口 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=自定义菜单查询接口
WxErrorExceptionWxMenu menuTryMatch(String userid) throws WxErrorException
测试个性化菜单匹配结果 详情请见: http://mp.weixin.qq.com/wiki/0/c48ccd12b69ae023159b4bfaa7c39c20.html
userid - 可以是粉丝的OpenID,也可以是粉丝的微信号。WxErrorExceptionWxMpGroup groupCreate(String name) throws WxErrorException
分组管理接口 - 创建分组 最多支持创建500个分组 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=分组管理接口
name - 分组名字(30个字符以内)WxErrorExceptionList<WxMpGroup> groupGet() throws WxErrorException
分组管理接口 - 查询所有分组 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=分组管理接口
WxErrorExceptionlong userGetGroup(String openid) throws WxErrorException
分组管理接口 - 查询用户所在分组 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=分组管理接口
openid - 微信用户的openidWxErrorExceptionvoid groupUpdate(WxMpGroup group) throws WxErrorException
分组管理接口 - 修改分组名 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=分组管理接口 如果id为0(未分组),1(黑名单),2(星标组),或者不存在的id,微信会返回系统繁忙的错误
group - 要更新的group,group的id,name必须设置WxErrorExceptionvoid userUpdateGroup(String openid, long to_groupid) throws WxErrorException
分组管理接口 - 移动用户分组 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=分组管理接口 如果to_groupid为0(未分组),1(黑名单),2(星标组),或者不存在的id,微信会返回系统繁忙的错误
openid - 用户openidto_groupid - 移动到的分组idWxErrorExceptionvoid userUpdateRemark(String openid, String remark) throws WxErrorException
设置用户备注名接口 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=设置用户备注名接口
openid - 用户openidremark - 备注名WxErrorExceptionWxMpUser userInfo(String openid, String lang) throws WxErrorException
获取用户基本信息 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=获取用户基本信息
openid - 用户openidlang - 语言,zh_CN 简体(默认),zh_TW 繁体,en 英语WxErrorExceptionWxMpUserList userList(String next_openid) throws WxErrorException
获取关注者列表 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=获取关注者列表
next_openid - 可选,第一个拉取的OPENID,null为从头开始拉取WxErrorExceptionWxMpQrCodeTicket qrCodeCreateTmpTicket(int scene_id, Integer expire_seconds) throws WxErrorException
换取临时二维码ticket 详情请见: 生成带参数的二维码
scene_id - 参数。expire_seconds - 过期秒数,默认60秒,最小60秒,最大1800秒WxErrorExceptionWxMpQrCodeTicket qrCodeCreateLastTicket(int scene_id) throws WxErrorException
换取永久二维码ticket 详情请见: 生成带参数的二维码
scene_id - 参数。永久二维码时最大值为100000(目前参数只支持1--100000)WxErrorExceptionWxMpQrCodeTicket qrCodeCreateLastTicket(String scene_str) throws WxErrorException
换取永久字符串二维码ticket 详情请见: 生成带参数的二维码
scene_str - 参数。字符串类型长度现在为1到64WxErrorExceptionFile qrCodePicture(WxMpQrCodeTicket ticket) throws WxErrorException
换取二维码图片文件,jpg格式 详情请见: 生成带参数的二维码
ticket - 二维码ticketWxErrorExceptionString qrCodePictureUrl(String ticket, boolean needShortUrl) throws WxErrorException
换取二维码图片url地址(可以选择是否生成压缩的网址) 详情请见: 生成带参数的二维码
ticket - 二维码ticketneedShortUrl - 是否需要压缩的二维码地址WxErrorExceptionString qrCodePictureUrl(String ticket) throws WxErrorException
换取二维码图片url地址 详情请见: 生成带参数的二维码
ticket - 二维码ticketWxErrorExceptionString shortUrl(String long_url) throws WxErrorException
长链接转短链接接口 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=长链接转短链接接口
long_url - WxErrorExceptionString templateSend(WxMpTemplateMessage templateMessage) throws WxErrorException
发送模板消息 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=模板消息接口
templateMessage - WxErrorExceptionWxMpSemanticQueryResult semanticQuery(WxMpSemanticQuery semanticQuery) throws WxErrorException
语义查询接口 详情请见:http://mp.weixin.qq.com/wiki/index.php?title=语义理解
semanticQuery - WxErrorExceptionString oauth2buildAuthorizationUrl(String scope, String state)
构造oauth2授权的url连接 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=网页授权获取用户基本信息
scope - state - String oauth2buildAuthorizationUrl(String redirectURI, String scope, String state)
构造oauth2授权的url连接 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=网页授权获取用户基本信息
redirectURI - 用户授权完成后的重定向链接,无需urlencode, 方法内会进行encodescope - state - WxMpOAuth2AccessToken oauth2getAccessToken(String code) throws WxErrorException
用code换取oauth2的access token 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=网页授权获取用户基本信息
code - WxErrorExceptionWxMpOAuth2AccessToken oauth2refreshAccessToken(String refreshToken) throws WxErrorException
刷新oauth2的access token
refreshToken - WxErrorExceptionWxMpUser oauth2getUserInfo(WxMpOAuth2AccessToken oAuth2AccessToken, String lang) throws WxErrorException
用oauth2获取用户信息, 当前面引导授权时的scope是snsapi_userinfo的时候才可以
oAuth2AccessToken - lang - zh_CN, zh_TW, enWxErrorExceptionboolean oauth2validateAccessToken(WxMpOAuth2AccessToken oAuth2AccessToken)
验证oauth2的access token是否有效
oAuth2AccessToken - String[] getCallbackIP() throws WxErrorException
获取微信服务器IP地址 http://mp.weixin.qq.com/wiki/0/2ad4b6bfd29f30f71d39616c2a0fcedc.html
WxErrorExceptionList<WxMpUserSummary> getUserSummary(Date beginDate, Date endDate) throws WxErrorException
获取用户增减数据 http://mp.weixin.qq.com/wiki/3/ecfed6e1a0a03b5f35e5efac98e864b7.html
beginDate - 最大时间跨度7天endDate - endDate不能早于begingDateWxErrorExceptionList<WxMpUserCumulate> getUserCumulate(Date beginDate, Date endDate) throws WxErrorException
获取累计用户数据 http://mp.weixin.qq.com/wiki/3/ecfed6e1a0a03b5f35e5efac98e864b7.html
beginDate - 最大时间跨度7天endDate - endDate不能早于begingDateWxErrorExceptionString get(String url, String queryParam) throws WxErrorException
url - queryParam - WxErrorExceptionString post(String url, String postData) throws WxErrorException
url - postData - WxErrorException<T,E> T execute(RequestExecutor<T,E> executor, String uri, E data) throws WxErrorException
Service没有实现某个API的时候,可以用这个, 比get(java.lang.String, java.lang.String)和post(java.lang.String, java.lang.String)方法更灵活,可以自己构造RequestExecutor用来处理不同的参数和不同的返回类型。 可以参考,MediaUploadRequestExecutor的实现方法
T - E - executor - uri - data - WxErrorExceptionvoid setWxMpConfigStorage(WxMpConfigStorage wxConfigProvider)
WxMpConfigStorage 的实现wxConfigProvider - void setRetrySleepMillis(int retrySleepMillis)
设置当微信系统响应系统繁忙时,要等待多少 retrySleepMillis(ms) * 2^(重试次数 - 1) 再发起重试 默认:1000ms
retrySleepMillis - void setMaxRetryTimes(int maxRetryTimes)
设置当微信系统响应系统繁忙时,最大重试次数 默认:5次
maxRetryTimes - @Deprecated WxMpPrepayIdResult getPrepayId(String openId, String outTradeNo, double amt, String body, String tradeType, String ip, String notifyUrl)
openId - 支付人openIdoutTradeNo - 商户端对应订单号amt - 金额(单位元)body - 商品描述tradeType - 交易类型 JSAPI,NATIVE,APP,WAPip - 发起支付的客户端IPnotifyUrl - 通知地址WxMpPrepayIdResult getPrepayId(Map<String,String> parameters)
parameters - All required/optional parameters for weixin paymentIllegalArgumentExceptionMap<String,String> getPayInfo(Map<String,String> parameters) throws WxErrorException
parameters - the required or optional parametersWxErrorException@Deprecated Map<String,String> getNativePayInfo(String productId, String outTradeNo, double amt, String body, String ip, String notifyUrl) throws WxErrorException
productId - 商户商品IDoutTradeNo - 商户端对应订单号amt - 金额(单位元)body - 商品描述ip - 发起支付的客户端IPnotifyUrl - 通知地址WxErrorException@Deprecated Map<String,String> getJsapiPayInfo(String openId, String outTradeNo, double amt, String body, String ip, String notifyUrl) throws WxErrorException
openId - 支付人openIdoutTradeNo - 商户端对应订单号amt - 金额(单位元)body - 商品描述ip - 发起支付的客户端IPnotifyUrl - 通知地址WxErrorExceptionWxMpPayResult getJSSDKPayResult(String transactionId, String outTradeNo)
transactionId - outTradeNo - WxMpPayCallback getJSSDKCallbackData(String xmlData)
xmlData - WxMpPayRefundResult refundPay(Map<String,String> parameters) throws WxErrorException
parameters - 需要传入的退款参数的Map。以下几项为参数的必须项:WxErrorExceptionboolean checkJSSDKCallbackDataSignature(Map<String,String> kvm, String signature)
计算Map键值对是否和签名相符, 按照字段名的 ASCII 码从小到大排序(字典序)后,使用 URL 键值对的 格式(即 key1=value1&key2=value2...)拼接成字符串
kvm - signature - WxRedpackResult sendRedpack(Map<String,String> parameters) throws WxErrorException
parameters - WxErrorExceptionString getCardApiTicket() throws WxErrorException
WxErrorExceptiongetCardApiTicket(boolean)String getCardApiTicket(boolean forceRefresh) throws WxErrorException
获得卡券api_ticket 获得时会检查卡券apiToken是否过期,如果过期了,那么就刷新一下,否则就什么都不干 详情请见:http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e0456bf8dd9148dd613f.html#.E9.99.84.E5.BD.954-.E5.8D.A1.E5.88.B8.E6.89.A9.E5.B1.95.E5.AD.97.E6.AE.B5.E5.8F.8A.E7.AD.BE.E5.90.8D.E7.94.9F.E6.88.90.E7.AE.97.E6.B3.95
forceRefresh - 强制刷新WxErrorExceptionWxCardApiSignature createCardApiSignature(String... optionalSignParam) throws WxErrorException
创建调用卡券api时所需要的签名 详情请见:http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e0456bf8dd9148dd613f.html#.E9.99.84.E5.BD .954-.E5.8D.A1.E5.88.B8.E6.89.A9.E5.B1.95.E5.AD.97.E6.AE.B5.E5.8F.8A.E7.AD.BE.E5.90.8D.E7.94 .9F.E6.88.90.E7.AE.97.E6.B3.95
optionalSignParam - 参与签名的参数数组。
可以为下列字段:app_id, card_id, card_type, code, openid, location_id
注意:当做wx.chooseCard调用时,必须传入app_id参与签名,否则会造成签名失败导致拉取卡券列表为空WxErrorExceptionString decryptCardCode(String encryptCode) throws WxErrorException
encryptCode - 加密Code,通过JSSDK的chooseCard接口获得WxErrorExceptionWxMpCardResult queryCardCode(String cardId, String code, boolean checkConsume) throws WxErrorException
cardId - 卡券ID代表一类卡券code - 单张卡券的唯一标准checkConsume - 是否校验code核销状态,填入true和false时的code异常状态返回数据不同WxErrorExceptionString consumeCardCode(String code) throws WxErrorException
code - 单张卡券的唯一标准WxErrorExceptionString consumeCardCode(String code, String cardId) throws WxErrorException
code - 单张卡券的唯一标准cardId - 当自定义Code卡券时需要传入card_idWxErrorExceptionvoid markCardCode(String code, String cardId, String openId, boolean isMark) throws WxErrorException
code - 卡券的code码cardId - 卡券的IDopenId - 用券用户的openidisMark - 是否要mark(占用)这个code,填写true或者false,表示占用或解除占用WxErrorExceptionString getCardDetail(String cardId) throws WxErrorException
cardId - 卡券的IDWxErrorExceptionWxMpMassSendResult massMessagePreview(WxMpMassPreviewMessage wxMpMassPreviewMessage) throws Exception
预览接口 详情请见:http://mp.weixin.qq.com/wiki/15/40b6865b893947b764e2de8e4a1fb55f.html#.E9.A2.84.E8.A7.88.E6.8E.A5.E5.8F.A3.E3.80.90.E8.AE.A2.E9.98.85.E5.8F.B7.E4.B8.8E.E6.9C.8D.E5.8A.A1.E5.8F.B7.E8.AE.A4.E8.AF.81.E5.90.8E.E5.9D.87.E5.8F.AF.E7.94.A8.E3.80.91
wxMpMassPreviewMessage - WxErrorExceptionExceptionWxMediaImgUploadResult mediaImgUpload(File file) throws WxErrorException
上传图文消息内的图片获取URL 详情请见:http://mp.weixin.qq.com/wiki/15/40b6865b893947b764e2de8e4a1fb55f.html#.E4.B8.8A.E4.BC.A0.E5.9B.BE.E6.96.87.E6.B6.88.E6.81.AF.E5.86.85.E7.9A.84.E5.9B.BE.E7.89.87.E8.8E.B7.E5.8F.96URL.E3.80.90.E8.AE.A2.E9.98.85.E5.8F.B7.E4.B8.8E.E6.9C.8D.E5.8A.A1.E5.8F.B7.E8.AE.A4.E8.AF.81.E5.90.8E.E5.9D.87.E5.8F.AF.E7.94.A8.E3.80.91
file - WxErrorExceptionString setIndustry(WxMpIndustry wxMpIndustry) throws WxErrorException
设置所属行业 官方文档中暂未告知响应内容 详情请见:http://mp.weixin.qq.com/wiki/5/6dde9eaa909f83354e0094dc3ad99e05.html#.E8.AE.BE.E7.BD.AE.E6.89.80.E5.B1.9E.E8.A1.8C.E4.B8.9A
wxMpIndustry - WxErrorExceptionWxMpIndustry getIndustry() throws WxErrorException
获取设置的行业信息 详情请见:http://mp.weixin.qq.com/wiki/5/6dde9eaa909f83354e0094dc3ad99e05.html#.E8.AE.BE.E7.BD.AE.E6.89.80.E5.B1.9E.E8.A1.8C.E4.B8.9A
WxErrorExceptionWxMpKefuService getKefuService()
Copyright © 2016. All rights reserved.