• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/classes/general/im_rest.php
  • Класс: CIMRestService
  • Вызов: CIMRestService::dialogRead
static function dialogRead($arParams, $n, CRestServer $server)
{
	$arParams = array_change_key_case($arParams, CASE_UPPER);
	if (isset($arParams['LAST_ID']))
	{
		$arParams['MESSAGE_ID'] = $arParams['LAST_ID'];
	}
	$arParams['MESSAGE_ID'] = intval($arParams['MESSAGE_ID']);

	if ($arParams['MESSAGE_ID'] <= 0)
	{
		$arParams['MESSAGE_ID'] = null;
	}

	if ($arParams['DIALOG_ID'] !== 'notify' && !BitrixImCommon::isDialogId($arParams['DIALOG_ID']))
	{
		throw new BitrixRestRestException("Dialog ID can't be empty", "DIALOG_ID_EMPTY", CRestServer::STATUS_WRONG_REQUEST);
	}

	$result = BitrixImDialog::read($arParams['DIALOG_ID'], $arParams['MESSAGE_ID']);

	return self::objectEncode($result);
}