• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/classes/general/im_rest.php
  • Класс: CIMRestService
  • Вызов: CIMRestService::diskFolderListGet
static function diskFolderListGet($arParams, $n, CRestServer $server)
{
	$arParams = array_change_key_case($arParams, CASE_UPPER);
	$lastId = $arParams['LAST_ID'] ?? null;
	$fileName = $arParams['SEARCH_FILE_NAME'] ?? null;
	$limit = self::getLimit($arParams);
	if (!isset($arParams['CHAT_ID']))
	{
		throw new BitrixRestRestException('CHAT_ID can`t be empty', 'CHAT_ID_EMPTY', CRestServer::STATUS_WRONG_REQUEST);
	}

	$chatId = $arParams['CHAT_ID'];
	$chat = BitrixImV2Chat::getInstance($chatId);

	if (!$chat->hasAccess())
	{
		throw new BitrixRestRestException('You do not have access to this chat', BitrixImV2RestRestError::ACCESS_ERROR, CRestServer::STATUS_FORBIDDEN);
	}

	$files = (new BitrixImV2LinkFileFileService())->getFilesBeforeMigrationFinished($chatId, $limit, $lastId, $fileName);

	return (new BitrixImV2RestRestAdapter($files))->toRestFormat();
}