• Модуль: imopenlines
  • Путь к файлу: ~/bitrix/modules/imopenlines/lib/rest.php
  • Класс: BitrixImOpenLinesRest
  • Вызов: Rest::crmCreateLead
static function crmCreateLead($arParams, $n, CRestServer $server): bool
{
	$control = new BitrixImOpenLinesOperator($arParams['CHAT_ID']);
	$result = $control->createLead();

	if (!$result->isSuccess())
	{
		$errors = $result->getErrors();
		$error = current($errors);
		throw new RestException($error->getMessage(), $error->getCode(), CRestServer::STATUS_WRONG_REQUEST);
	}

	return true;
}