private function getTask($request)
{
$number = intval($request->number);
$queryUrl = 'https://'.HomeController::DOMAIN.'.bitrix24.ru/rest/71/000000000000/task.item.getdata.json';
$queryData = http_build_query(array(
'TASKID' => $number
));
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_SSL_VERIFYPEER => 0,
CURLOPT_POST => 1,
CURLOPT_HEADER => 0,
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => $queryUrl,
CURLOPT_POSTFIELDS => $queryData,
));
$result = curl_exec($curl);
curl_close($curl);
$result = json_decode($result, 1);
if ($result['error']) {
if (strpos($result['error_description'], 'Task not found')) {
echo "Неверно введен номер задачи";
return view('welcome');
// die;
}
}
dd($result);
}