我有一个api,我必须发送请求并获得电话录音的响应和客户的其他详细信息。我有开发者帐户,但现在我没有在响应对象中获得任何细节。
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://kpi.knowlarity.com/Basic/v1/account/calllog",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => array(
"authorization: *****",
"cache-control: no-cache",
"channel: Basic",
"content-type: application/json",
"end_time: 2017-03-14 12:00:00+05:30",
"postman-token: *****",
"start_time: 2017-03-13 12:00:00+05:30",
"x-api-key: *****"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo '<pre>';
echo $response;
}
反应: { &#34;元&#34; :{ &#34;限制&#34; :20, &#34;下一个&#34; :&#34;&#34;, &#34;偏移&#34; :0, &#34;以前&#34; :&#34;&#34;, &#34; TOTAL_COUNT&#34; :0 }, &#34;对象&#34; :[ ] }
答案 0 :(得分:0)
你可以包含这个
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
后 $ curl = curl_init();
答案 1 :(得分:0)
您可以在这里使用您的凭据以及您希望接收通话记录的开始日期。
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://kpi.knowlarity.com/Basic/v1/account/calllog",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => array(
"channel: Basic",
"x-api-key: ********",
"authorization: *******",
"content-type: application/json",
"start_time: 2018-07-01 12:00:00+05:30",
"end_time: 2018-07-09 12:00:00+05:30",
"cache-control: no-cache",
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}