Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Есть раздел в навигаторе, есть вот эти пункты (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
Name
Человекочитаемое имя
Specify the API module name.
Path
Путь для запроса, например /restActiveБулевый чекбокс
Relative 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
Module
Референс на API Module ранее созданный. Будут доступны только активные модули (active = yes),ActiveБулевый чекбоксPathПуть для запроса
Specify 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
Name
Человекочитаемое имя
The action name.
Path
ПутьActiveБулевый чекбоксIs Authentication RequiredУказываем, если запрос требует аутентификации (токен передается в хедере запроса)ModuleРеференс на API ModuleVersionРеференс на API VersionHTTP MethodВыбираем метод (GET, POST, какой-то ещё)
A 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
Name
Человекочитаемое имя
The request parameter name.
Is required
Указать, если это требуемый параметр
Select 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