session

package
v0.0.0-...-aad7e29 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeKfCreateSession = "kf_create_session" // 接入会话
	EventTypeKfCloseSession  = "kf_close_session"  // 关闭会话
	EventTypeKfSwitchSession = "kf_switch_session" // 转接会话
)

Variables

This section is empty.

Functions

func CloseSession

func CloseSession(clt *mp.Client, openId, kfAccount, text string) (err error)

关闭会话

openId:    必须, 客户openid
kfAccount: 必须, 完整客服账号,格式为:账号前缀@公众号微信号
text:      可选, 附加信息,文本会展示在客服人员的多客服客户端

func CreateSession

func CreateSession(clt *mp.Client, openId, kfAccount, text string) (err error)

创建会话

openId:    必须, 客户openid
kfAccount: 必须, 完整客服账号,格式为:账号前缀@公众号微信号
text:      可选, 附加信息,文本会展示在客服人员的多客服客户端

Types

type KfCloseSessionEvent

type KfCloseSessionEvent struct {
	XMLName struct{} `xml:"xml" json:"-"`
	mp.MessageHeader

	Event     string `xml:"Event"     json:"Event"`
	KfAccount string `xml:"KfAccount" json:"KfAccount"`
}

func GetKfCloseSessionEvent

func GetKfCloseSessionEvent(msg *mp.MixedMessage) *KfCloseSessionEvent

type KfCreateSessionEvent

type KfCreateSessionEvent struct {
	XMLName struct{} `xml:"xml" json:"-"`
	mp.MessageHeader

	Event     string `xml:"Event"     json:"Event"`
	KfAccount string `xml:"KfAccount" json:"KfAccount"`
}

func GetKfCreateSessionEvent

func GetKfCreateSessionEvent(msg *mp.MixedMessage) *KfCreateSessionEvent

type KfSwitchSessionEvent

type KfSwitchSessionEvent struct {
	XMLName struct{} `xml:"xml" json:"-"`
	mp.MessageHeader

	Event         string `xml:"Event"         json:"Event"`
	FromKfAccount string `xml:"FromKfAccount" json:"FromKfAccount"`
	ToKfAccount   string `xml:"ToKfAccount"   json:"ToKfAccount"`
}

func GetKfSwitchSessionEvent

func GetKfSwitchSessionEvent(msg *mp.MixedMessage) *KfSwitchSessionEvent

type Session

type Session struct {
	OpenId     string `json:"openid"`
	KfAccount  string `json:"kf_account"`
	CreateTime int64  `json:"createtime"`
}

func GetSession

func GetSession(clt *mp.Client, openId string) (ss *Session, err error)

获取客户的会话

func GetSessionList

func GetSessionList(clt *mp.Client, kfAccount string) (list []Session, err error)

获取客服的会话列表

开发者可以通过本接口获取某个客服正在接待的会话列表。

func GetWaitSessionList

func GetWaitSessionList(clt *mp.Client) (list []Session, totalCount int, err error)

获取未接入会话列表

开发者可以通过本接口获取当前正在等待队列中的会话列表,此接口最多返回最早进入队列的100个未接入会话。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL