You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Есть раздел в навигаторе, есть вот эти пункты (API Module, API version, API action, API request parameter, API Action request param, API module request param), ведут на определенные справочники.

Сначала админ создает у себя API Module

Path - поковыряться в сервиснау

API Module это сущность, требуемая для объединения прочих сущностей, API version, API action.

Для создания нужно перейти в Scripted REST API → API Module и нажать New


To create an API Module, please complete the steps below:

  1. Navigate to Scripted REST API → API Module.
  2. Click New and fill in the form.
  3. Click Save or Save and Exit to apply changes.

API Module form fields

FieldDescription
NameSpecify the API module name.
PathRelative path to the API module, for example, '/api/cmdb.'
ActiveSelect this checkbox to make the module active or inactive. When set to FALSE, you'll be unable to choose this module in referencing tables (API Version, API Action, API Module Request Parameters). 

API version form fields

FieldDescription
ModuleSpecify the API module created earlier for this version.
ActiveSelect this checkbox to make the version active or inactive. When set to FALSE, you'll be unable to choose this version in referencing tables (API Action).
PathPath to the API version, for example, 'v1'.

API action form fields

FieldDescription
NameThe action name.
PathA path for API action.
ActiveSelect this action to make the version active or inactive. When set to FALSE, you'll be unable to choose this version in referencing tables (API Action Request Parameter).
Is Authentication RequiredSelect this checkbox if the request requires authentication before execution. The token is transmitted in the request header.
ModuleChoose the API Module created earlier (module must be activated before choosing). This field references the API Module (sys_api_module) table.
VersionChoose the API version created earlier (version must be activated before choosing). This field references the API Version (sys_api_version) table.
HTTP MethodSelect the method this action implements (GET, or POST, for example).
Scriptвводим скрипт, можно использовать классы SimpleRequest и SimpleResponse

API Request parameter form fields

FieldDescription
NameThe request parameter name.
Is requiredSelect this checkbox to make this parameter mandatory for all referenced API essences.

API action request parameters form fields

FieldDescription
ActionРеференс на API action
Request parameterРеференс на API request parameter

API Module request parameters form fields

FieldDescription
ModuleРеференс на API module
Request parameterРеференс на API request parameter
  • No labels