获取到的微信多客服聊天记录为空

WBOY
Release: 2016-06-20 12:31:37
Original
1521 people have browsed it


微信多客服在多客服功能下有了一次改版,现在再去获取多客服的聊天记录获取的内容一直为空:{"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  过期了 

其实代码没问题,换了一个谷歌浏览器就成功了,搜狗浏览器太渣了,花了我半天的时间。。。。
还是谢谢你
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template