- Модуль: imconnector
- Путь к файлу: ~/bitrix/modules/imconnector/lib/rest/customconnectors.php
- Класс: BitrixImConnectorRestCustomConnectors
- Вызов: CustomConnectors::unRegister
static function unRegister($params, $n, CRestServer $server)
{
if ($server->getAuthType() !== Auth::AUTH_TYPE)
{
throw new AuthTypeException("Application context required");
}
$result = array(
'result' => false
);
$params = array_change_key_case($params, CASE_UPPER);
$clientId = $server->getClientId();
$row = AppTable::getByClientId($clientId);
$appId = $row['ID'];
if (!empty($appId))
{
if (!empty($params['ID']) && Helper::unRegisterApp(array(
'ID' => $params['ID'],
'REST_APP_ID' => $appId,
)))
{
$result = array(
'result' => true
);
}
else
{
$result = array(
'result' => false,
'error' => Library::ERROR_IMCONNECTOR_REST_APPLICATION_UNREGISTRATION_ERROR,
'error_description' => Loc::getMessage('IMCONNECTOR_REST_APPLICATION_UNREGISTRATION_ERROR')
);
}
}
else
{
$result = array(
'result' => false,
'error' => Library::ERROR_IMCONNECTOR_REST_NO_APPLICATION_ID,
'error_description' => Loc::getMessage('IMCONNECTOR_REST_NO_APPLICATION_ID')
);
}
return $result;
}