微信多客服在多客服功能下有了一次改版,现在再去获取多客服的聊天记录获取的内容一直为空:{"recordlist":[]}
以下是我的代码
$data = ' {
"starttime" :1460304001,
"endtime" : 1460372401,
"pageindex" : 1,
"pagesize" : 1
}';
//请求聊天记录
$url = 'https://api.weixin.qq.com/customservice/msgrecord/getrecord?access_token='.$acc_token;
$result = https_post($url,$data);
echo $result."
";
//取出得到的聊天记录
$jsoninfo = json_decode($result);
$json_data = $jsoninfo->recordlist;
function https_post($url,$data)
{
$curl = curl_init();
curl_setopt($curl, curlopt_url, $url);
curl_setopt($curl, curlopt_ssl_verifypeer, false);
curl_setopt($curl, curlopt_ssl_verifyhost, false);
curl_setopt($curl, curlopt_post, 1);
curl_setopt($curl, curlopt_postfields, $data);
echo "curl:".$data."
";
curl_setopt($curl, curlopt_returntransfer, 1);
$result = curl_exec($curl);
if (curl_errno($curl)) {
return 'errno'.curl_error($curl);
}
curl_close($curl);
return $result;
}
我觉得有两中可能 一时提交的数据结构变了 再不就是你access_token 过期了
我觉得有两中可能 一时提交的数据结构变了 再不就是你access_token 过期了
其实代码没问题,换了一个谷歌浏览器就成功了,搜狗浏览器太渣了,花了我半天的时间。。。。
微信是一款手机通信软件,支持通过手机网络发送语音短信、视频、图片和文字。微信可以单聊及群聊,还能根据地理位置找到附近的人,带给大家全新的移动沟通体验,有需要的小伙伴快来保存下载体验吧!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号