• Модуль: imopenlines
  • Путь к файлу: ~/bitrix/modules/imopenlines/lib/rest.php
  • Класс: BitrixImOpenLinesRest
  • Вызов: Rest::networkJoin
static function networkJoin($arParams, $n, CRestServer $server)
{
	$arParams = array_change_key_case($arParams, CASE_UPPER);
	if (!isset($arParams['CODE']) || mb_strlen($arParams['CODE']) != 32)
	{
		throw new RestException('You entered an invalid code', 'CODE', CRestServer::STATUS_WRONG_REQUEST);
	}

	if (!Loader::includeModule('imbot'))
	{
		throw new RestException('Module IMBOT is not installed', 'IMBOT_ERROR', CRestServer::STATUS_WRONG_REQUEST);
	}

	if (Network::isFdcCode($arParams['CODE']))
	{
		throw new RestException('Line not found', 'NOT_FOUND', CRestServer::STATUS_WRONG_REQUEST);
	}

	$result = Network::join($arParams['CODE']);
	if (!$result)
	{
		throw new RestException(Network::getError()->msg, Network::getError()->code, CRestServer::STATUS_WRONG_REQUEST);
	}

	return $result;
}