Skip to content

会话服务接口

Dong Chen edited this page Jun 24, 2016 · 1 revision

相关Client

  • cdcchen\wechat\qy\ChatClient

实例化Client

$client = new ChatClient($accessToken);

创建会话

Request

cdcchen\wechat\qy\chat\ChatCreateRequest

Client

$data = $client->create($name, $owner, array $users, $chatId = null);

获取会话

Request

cdcchen\wechat\qy\chat\ChatInfoRequest

Client

$data = $client->getInfo($id);

修改会话信息

Request

cdcchen\wechat\qy\chat\ChatUpdateRequest

Client

$data = $client->update(ChatUpdateRequest $request);

退出会话

Request

cdcchen\wechat\qy\chat\ChatQuitRequest

Client

$data = $client->quit($chatId, $opUser);

清除会话未读状态

Request

cdcchen\wechat\qy\chat\ChatClearNotifyRequest

Client

$data = $client->clearNotify($opUser, $chatType, $id);

设置成员新消息免打扰

Request

cdcchen\wechat\qy\chat\ChatSetMuteRequest

Client

$data = $client->setMute(array $openUsers, array $closeUsers = []);

发消息

Request

cdcchen\wechat\qy\chat\ChatSendMessageRequest

Client

$data = $client->send($receiverType, $receiverId, $sender, $msgType, $content);

发纯文本消息

Request

cdcchen\wechat\qy\chat\ChatSendTextRequest

Client

$data = $client->sendText($content, $receiverId, $sender, $receiverType);

发图片消息

Request

cdcchen\wechat\qy\chat\ChatSendImageRequest

Client

$data = $client->sendImage($mediaId, $receiverId, $sender, $receiverType);

发文件消息

Request

cdcchen\wechat\qy\chat\ChatSendFileRequest

Client

$data = $client->sendFile($mediaId, $receiverType, $receiverId, $sender);

发纯语音消息

Request

cdcchen\wechat\qy\chat\ChatSendVoiceRequest

Client

$data = $client->sendVoice($mediaId, $receiverType, $receiverId, $sender);

发链接消息

Request

cdcchen\wechat\qy\chat\ChatSendLinkRequest

Client

$data = $client->sendLink($receiverType, $receiverId, $sender, $title, $url, $thumbMediaId, $description = '');