The WeChat multi-Customer Service chat record obtained is blank.

Source: Internet
Author: User
The multi-Customer Service chat record obtained is empty. the multi-customer service record has been revised with the multi-customer service function. now, the content obtained from the chat record of the multi-customer service is blank: {"recordlist": []}
Below is my code


$ Data = '{
"Starttime": 1460304001,
"Endtime": 1460372401,
"Pageindex": 1,
"Pagesize": 1
}';

// Request a chat record
$ Url = 'https: // api.weixin.qq.com/customservice/msgrecord/getrecord? Access_token = '. $ ACC_TOKEN;
$ Result = https_post ($ url, $ data );

Echo $ result ."
";

// Retrieve the chat record
$ 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;
}


Reply to discussion (solution)

I think two of them may have changed the data structure submitted at the moment. your access_token is no longer expired.

I think two of them may have changed the data structure submitted at the moment. your access_token is no longer expired.

In fact, there is no problem with the code. after a Google browser is changed, the Sogou browser is too scum. it took me half a day ....
Thank you.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.