include 'header.php';
$ch = curl_init();
$id=$_GET['id_company'];
curl_setopt($ch, CURLOPT_URL,'https://api.direct.yandex.ru/live/v4/json/');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,'{"method":"GetSummaryStat","params":{"CampaignIDS":['.$id.']}}'); //Post Fields
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$headers = [
'Host: api.direct.yandex.com',
"Authorization: Bearer ".$_SESSION['token'],
'Accept-Language: ru',
"Client-Login: ".$_SESSION['email'],
'Content-Type: application/json; charset=utf-8',
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$server_output = curl_exec ($ch);
$server_output = json_decode($server_output,true);
curl_close ($ch);
print_r($server_output);
?>