Documentation ¶
Index ¶
- func AddAccount(account, nickname string) wx.Action
- func CloseSession(account, openid string) wx.Action
- func CreateSession(account, openid string) wx.Action
- func DeleteAccount(account string) wx.Action
- func GetAccountList(result *ResultAccountList) wx.Action
- func GetMsgRecordList(msgID, starttime, endtime int64, number int, result *ResultMsgRecordList) wx.Action
- func GetOnlineList(result *ResultOnlineList) wx.Action
- func GetSession(openid string, result *Session) wx.Action
- func GetSessionList(account string, result *ResultSessionList) wx.Action
- func GetWaitCase(result *WaitCase) wx.Action
- func InviteWorker(account, inviteWX string) wx.Action
- func SendImageMsg(openID, mediaID string, kfAccount ...string) wx.Action
- func SendMPNewsArticleMsg(openID, articleID string, kfAccount ...string) wx.Action
- func SendMPNewsMsg(openID, mediaID string, kfAccount ...string) wx.Action
- func SendMenuMsg(openID string, menu *MsgMenu, kfAccount ...string) wx.Action
- func SendMinipPageMsg(openID string, minipPage *MsgMinipPage, kfAccount ...string) wx.Action
- func SendMusicMsg(openID string, music *MsgMusic, kfAccount ...string) wx.Action
- func SendNewsMsg(openID string, articles []*MsgArticle, kfAccount ...string) wx.Action
- func SendTextMsg(openID, content string, kfAccount ...string) wx.Action
- func SendTyping(openID string, cmd TypeCmd) wx.Action
- func SendVideoMsg(openID string, video *MsgVideo, kfAccount ...string) wx.Action
- func SendVoiceMsg(openID, mediaID string, kfAccount ...string) wx.Action
- func SendWXCardMsg(openID, cardID string, kfAccount ...string) wx.Action
- func UpdateAccount(account, nickname string) wx.Action
- func UploadAvatar(account, imgPath string) wx.Action
- type Account
- type InviteStatus
- type MenuOption
- type MsgArticle
- type MsgCard
- type MsgKF
- type MsgMPNewsArticle
- type MsgMedia
- type MsgMenu
- type MsgMinipPage
- type MsgMusic
- type MsgNews
- type MsgRecord
- type MsgText
- type MsgVideo
- type Online
- type ParamsAccountAdd
- type ParamsAccountUpdate
- type ParamsMessage
- type ParamsMsgRecordList
- type ParamsSessionClose
- type ParamsSessionCreate
- type ParamsTyping
- type ParamsWorkerInvite
- type ResultAccountList
- type ResultMsgRecordList
- type ResultOnlineList
- type ResultSessionList
- type Session
- type TypeCmd
- type WaitCase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteAccount ¶
DeleteAccount 删除客服帐号 完整客服帐号,格式为:帐号前缀@公众号微信号
func GetAccountList ¶
func GetAccountList(result *ResultAccountList) wx.Action
GetAccountList 获取客服列表
func GetMsgRecordList ¶
func GetMsgRecordList(msgID, starttime, endtime int64, number int, result *ResultMsgRecordList) wx.Action
GetMsgRecordList 获取聊天记录(每次查询时段不能超过24小时) 聊天记录中,对于图片、语音、视频,分别展示成文本格式的[image]、[voice]、[video]。
func GetSession ¶
GetSession 获取客户会话状态 获取一个客户的会话,如果不存在,则kf_account为空。
func GetSessionList ¶
func GetSessionList(account string, result *ResultSessionList) wx.Action
GetSessionList 获取客服会话列表 完整客服帐号,格式为:帐号前缀@公众号微信号
func GetWaitCase ¶
GetWaitCase 获取未接入会话列表 最多返回100条数据,按照来访顺序
func InviteWorker ¶
InviteWorker 邀请绑定客服帐号 新添加的客服帐号是不能直接使用的,只有客服人员用微信号绑定了客服账号后,方可登录Web客服进行操作。 发起一个绑定邀请到客服人员微信号,客服人员需要在微信客户端上用该微信号确认后帐号才可用。 尚未绑定微信号的帐号可以进行绑定邀请操作,邀请未失效时不能对该帐号进行再次绑定微信号邀请。
func SendImageMsg ¶
SendImageMsg 发送客服图片消息(媒体ID,通过素材接口上传获得)
func SendMPNewsArticleMsg ¶
SendMPNewsArticleMsg 发送图文消息(点击跳转到图文消息页面)使用通过 “发布” 系列接口得到的 article_id 注意: 草稿接口灰度完成后,将不再支持此前客服接口中带 media_id 的 mpnews 类型的图文消息
func SendMPNewsMsg ¶
SendMPNewsMsg 发送图文消息(点击跳转到图文消息页面;图文消息条数限制在1条以内,注意,如果图文数超过1,则将会返回错误码45008)
func SendMenuMsg ¶
SendMenuMsg 发送客服菜单消息
func SendMinipPageMsg ¶
func SendMinipPageMsg(openID string, minipPage *MsgMinipPage, kfAccount ...string) wx.Action
SendMinipPageMsg 发送客服小程序卡片消息
func SendMusicMsg ¶
SendMusicMsg 发送客服音乐消息
func SendNewsMsg ¶
func SendNewsMsg(openID string, articles []*MsgArticle, kfAccount ...string) wx.Action
SendNewsMsg 发送客服图文消息(点击跳转到外链;图文消息条数限制在1条以内,注意,如果图文数超过1,则将会返回错误码45008)
func SendTextMsg ¶
SendTextMsg 发送客服文本消息(支持插入跳小程序的文字链)
func SendTyping ¶
SendTyping 下发当前输入状态(仅支持客服消息)
func SendVideoMsg ¶
SendVideoMsg 发送客服视频消息(媒体ID,通过素材接口上传获得)
func SendVoiceMsg ¶
SendVoiceMsg 发送客服语音消息(媒体ID,通过素材接口上传获得)
func SendWXCardMsg ¶
SendWXCardMsg 发送客服卡券消息(特别注意:客服消息接口投放卡券仅支持非自定义Code码和导入code模式的卡券的卡券)
func UploadAvatar ¶
UploadAvatar 上传客服头像(文件大小为5M以内)
Types ¶
type Account ¶
type Account struct { KFID string `json:"kf_id"` // 客服编号 KFAccount string `json:"kf_account"` // 完整客服帐号,格式为:帐号前缀@公众号微信号 KFNick string `json:"kf_nick"` // 客服昵称 KFHeadImgURL string `json:"kf_headimgurl"` // 客服头像 KFWX string `json:"kf_wx"` // 如果客服帐号已绑定了客服人员微信号, 则此处显示微信号 InviteWeixin string `json:"invite_wx"` // 如果客服帐号尚未绑定微信号,但是已经发起了一个绑定邀请, 则此处显示绑定邀请的微信号 InviteExpireTime int64 `json:"invite_expire_time"` // 如果客服帐号尚未绑定微信号,但是已经发起过一个绑定邀请, 邀请的过期时间,为unix 时间戳 InviteStatus InviteStatus `json:"invite_status"` // 邀请的状态,有等待确认“waiting”,被拒绝“rejected”, 过期“expired” }
Account 客服账号
type InviteStatus ¶
type InviteStatus string
InviteStatus 客服邀请状态
const ( InviteWaiting InviteStatus = "waiting" // 待确认 InviteRejected InviteStatus = "rejected" // 被拒绝 InviteExpired InviteStatus = "expired" // 已过期 )
微信支持的客服邀请状态
type MenuOption ¶
MenuOption 消息菜单选项
type MsgArticle ¶
type MsgArticle struct { Title string `json:"title"` // 图文消息的标题 Description string `json:"description"` // 图文消息的描述 URL string `json:"url"` // 图文消息被点击后跳转的链接 PicURL string `json:"picurl"` // 图文消息的图片链接,支持JPG、PNG格式,较好的效果为大图640*320,小图80*80 }
MsgArticle 消息图文
type MsgMPNewsArticle ¶
type MsgMPNewsArticle struct {
ArticleID string `json:"article_id"`
}
MsgMPNewsArticle 消息图文
type MsgMenu ¶
type MsgMenu struct { HeadContent string `json:"head_content"` TailContent string `json:"tail_content"` List []*MenuOption `json:"list"` }
MsgMenu 消息菜单
type MsgMinipPage ¶
type MsgMinipPage struct { Title string `json:"title"` // 消息标题 AppID string `json:"appid"` // 小程序的appid,要求小程序的appid需要与公众号有关联关系 PagePath string `json:"pagepath"` // 小程序的页面路径,跟app.json对齐,支持参数,比如pages/index/index?foo=bar ThumbMediaID string `json:"thumb_media_id"` // 小程序卡片图片的媒体ID,小程序卡片图片建议大小为520*416 }
MsgMinipPage 小程序卡片
type MsgMusic ¶
type MsgMusic struct { Title string `json:"title"` // 音乐消息的标题 Description string `json:"description"` // 音乐消息的描述 MusicURL string `json:"musicurl"` // 音乐链接 HQMusicURL string `json:"hqmusicurl"` // 高品质音乐链接,wifi环境优先使用该链接播放音乐 ThumbMediaID string `json:"thumb_media_id"` // 缩略图的媒体ID }
MsgMusic 消息音乐
type MsgRecord ¶
type MsgRecord struct { Worker string `json:"worker"` // 完整客服帐号,格式为:帐号前缀@公众号微信号 OpenID string `json:"openid"` // 用户标识 OperCode int `json:"opercode"` // 操作码(2002-客服发送信息,2003-客服接收消息) Text string `json:"text"` // 聊天记录 Time int64 `json:"time"` // 操作时间,unix时间戳 }
MsgRecord 客服聊天记录
type MsgVideo ¶
type MsgVideo struct { MediaID string `json:"media_id"` // 视频消息(点击跳转到图文消息页)的媒体ID ThumbMediaID string `json:"thumb_media_id"` // 缩略图的媒体ID Title string `json:"title"` // 视频消息的标题 Description string `json:"description"` // 视频消息的描述 }
MsgVideo 消息视频
type Online ¶
type Online struct { KFID string `json:"kf_id"` // 客服编号 KFAccount string `json:"kf_account"` // 完整客服帐号,格式为:帐号前缀@公众号微信号 Status int `json:"status"` // 客服在线状态,目前为:1-web在线 AcceptedCase int `json:"accepted_case"` // 客服当前正在接待的会话数 }
Online 在线客服
type ParamsAccountAdd ¶
type ParamsAccountUpdate ¶
type ParamsMessage ¶
type ParamsMessage struct { ToUser string `json:"touser"` MsgType event.MsgType `json:"msgtype"` Text *MsgText `json:"text,omitempty"` Image *MsgMedia `json:"image,omitempty"` Voice *MsgMedia `json:"voice,omitempty"` Video *MsgVideo `json:"video,omitempty"` Music *MsgMusic `json:"music,omitempty"` News *MsgNews `json:"news,omitempty"` MPNews *MsgMedia `json:"mpnews,omitempty"` MPNewsArticle *MsgMPNewsArticle `json:"mpnewsarticle,omitempty"` Menu *MsgMenu `json:"msgmenu,omitempty"` Card *MsgCard `json:"wxcard,omitempty"` MinipPage *MsgMinipPage `json:"miniprogrampage,omitempty"` CustomService *MsgKF `json:"customservice,omitempty"` }
ParamsMessage 客服消息参数
type ParamsMsgRecordList ¶
type ParamsSessionClose ¶
type ParamsSessionCreate ¶
type ParamsTyping ¶
type ParamsWorkerInvite ¶
type ResultAccountList ¶
type ResultAccountList struct {
KFList []*Account `json:"kf_list"`
}
type ResultMsgRecordList ¶
type ResultOnlineList ¶
type ResultOnlineList struct {
KFOnlineList []*Online `json:"kf_online_list"`
}
type ResultSessionList ¶
type ResultSessionList struct {
SessionList []*Session `json:"sessionlist"`
}
type Session ¶
type Session struct { KFAccount string `json:"kf_account"` // 正在接待的客服,为空表示没有人在接待 OpenID string `json:"openid"` // 粉丝的openid CreateTime int64 `json:"createtime"` // 会话接入的时间 LatestTime int64 `json:"latest_time"` // 粉丝的最后一条消息的时间 }
Session 客服会话