• Модуль: voximplant
  • Путь к файлу: ~/bitrix/modules/voximplant/classes/general/vi_rest.php
  • Класс: CVoxImplantRestService
  • Вызов: CVoxImplantRestService::searchCrmEntities
static function searchCrmEntities($params, $n, $server)
{
	$params['PHONE_NUMBER'] ??= null;

	$phoneNumber = (string)$params['PHONE_NUMBER'];

	if ($phoneNumber == '')
	{
		throw new BitrixRestRestException('PHONE_NUMBER is empty');
	}

	$result = RestHelper::searchCrmEntities($phoneNumber);
	if (!$result->isSuccess())
	{
		throw new BitrixRestRestException(implode('; ', $result->getErrorMessages()));
	}

	return $result->getData();
}