I'am using cURL for PHP to get the insights. This is the code:
$dataArray = array(
"access_token"=>$access_token,
"fields"=>("date_start")
);
$url = "https://graph.facebook.com/v9.0/23846569935620196/insights";
$ch = curl_init();
$data = http_build_query($dataArray);
$getUrl = $url."?".$data;
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_URL, $getUrl);
curl_setopt($ch, CURLOPT_TIMEOUT, 80);
$response = curl_exec($ch);
if(curl_error($ch)){
echo 'Request Error:' . curl_error($ch);
}
else
{
var_dump($response);
}
curl_close($ch);
But I don't recive any data? why?