Поддержка серверов

REST: методы, функции, константы класса Битрикс


Блог разработчика

9 августа 2016 ResizeImageGet и простой водяной знак налету

Сегодня поговорим о том как проще всего воткнуть водяной знак на картинки в Битрикс. Например, на все изображения каталога.

21 июля 2016 Добавление вкладки в CRM коробки Битрикс24

В этом посте я покажу, как легко и просто добавить вкладку в сущность CRM. И не просто добавить, а вывести там свой контент.

21 июля 2016 Как просто обращаться из коробки Битрикс24 на сайт на базе Битрикс

К примеру вам хочется внутренним скриптом дернуть с сайта-магазина информацию, которая там, в свою очередь, закрыта некоторыми правами. Например, админскими. Можно конечно мутить свой REST, или иной формат общения, но проще всего воспользоваться штатным инструментом:

События модуля rest

СобытиеВызывается
onFindMethodDescriptionCRestServer::getMethodDescription
OnRestCheckAuthCRestUtil::checkAuth
OnRestAppDeleteCRestUtil::CleanApp
OnRestAppUpdateCRestUtil::UpdateApp
OnRestServiceBuildDescriptionCRestProvider::getDescription
OnRestAppTestCRestProvider::eventTest
OnRestAppInfoCRestProvider::appInfo
OnRestAppMethodConfirmNotifyIm::receive
OnRestAppInstallAppTable::install
OnAfterAppPaidAppTable::callAppPaymentEvent

Константы модуля rest

КонстантаПроверяется
REST_APAUTH_ALLOW_HTTPAuth::onRestCheckAuth
BX_COMP_MANAGED_CACHEAppTable::setAccess

Список функций и методов модуля rest

Метод
CRestEventHandlers::OnBeforeProlog()
CRestServer::__construct($params)
CRestServer::transportSupported($transport)
CRestServer::process()
CRestServer::processTokenCheckCall()
CRestServer::processCall()
CRestServer::getTransport()
CRestServer::getAuth()
CRestServer::getAuthData()
CRestServer::getQuery()
CRestServer::getAuthType()
CRestServer::getAppId()
CRestServer::getClientId()
CRestServer::getPasswordId()
CRestServer::getMethod()
CRestServer::setStatus($status)
CRestServer::setSecurityState($state = null)
CRestServer::getScope()
CRestServer::getScopeList()
CRestServer::getServiceDescription()
CRestServer::getTokenCheckSignature($method, $queryString)
CRestServer::getApplicationSignature()
CRestServer::requestConfirmation($userList, $message)
CRestServer::init()
CRestServer::checkSite()
CRestServer::getMethodDescription()
CRestServer::getMethodCallback()
CRestServer::checkScope()
CRestServer::checkAuth()
CRestServer::getMethodOptions()
CRestServer::makeSignature($key, $state)
CRestServer::outputError()
CRestServer::sendHeaders()
CRestServer::output($data)
CRestServer::outputJson($data)
CRestServer::outputXml($data)
CRestServerBatchItem::setApplicationId($appId)
CRestServerBatchItem::setAuthKeys($keys)
CRestServerBatchItem::setAuthData($authData)
CRestServerBatchItem::setAuthType($authType)
CRestServerBatchItem::checkAuth()
IRestService::getNavData($start, $bORM = false)
IRestService::setNavData($result, $dbRes)
IRestService::getDescription()
CRestUtil::sendHeaders()
CRestUtil::getStandardParams()
CRestUtil::getRequestData()
CRestUtil::isAdmin()
CRestUtil::signLicenseRequest(array $request, $licenseKey)
CRestUtil::ConvertDate($dt)
CRestUtil::ConvertDateTime($dt)
CRestUtil::unConvertDate($iso8601)
CRestUtil::unConvertDateTime($iso8601, $enableOffset = false)
CRestUtil::getMemberId()
CRestUtil::isStatic($url)
CRestUtil::GetFile($fileId)
CRestUtil::processBatchElement($query, $arResult, $keysCache = '')
CRestUtil::processBatchStructure($queryParams, $arResult, $keysCache = null)
CRestUtil::ParseBatchQuery($query, $arResult)
CRestUtil::getAuthForEvent($appId, $userId, array $additionalData = array())
CRestUtil::getAuth($appId, $appSecret, $scope, $additionalParams, $user_id = 0)
CRestUtil::checkAuth($query, $scope, &$res)
CRestUtil::makeAuth($res, $application_id = null)
CRestUtil::checkAppAccess($appId)
CRestUtil::updateAppStatus(array $tokenInfo)
CRestUtil::saveFile($fileContent, $fileName = "")
CRestUtil::CleanApp($appId, $bClean)
CRestUtil::InstallApp($code)
CRestUtil::UpdateApp($appId, $oldVersion)
CRestUtil::getScopeList(array $description = null)
CRestUtil::getEventList(array $description = null)
CRestUtil::getApplicationToken(array $application)
CRestUtil::getDownloadUrl($query, \CRestServer $server)
CRestUtil::getLanguage()
CRestUtil::getUploadUrl($query, \CRestServer $server)
CRestUtil::getSpecialUrl($method, $query, \CRestServer $server)
CRestUtil::getWebhookEndpoint($ap, $userId, $method = '')
CRestUtil::getAdministratorIdList()
CRestUtil::getApplicationPage($id, $type = 'ID', $appInfo = null)
CBitrixRestEntity::OnRestServiceBuildDescription()
CBitrixRestEntity::entityAdd($params, $n, $server)
CBitrixRestEntity::entityGet($params, $n, $server)
CBitrixRestEntity::entityRights($params, $n, $server)
CBitrixRestEntity::entityUpdate($params, $n, $server)
CBitrixRestEntity::entityDelete($params, $n, $server)
CBitrixRestEntity::entitySectionGet($params, $n, $server)
CBitrixRestEntity::entitySectionAdd($params, $n, $server)
CBitrixRestEntity::entitySectionUpdate($params, $n, $server)
CBitrixRestEntity::entitySectionDelete($params, $n, $server)
CBitrixRestEntity::entityItemGet($params, $n, $server)
CBitrixRestEntity::entityItemAdd($params, $n, $server)
CBitrixRestEntity::entityItemUpdate($params, $n, $server)
CBitrixRestEntity::entityItemDelete($params, $n, $server)
CBitrixRestEntity::entityItemPropertyGet($params, $n, $server)
CBitrixRestEntity::entityItemPropertyAdd($params, $n, $server)
CBitrixRestEntity::entityItemPropertyUpdate($params, $n, $server)
CBitrixRestEntity::entityItemPropertyDelete($params, $n, $server)
CBitrixRestEntity::Clean($appId)
CBitrixRestEntity::checkIblockType()
CBitrixRestEntity::getIBlock($code, $bSkipCheck = false)
CBitrixRestEntity::getIBlocks($server)
CBitrixRestEntity::getItemProperty($property, $entity, $server)
CBitrixRestEntity::getItemProperties($entity, $server)
CBitrixRestEntity::checkParams(&$params)
CBitrixRestEntity::checkItemParams(&$params)
CBitrixRestEntity::checkSectionParams(&$params)
CBitrixRestEntity::checkItemPropertyParams(&$params)
CBitrixRestEntity::checkEntity($entity, $server)
CBitrixRestEntity::checkItemProperty($property, $entity, $server)
CBitrixRestEntity::parseEntity($iblock, \CRestServer $server)
CBitrixRestEntity::getEntityIBlockCode($entity, \CRestServer $server)
CBitrixRestEntity::getIBlockType()
CBitrixRestEntity::prepareItem($params, $arIBlock, $server)
CBitrixRestEntity::prepareSection($params, $arIBlock, $server)
CBitrixRestEntity::checkFilter($arFilter, $bChangeLogic = true)
CBitrixRestEntity::checkSectionFilter($arFilter, $bChangeLogic = true)
CBitrixRestEntity::checkRights($arRights)
CBitrixRestEntity::getFile($fileId)
CRestEventCallback::__callStatic($name, $arguments)
CRestEventSession::Get()
CRestEventSession::Set($session)
CRestProvider::getDescription()
CRestProvider::getProfile($params, $n, \CRestServer $server)
CRestProvider::methodsBatch($arQuery, $start, \CRestServer $server)
CRestProvider::scopeList($arQuery, $n, \CRestServer $server)
CRestProvider::methodsList($arQuery, $n, \CRestServer $server)
CRestProvider::eventsList($arQuery, $n, \CRestServer $server)
CRestProvider::eventBind($params, $n, \CRestServer $server)
CRestProvider::eventUnbind($params, $n, \CRestServer $server)
CRestProvider::eventGet($params, $n, \CRestServer $server)
CRestProvider::eventTest($params, $n, \CRestServer $server)
CRestProvider::appInfo($params, $n, \CRestServer $server)
CRestProvider::appOptionGet($params, $n, \CRestServer $server)
CRestProvider::appOptionSet($params, $n, \CRestServer $server)
CRestProvider::userOptionGet($params, $n, \CRestServer $server)
CRestProvider::userOptionSet($params, $n, \CRestServer $server)
CRestProvider::OnAppEvent($arParams, $arHandler)
CRestProvider::OnAppPayment($arParams, $arHandler)
CRestProvider::getApp(\CRestServer $server)
CRestProvider::getScope(\CRestServer $server)
ProviderOAuth::instance()
ProviderOAuth::send(array $queryData)
Cback::__callStatic($handlerCode, $arguments)
Session::get()
Session::set($session)
Sender::parseEventName($name)
Sender::bind($moduleId, $eventName)
Sender::unbind($moduleId, $eventName)
Sender::getDefaultEventParams()
Sender::getAuth($appId, $userId, array $additionalData = array(), array $additional = array())
Sender::call($handlersList)
Sender::send()
Sender::getProvider()
Sender::setProvider(ProviderInterface $provider)
Sender::getDefaultProvider()
Auth::onRestCheckAuth(array $query, $scope, &$res)
Auth::setLastActivityDate($userId, $query)
Auth::requireHttpAuth()
Auth::checkHttpAuth()
UserFieldProxy::__construct($entityID, \CUser $user = null)
UserFieldProxy::getEntityID()
UserFieldProxy::getNamePrefix()
UserFieldProxy::setNamePrefix($prefix)
UserFieldProxy::getFields()
UserFieldProxy::getEnumerationElementFields()
UserFieldProxy::getSettingsFields($typeID)
UserFieldProxy::getTypes()
UserFieldProxy::add(array $fields)
UserFieldProxy::get($ID)
UserFieldProxy::getList(array $order, array $filter)
UserFieldProxy::update($ID, array $fields)
UserFieldProxy::delete($ID)
UserFieldProxy::sanitizeFields(array &$fields)
UserFieldProxy::isAuthorizedUser()
UserFieldProxy::isAdminUser()
UserFieldProxy::getCurrentUser()
UserFieldProxy::getAllLanguages()
UserFieldProxy::prepareLabels(array &$fields, $name, $defaultLabel)
UserFieldProxy::checkCreatePermission()
UserFieldProxy::checkReadPermission()
UserFieldProxy::checkUpdatePermission()
UserFieldProxy::checkDeletePermission()
UserFieldProxy::includeLangFile()
OAuthService::getEngine()
OAuthService::register()
OAuthService::unregister()
OAuthService::getMemberId()
OAuthService::getRedirectUri()
RemoteDictionary::__construct()
RemoteDictionary::setLanguage($language)
RemoteDictionary::init()
RemoteDictionary::load()
RemoteDictionary::getCacheId()
RemoteDictionary::getDictionaryUri()
UserFieldType::onRestServiceBuildDescription()
UserFieldType::getList($param, $nav, \CRestServer $server)
UserFieldType::add($param, $n, \CRestServer $server)
UserFieldType::update($param, $n, \CRestServer $server)
UserFieldType::delete($param, $n, \CRestServer $server)
UserFieldType::checkPermission(\CRestServer $server)
Placement::onRestServiceBuildDescription()
Placement::getList($query, $n, \CRestServer $server)
Placement::bind($params, $n, \CRestServer $server)
Placement::unbind($params, $n, \CRestServer $server)
Placement::get($params, $n, \CRestServer $server)
Placement::checkPermission(\CRestServer $server)
Placement::getScope(\CRestServer $server)
Placement::getApplicationInfo(\CRestServer $server)
Placement::getPlacementList(\CRestServer $server, $scopeList = null)
User::onRestServiceBuildDescription()
User::checkAllowedFields()
User::onUserInitialize($arParams, $arHandler)
User::isAdmin()
User::hasAccess($params)
User::getServerTime($params)
User::getAccess($params)
User::getFields()
User::userCurrent($query, $n, \CRestServer $server)
User::userGet($query, $nav = 0, \CRestServer $server)
User::userOnline()
User::userCounters($arParams)
User::userAdd($userFields)
User::userUpdate($userFields)
User::prepareUserData($userData, $allowedUserFields = null)
User::getUserData($userFields)
User::getDefaultSite()
Notify::__construct($notifyType, array $userList)
Notify::send($clientId, $token, $method, $message)
Notify::setType($notifyType)
Notify::getType()
Notify::setUserList(array $userList)
Notify::getUserList()
Notify::getNotifier()
EventTable::getTableName()
EventTable::getMap()
EventTable::deleteByApp($appId)
EventTable::deleteAppInstaller($appId)
EventTable::checkCallback($eventCallback, $appInfo, $checkInstallUrl = true)
EventTable::onBeforeUpdate(Main\Entity\Event $event)
EventTable::onBeforeAdd(Main\Entity\Event $event)
EventTable::bind($eventName)
EventTable::onAfterAdd(Main\Entity\Event $event)
EventTable::onAfterUpdate(Main\Entity\Event $event)
EventTable::checkUniq(Main\Entity\Event $event)
LogTable::getTableName()
LogTable::getMap()
LogTable::log(\CRestServer $server, $data)
LogTable::checkEntry(\CRestServer $server)
LogTable::addEntry(\CRestServer $server, $data)
Application::onApplicationsBuildList()
Application::generateAppPassword($siteTitle, array $scopeList)
Auth::check($accessToken)
Auth::checkOldPassword($userId, $password)
Auth::convertOldPassword($appPassword, $password)
Auth::checkPermission($passwordId, $scope)
Auth::getPasswordScope($passwordId)
PermissionTable::getTableName()
PermissionTable::getMap()
PermissionTable::onPasswordDelete(Main\Entity\Event $event)
PermissionTable::deleteByPasswordId($passwordId)
PermissionTable::cleanPermissionList(array $permissionList)
PasswordTable::getTableName()
PasswordTable::getMap()
PasswordTable::generatePassword($length = self::DEFAULT_LENGTH)
PasswordTable::createPassword($userId, array $scopeList, $siteTitle)
Sqs::queryItem($clientId, $url, $data, array $authData = array(), array $additional = array())
Auth::authorizeApplication($clientId, $userId, $state = '')
Auth::get($appId, $scope, $additionalParams, $userId)
Auth::updateTokenParameters($tokenInfo)
Auth::restore($accessToken)
Auth::store(array $authResult)
Auth::rewrite(array $authResult)
Auth::getCacheId($accessToken)
Auth::getTokenParams($additionalParams, $userId)
Engine::__construct()
Engine::getClient()
Engine::isRegistered()
Engine::getClientId()
Engine::getClientSecret()
Engine::setAccess(array $accessParams)
Engine::clearAccess()
Engine::getLicense()
Client::__construct($clientId, $clientSecret, $licenseKey)
Client::prepareRequestData($additionalParams)
Client::prepareRequest($additionalParams, $licenseCheck = false)
Client::prepareResponse($result)
Client::getHttpClient()
Client::getRequestUrl($methodName)
Client::call($methodName, $additionalParams = null, $licenseCheck = false)
Client::batch($actions)
Client::addApplication(array $applicationSettings)
Client::updateApplication(array $applicationSettings)
Client::deleteApplication(array $applicationSettings)
Client::installApplication(array $applicationSettings)
Client::unInstallApplication(array $applicationSettings)
Client::getAuth($clientId, $scope, array $additionalParams = array())
Client::checkAuth($accessToken)
Client::getCode($clientId, $state, $additionalParams)
Client::getApplicationList()
Client::sendEvent(array $eventItems)
HandlerHelper::checkCallback($handlerUrl, $appInfo, $checkInstallUrl = true)
HandlerHelper::storeApplicationList($PLACEMENT, $applicationList)
HandlerHelper::getApplicationList($PLACEMENT)
Client::getTop($action)
Client::getBuy($codeList)
Client::getUpdates($codeList)
Client::setAvailableUpdate($updateList = array())
Client::getAvailableUpdate($code = false)
Client::getAvailableUpdateNum()
Client::getCategories($forceReload = false)
Client::getCategory($code, $page = false)
Client::getApp($code, $version = false, $checkHash = false, $installHash = false)
Client::searchApp($q, $page = false)
Client::getInstall($code, $version = false, $checkHash = false, $installHash = false)
Client::getBuyLink($num, $appCode)
Client::getNumUpdates()
Transport::instance()
Transport::__construct()
Transport::call($method, $fields = array())
Transport::batch($actions)
Transport::prepareQuery($method, $fields)
Transport::prepareAnswer($response)
PlacementTable::getTableName()
PlacementTable::getMap()
PlacementTable::getHandlers($placement)
PlacementTable::deleteByApp($appId)
PlacementTable::getHandlersList($placement, $skipInstallCheck = false)
PlacementTable::clearHandlerCache()
PlacementTable::onBeforeUpdate(Main\Entity\Event $event)
PlacementTable::onBeforeAdd(Main\Entity\Event $event)
PlacementTable::onAfterAdd(Main\Entity\Event $event)
PlacementTable::onAfterUpdate(Main\Entity\Event $event)
PlacementTable::onAfterDelete(Main\Entity\Event $event)
PlacementTable::getCacheId($placement)
PlacementTable::checkUniq(Main\Entity\Event $event, $add = false)
Cback::bind($fields)
Cback::unbind($fields)
Cback::unbindByCode($handlerCode)
Cback::getUserTypeDescription($placementHandlerCode)
Cback::getUserTypeId($userTypeInfo)
Type::GetDBColumnType()
Type::GetPublicView($arUserField, $arAdditionalParameters = array())
Type::GetPublicEdit($arUserField, $arAdditionalParameters = array())
Type::GetEditFormHTML($arUserField, $arHtmlControl)
Type::GetEditFormHTMLMulty($arUserField, $arHtmlControl)
Type::getApplication($arUserField, $arHtmlControl, $mode = 'edit')
Type::PrepareSettings($arUserField)
Type::GetSettingsHTML($arUserField = false, $arHtmlControl, $bVarsFromForm)
Type::GetFilterHTML($arUserField, $arHtmlControl)
Type::GetFilterData($arUserField, $arHtmlControl)
Type::GetAdminListViewHTML($arUserField, $arHtmlControl)
Type::GetAdminListViewHTMLMulty($arUserField, $arHtmlControl)
Type::GetAdminListEditHTML($arUserField, $arHtmlControl)
GetAdminListEditHTMLMulty($arUserField, $arHtmlControl)
NotifyIm::__construct()
NotifyIm::send($clientId, $userId, $token, $method, $message)
NotifyIm::receive($module, $tag, $value, $notifyFields)
AppTable::getTableName()
AppTable::getMap()
AppTable::setSkipRemoteUpdate($v)
AppTable::onBeforeAdd(Main\Entity\Event $event)
AppTable::onAfterAdd(Main\Entity\Event $event)
AppTable::onAfterUpdate(Main\Entity\Event $event)
AppTable::onDelete(Main\Entity\Event $event)
AppTable::onAfterDelete(Main\Entity\Event $event)
AppTable::install($appId)
AppTable::uninstall($appId, $clean = 0)
AppTable::updateAppStatusInfo()
AppTable::callAppPaymentEvent($appId)
AppTable::getAppStatusInfo($app, $detailUrl)
AppTable::getAccess($appId)
AppTable::setAccess($appId, $newRights = array())
AppTable::getByClientId($clientId)
AppTable::clearClientCache($clientId)
AppTable::getLicenseLanguage()
AppTable::validateClientId()
AppTable::validateCode()
AppTable::validateUrl()
AppTable::validateUrlDemo()
AppTable::validateUrlInstall()
AppTable::validateVersion()
AppTable::validateScope()
AppTable::validateSharedKey()
AppTable::validateClientSecret()
AppTable::validateAppName()
AppTable::validateAccess()
AccessException::__construct($msg = '', \Exception $previous = null)
OAuthException::__construct($oauthResult, \Exception $previous = null)
OAuthException::getErrorCode()
RestException::__construct($message, $code = "", $status = 0, \Exception $previous = null)
RestException::getErrorCode()
RestException::setErrorCode($error_code)
RestException::getStatus()
RestException::setStatus($status)
RestException::setMessage($msg)
RestException::getAdditional()
RestException::setAdditional($error_additional)
RestException::setApplicationException(\CApplicationException $ex)
RestException::initFromException(\Exception $e)
AppLangTable::getTableName()
AppLangTable::getMap()
AppLangTable::deleteByApp($appId)
AppLangTable::validateLanguageId()
AppLangTable::validateMenuName()
rest::rest()
rest::InstallDB($arParams = array())
rest::UnInstallDB($arParams = array())
rest::InstallEvents()
rest::UnInstallEvents()
rest::InstallFiles($arParams = array())
rest::UnInstallFiles()
rest::DoInstall()
rest::DoUninstall()