public class CustomServiceApi extends Object
限定符和类型 | 类和说明 |
---|---|
static class |
CustomServiceApi.Articles
客户消息图文封装和 `News` 又略微区别,无法公用
|
构造器和说明 |
---|
CustomServiceApi() |
限定符和类型 | 方法和说明 |
---|---|
static ApiResult |
addKfAccount(String kf_account,
String nickname,
String password)
添加客服帐号
|
static ApiResult |
closeSession(String kf_account,
String openid)
关闭会话
此接口在客服和用户之间创建一个会话,如果该客服和用户会话已存在,则直接返回0。
|
static ApiResult |
createSession(String kf_account,
String openid)
创建会话
此接口在客服和用户之间创建一个会话,如果该客服和用户会话已存在,则直接返回0。
|
static ApiResult |
delKfAccount(String kf_account)
删除客服帐号
|
static ApiResult |
getKfList()
获取所有客服账号
|
static ApiResult |
getMsgList(int starttime,
int endtime,
int msgid,
int number)
获取聊天记录
此接口返回的聊天记录中,对于图片、语音、视频,分别展示成文本格式的[image]、[voice]、[video]。
|
static ApiResult |
getOnlineKFList()
获取在线客服接待信息
|
static ApiResult |
getRecord(int pageindex,
int pagesize,
long starttime,
long endtime)
获取客服聊天记录
|
static ApiResult |
getRecord(String jsonStr)
获取客服聊天记录
|
static ApiResult |
getSession(String openid)
获取客户会话状态
此接口获取一个客户的会话,如果不存在,则kf_account为空
|
static ApiResult |
getSessionList(String kf_account)
获取客服会话列表
此接口获取一个客户的会话,如果不存在,则kf_account为空
|
static ApiResult |
getWaitCase()
获取未接入会话列表
此接口获取一个客户的会话,如果不存在,则kf_account为空
|
static ApiResult |
inviteWorker(String kf_account,
String invite_wx)
邀请绑定客服帐号
新添加的客服帐号是不能直接使用的,只有客服人员用微信号绑定了客服账号后,方可登录Web客服进行操作。
|
static ApiResult |
sendCoupon(String openId,
String card_id,
String card_ext)
发送卡券
|
static ApiResult |
sendImage(String openId,
String media_id)
发送图片消息
|
static ApiResult |
sendMpNews(String openId,
String mediaId)
发送图文消息(点击跳转到图文消息页面),图文消息条数限制在8条以内
|
static ApiResult |
sendMusic(String openId,
String musicurl,
String hqmusicurl,
String thumb_media_id,
String title,
String description)
发送音乐回复
|
static ApiResult |
sendNews(String openId,
List<CustomServiceApi.Articles> articles)
发送图文回复,图文消息条数限制在8条以内
|
static ApiResult |
sendText(String openId,
String text)
发送文本客服消息
|
static ApiResult |
sendVideo(String openId,
String media_id,
String title,
String description)
发送视频回复
|
static ApiResult |
sendVoice(String openId,
String media_id)
发送语言回复
|
static ApiResult |
updateKfAccount(String kf_account,
String nickname,
String password)
修改客服帐号
|
static ApiResult |
uploadKfAccountHeadImg(String kf_account,
File headImg)
设置客服帐号的头像
|
public static ApiResult getRecord(String jsonStr)
jsonStr
- json字符串public static ApiResult getRecord(int pageindex, int pagesize, long starttime, long endtime)
pageindex
- 查询第几页,从1开始pagesize
- 每页大小,每页最多拉取50条starttime
- 查询开始时间,UNIX时间戳endtime
- 查询结束时间,UNIX时间戳,每次查询不能跨日查询public static ApiResult addKfAccount(String kf_account, String nickname, String password)
kf_account
- 完整客服账号,格式为:账号前缀@公众号微信号nickname
- 客服昵称,最长6个汉字或12个英文字符password
- 客服账号登录密码,格式为密码明文的32位加密MD5值。该密码仅用于在公众平台官网的多客服功能中使用,若不使用多客服功能,则不必设置密码public static ApiResult updateKfAccount(String kf_account, String nickname, String password)
kf_account
- 完整客服账号,格式为:账号前缀@公众号微信号nickname
- 客服昵称,最长6个汉字或12个英文字符password
- 客服账号登录密码,格式为密码明文的32位加密MD5值。该密码仅用于在公众平台官网的多客服功能中使用,若不使用多客服功能,则不必设置密码public static ApiResult delKfAccount(String kf_account)
kf_account
- 完整客服账号,格式为:账号前缀@公众号微信号public static ApiResult uploadKfAccountHeadImg(String kf_account, File headImg)
kf_account
- 完整客服账号,格式为:账号前缀@公众号微信号headImg
- 客服人员的头像,头像图片文件必须是jpg格式,推荐使用640*640大小的图片以达到最佳效果public static ApiResult getKfList()
public static ApiResult getOnlineKFList()
public static ApiResult sendText(String openId, String text)
openId
- openIdtext
- 文本消息public static ApiResult sendImage(String openId, String media_id)
openId
- openIdmedia_id
- 图片媒体idpublic static ApiResult sendVoice(String openId, String media_id)
openId
- openIdmedia_id
- 媒体idpublic static ApiResult sendVideo(String openId, String media_id, String title, String description)
openId
- openIdmedia_id
- 媒体idtitle
- 视频标题description
- 视频描述public static ApiResult sendMusic(String openId, String musicurl, String hqmusicurl, String thumb_media_id, String title, String description)
openId
- openIdmusicurl
- 音乐地址hqmusicurl
- 音乐高清地址thumb_media_id
- 音乐媒体idtitle
- 音乐标题description
- 音乐描述public static ApiResult sendNews(String openId, List<CustomServiceApi.Articles> articles)
openId
- openIdarticles
- 图文信息封装public static ApiResult sendMpNews(String openId, String mediaId)
openId
- 普通用户openidmediaId
- 素材idpublic static ApiResult sendCoupon(String openId, String card_id, String card_ext)
openId
- 普通用户openidcard_id
- 卡券idcard_ext
- 详情及签名规则: 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.95public static ApiResult inviteWorker(String kf_account, String invite_wx)
kf_account
- 完整客服帐号,格式为:帐号前缀@公众号微信号invite_wx
- 接收绑定邀请的客服微信号public static ApiResult createSession(String kf_account, String openid)
kf_account
- 完整客服帐号,格式为:帐号前缀@公众号微信号openid
- 粉丝的openidpublic static ApiResult closeSession(String kf_account, String openid)
kf_account
- 完整客服帐号,格式为:帐号前缀@公众号微信号openid
- 粉丝的openidpublic static ApiResult getSession(String openid)
openid
- 粉丝的openidpublic static ApiResult getSessionList(String kf_account)
kf_account
- 完整客服帐号,格式为:帐号前缀@公众号微信号public static ApiResult getWaitCase()
public static ApiResult getMsgList(int starttime, int endtime, int msgid, int number)
starttime
- 起始时间,unix时间戳endtime
- 结束时间,unix时间戳,每次查询时段不能超过24小时msgid
- 消息id顺序从小到大,从1开始number
- 每次获取条数,最多10000条Copyright © 2017. All rights reserved.