- Модуль: im
- Путь к файлу: ~/bitrix/modules/im/classes/general/im_rest.php
- Класс: CIMRestService
- Вызов: CIMRestService::notifyConfirm
static function notifyConfirm($arParams, $n, CRestServer $server): array
{
$arParams = array_change_key_case($arParams, CASE_UPPER);
if (isset($arParams['NOTIFY_ID']))
{
$arParams['NOTIFY_ID'] = (int)$arParams['NOTIFY_ID'];
}
if (isset($arParams['ID']))
{
$arParams['NOTIFY_ID'] = (int)$arParams['ID'];
}
if ($arParams['NOTIFY_ID'] <= 0)
{
throw new BitrixRestRestException("Notification ID can't be empty", "ID_ERROR", CRestServer::STATUS_WRONG_REQUEST);
}
if (empty($arParams['NOTIFY_VALUE']))
{
throw new BitrixRestRestException("Notification Value can't be empty", "NOTIFY_VALUE_ERROR", CRestServer::STATUS_WRONG_REQUEST);
}
$CIMNotify = new CIMNotify();
$result = $CIMNotify->Confirm($arParams['NOTIFY_ID'], $arParams['NOTIFY_VALUE']);
return [
'result_message' => $result
];
}