class CB24{
// выполнить метод rest api
function method($auth, $method, $params){
$c=curl_init('https://'.$auth['auth']['domain'].'/rest/'.$method);
$params["auth"]=$auth['auth']['access_token'];
curl_setopt($c,CURLOPT_RETURNTRANSFER,true);
curl_setopt($c,CURLOPT_POST,true);
curl_setopt($c,CURLOPT_POSTFIELDS,http_build_query($params));
$response=curl_exec($c);
$response=json_decode($response,true);
return $response;
}
//пример запроса
// $cur_deal = $CB24->method($_REQUEST,'crm.deal.get.json',array(
// "id" => 26
// )
// );
// pre($cur_deal);
}
Класс для выполнения запросов к bitrix24 rest api
php class requests to bitrix24 rest api. В реквесте должен содержаться токен и домен. В параметрах можно указывать поля для фильтрации и сортировки. Метод будет возвращать json с данными.