• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/classes/general/im_rest.php
  • Класс: CIMRestService
  • Вызов: CIMRestService::videoconfAdd
static function videoconfAdd($arParams, $n, CRestServer $server)
{
	throw new BitrixRestRestException('This method is not available', 'METHOD_NOT_AVAILABLE', CRestServer::STATUS_WRONG_REQUEST);

	$arParams = array_change_key_case($arParams, CASE_UPPER);

	if (
		BitrixImUser::getInstance()->isExtranet()
		|| BitrixImUser::getInstance()->isBot()
	)
	{
		throw new BitrixRestRestException("Only intranet users have access to this method.", "ACCESS_ERROR", CRestServer::STATUS_FORBIDDEN);
	}

	$arParams['BROADCAST_MODE'] = ($arParams['BROADCAST_MODE'] ?? 'N') === 'Y';

	$createResult = BitrixImCallConference::add($arParams);

	if (!$createResult->isSuccess())
	{
		$error = $createResult->getErrors()[0];
		throw new BitrixRestRestException($error->getMessage(), $error->getCode(), CRestServer::STATUS_WRONG_REQUEST);
	}

	return [
		'chatId' => $createResult->getData()['CHAT_ID'],
		'alias' => $createResult->getData()['ALIAS_DATA']['ALIAS'],
		'link' => $createResult->getData()['ALIAS_DATA']['LINK']
	];
}