客服消息接口#
- class wechatpy.client.api.WeChatCustomService(client=None)[源代码]#
- add_account(account, nickname, password)[源代码]#
-
- 参数
account – 完整客服账号,格式为:账号前缀@公众号微信号
nickname – 客服昵称,最长6个汉字或12个英文字符
password – 客服账号登录密码
- 返回
返回的 JSON 数据包
- close_session(openid, account, text=None)[源代码]#
多客服关闭会话 详情请参考 https://developers.weixin.qq.com/doc/offiaccount/Customer_Service/Session_control.html
- 参数
openid – 客户 openid
account – 完整客服帐号,格式为:帐号前缀@公众号微信号
text – 附加信息,可选
- 返回
返回的 JSON 数据包
- create_session(openid, account, text=None)[源代码]#
多客服创建会话 详情请参考 https://developers.weixin.qq.com/doc/offiaccount/Customer_Service/Session_control.html
- 参数
openid – 客户 openid
account – 完整客服帐号,格式为:帐号前缀@公众号微信号
text – 附加信息,可选
- 返回
返回的 JSON 数据包
- get_online_accounts()[源代码]#
获取在线客服接待信息 详情请参考 http://mp.weixin.qq.com/wiki/9/6fff6f191ef92c126b043ada035cc935.html
- 返回
客服接待信息列表
- get_records(start_time, end_time, msgid=1, number=10000)[源代码]#
获取客服聊天记录 详情请参考 https://developers.weixin.qq.com/doc/offiaccount/Customer_Service/Obtain_chat_transcript.html
- 参数
start_time – 查询开始时间,UNIX 时间戳
end_time – 查询结束时间,UNIX 时间戳,每次查询不能跨日查询
msgid – 消息id顺序从小到大,从1开始
number – 每次获取条数,最多10000条
- 返回
返回的 JSON 数据包
- get_session(openid)[源代码]#
获取客户的会话状态,如果不存在,则 kf_account 为空 详情请参考 https://developers.weixin.qq.com/doc/offiaccount/Customer_Service/Session_control.html
- 参数
openid – 粉丝的 openid
- 返回
返回的 JSON 数据包
- get_session_list(account)[源代码]#
获取客服的会话列表 详情请参考 https://developers.weixin.qq.com/doc/offiaccount/Customer_Service/Session_control.html
- 参数
account – 完整客服帐号,格式为:帐号前缀@公众号微信号
- 返回
客服的会话列表
- get_wait_case()[源代码]#
获取未接入会话列表 详情请参考 https://developers.weixin.qq.com/doc/offiaccount/Customer_Service/Session_control.html
- 返回
返回的 JSON 数据包
- update_account(account, nickname, password)[源代码]#
-
- 参数
account – 完整客服账号,格式为:账号前缀@公众号微信号
nickname – 客服昵称,最长6个汉字或12个英文字符
password – 客服账号登录密码
- 返回
返回的 JSON 数据包