客服
使用客服系統(tǒng)可以向用戶發(fā)送消息以及群發(fā)消息,客服的管理等功能。
客服管理
獲取所有客服
$officialAccount->customerService->list();
獲取所有在線的客服
$officialAccount->customerService->online();
添加客服
$officialAccount->customerService->create('foo@test', '客服1');
修改客服
$officialAccount->customerService->update('foo@test', '客服1');
刪除賬號(hào)
$officialAccount->customerService->delete('foo@test');
設(shè)置客服頭像
// $avatarPath 為本地圖片路徑,非 URL
$officialAccount->customerService->setAvatar('foo@test', $avatarPath);
獲取客服與客戶聊天記錄
$officialAccount->customerService->messages($startTime, $endTime, $msgId = 1, $number = 10000);
使用示例:
<?php
$records = $officialAccount->customerService->messages('2015-06-07', '2015-06-21', 1, 20000);
主動(dòng)發(fā)送消息給用戶
$officialAccount->customerService->send(array $message);
$message 為數(shù)組,請(qǐng)參考:消息
使用示例:
暫略。
邀請(qǐng)微信用戶加入客服
以賬號(hào) foo@test
邀請(qǐng) 微信號(hào) 為 xxxx
的微信用戶加入客服。
$officialAccount->customerService->invite('foo@test', 'xxxx');
客服會(huì)話控制
創(chuàng)建會(huì)話
$officialAccount->customerServiceSession->create('test1@test', 'OPENID');
關(guān)閉會(huì)話
$officialAccount->customerServiceSession->close('test1@test', 'OPENID');
獲取客戶會(huì)話狀態(tài)
$officialAccount->customerServiceSession->get('OPENID');
獲取客服會(huì)話列表
$officialAccount->customerServiceSession->list('test1@test');
獲取未接入會(huì)話列表
$officialAccount->customerServiceSession->waiting();