LaneWeChat

PHP微信开发框架,高效开发微信公众号应用。简洁而又轻量

GitHub下载 查看手册

多客服接口

Visits: 16257 Date: 2014-11-05 14:59:19 Power By 李轩Lane

    

1、类简介:客服功能接口。


        2、使用命名空间:use LaneWeChat\Core\CustomService;


        3、获取客服聊天记录接口,有分页,一次获取一页,一页最多1000条。不能跨日。

            在需要时,开发者可以通过获取客服聊天记录接口,获取多客服的会话记录,包括客服和用户会话的所有消息记录和会话的创建、关闭等操作记录。利用此接口可以开发如“消息记录”、“工作监控”、“客服绩效考核”等功能。

            CustomService::getRecord($startTime, $endTime, $pageIndex=1, $pageSize=1000, $openId='')

            'startTime':查询开始时间,UNIX时间戳

            'startTime':查询结束时间,UNIX时间戳,每次查询不能跨日查询


        4、将用户发送的消息转发到客服:

            调用ResponsePassive::forwardToCustomService($fromusername, $tousername)。

            如用户在微信给公众号发送一条文本消息“iphone 6 多少钱?”,我们就可以在lanewechat/wechatrequest.lib.php文件中的方法text(&$request)中收到这条消息(如果不了解为什么会在这里收到文本消息,请重头再看文档)。

            然后在text(&$request)方法中,我们可以调用ResponsePassive::forwardToCustomService($request['fromusername'], $request['tousername'])。那么刚才用户发的“iphone 6 多少钱?”就会被转发到客服系统,在微信的客服客户端中就可以收到了。


        5、添加客服帐号

            必须先在公众平台官网为公众号设置微信号后才能使用该能力。

            开发者可以通过本接口为公众号添加客服账号,每个公众号最多添加10个客服账号。

            CustomService::addAccount($kfAccount, $nickname, $password)

                $kfAccount String 完整客服账号,格式为:账号前缀@公众号微信号

                $nickname String 昵称

                $password String 密码


        6、修改客服帐号

            必须先在公众平台官网为公众号设置微信号后才能使用该能力。

            CustomService::editAccount($kfAccount, $nickname, $password)

                $kfAccount String 完整客服账号,格式为:账号前缀@公众号微信号

                $nickname String 昵称

                $password String 密码


        7、删除客服帐号

            必须先在公众平台官网为公众号设置微信号后才能使用该能力。

            CustomService::delAccount($kfAccount, $nickname, $password)

                $kfAccount String 完整客服账号,格式为:账号前缀@公众号微信号

                $nickname String 昵称

                $password String 密码


        8、获取所有客服账号

            必须先在公众平台官网为公众号设置微信号后才能使用该能力。

            CustomService::getAccountList($kfAccount, $nickname, $password)

                $kfAccount String 完整客服账号,格式为:账号前缀@公众号微信号

                $nickname String 昵称

                $password String 密码


        9、设置客服帐号的头像

            必须先在公众平台官网为公众号设置微信号后才能使用该能力。

            CustomService::setAccountImage($kfAccount, $imagePath)

                $kfAccount String 完整客服账号,格式为:账号前缀@公众号微信号

                $imagePath String 待上传的头像文件路径

Reply: aadfsf On 2015-09-24 20:59:20

CustomService::getAccountList($kfAccount, $nickname, $password)这个为什么要带上这三个值,不是get吗

回复

Add Comment
©2014~time() lanewechat.lanecn.com , All rights reserved. Power By LaneWeChat 微信PHP开发框架.  京ICP备14005030号-1