Есть раздел в навигаторе, есть вот эти пункты (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:
- Navigate to Scripted REST API → API Module.
- Click New and fill in the form.
- Click Save or Save and Exit to apply changes.
API Module form fields
Field | Description |
---|---|
Name | Specify the API module name. |
Path | Relative path to the API module, for example, '/api/cmdb.' |
Active | Select 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
Field | Description |
---|---|
Module | Specify the API module created earlier for this version. |
Active | Select 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). |
Path | Path to the API version, for example, 'v1'. |
API action form fields
Field | Description |
---|---|
Name | The action name. |
Path | A path for API action. |
Active | Select 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 Required | Select this checkbox if the request requires authentication before execution. The token is transmitted in the request header. |
Module | Choose the API Module created earlier (module must be activated before choosing). This field references the API Module (sys_api_module) table. |
Version | Choose the API version created earlier (version must be activated before choosing). This field references the API Version (sys_api_version) table. |
HTTP Method | Select the method this action implements (GET, or POST, for example). |
Script | вводим скрипт, можно использовать классы SimpleRequest и SimpleResponse |
API Request parameter form fields
Field | Description |
---|---|
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
Field | Description |
---|---|
Action | Референс на API action |
Request parameter | Референс на API request parameter |
API Module request parameters form fields
Field | Description |
---|---|
Module | Референс на API module |
Request parameter | Референс на API request parameter |