$ch = curl_init();
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": "AccountManagement",
"token": "AQAAAAAW-*******************************",
"param": {"SelectionCriteria": {}, "Action": "Get"}}'); //Post Fields
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$headers = [
'POST /json/v5/ads/ HTTP/1.1',
'Host: api.direct.yandex.com',
'Authorization: Bearer AQAAAAAW-**********************************',
'Accept-Language: ru',
'Client-Login: *************@yandex.ru',
'Content-Type: application/json; charset=utf-8',
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$server_output = curl_exec ($ch);
curl_close ($ch);
$balance_direct_miramall = json_decode($server_output,true);