- Модуль: imopenlines
- Путь к файлу: ~/bitrix/modules/imopenlines/lib/rest.php
- Класс: BitrixImOpenLinesRest
- Вызов: Rest::widgetActionSend
static function widgetActionSend($arParams, $n, CRestServer $server)
{
$arParams = array_change_key_case($arParams, CASE_UPPER);
if (isset($arParams['MESSAGE_ID']))
{
$arParams['ID'] = $arParams['MESSAGE_ID'];
}
$arParams['ID'] = (int)$arParams['ID'];
if ($arParams['ID'] <= 0)
{
throw new RestException('Message ID can't be empty', 'MESSAGE_ID_ERROR', CRestServer::STATUS_WRONG_REQUEST);
}
$result = WidgetAction::execute($arParams['ID'], $arParams['ACTION_VALUE']);
if ($result === false)
{
throw new RestException('Incorrect params', 'PARAMS_ERROR', CRestServer::STATUS_WRONG_REQUEST);
}
return true;
}