Writing /giga/dw/dng/dokuwiki/data/meta/dev/010how/120websrv/0200webservswagger.meta failed
dev:010how:120websrv:0200webservswagger

Swagger UI - service layer interface description

DOKA-NG API Overview

The DOKA-NG Web Services Platform lets you build applications, websites, and services, based on the same infrastructure as DOKA-NG.
Using DOKA-NG APIs, applications can directly make use of DOKA-NG and DOKA-NG Cloud Platform resources. DOKA-NG transactions are available through the API layer as directly launched from the DOKA-NG application.
DOKA-NG Web Services are based on the flexibility of the REST style of architecture and use many Java Spring boot framework features, such as Spring Security and Spring Boot Actuator.

  • The Swagger UI tool is offered in order to explore the available APIs and their format.
  • Configuration is externalized via the application.properties file

DOKA-NG API Basic Quick Start Guide

DOKA-NG API Swagger UI

To login to the Swagger API:

  1. Open the swagger API in your browser:
    http://<IP Address>:<Port>/login


    Current link to Swagger UI: http://10.8.0.49:8180/

- expected result: The login window displays.

  1. Enter your username and password (e.g., User: “DO2”, password: “doka”) - expected result: The Swagger UI section structure displays.

Swagger UI

After you login, you can explore the available APIs and their format. The Swagger UI section structure is similar to the DOKA-NG menus.

API Execution

The DOKA-NG API Swagger enables you to visualize and interact with API resources.

DOKA-NG GET APIs

GET requests include all filtering-required data as parameters in the URL; for example, Get users API.

  • Press “Try it out” and “Execute” to invoke the API.

The response contains the execution status and list of records based on supplied filtering and pagination.

Swagger API: Basic Settings Services


DOKA-NG POST APIs

POST requests are used to launch the DOKA-NG transactions, for example, Opening an LC/Guarantee.
All Post transactions APIs are implemented in an asynchronous fashion:

  • When a valid request is received, the server immediately responds with success status and a related transaction request INR number (see Step 2 below).
  • /v1/systemAdministration/getTransactStatus

    is designed to supply the status progress – (see Step 3 below).

  • The X-CSRF-TOKEN cookie is mandatory in order to support Request Forgery (CSRF) Prevention.

Below is a sample Assets update API flow:

Step 1

Get X-CSRF-TOKEN for future use - Request Forgery (CSRF) Prevention:
In order to support, a CSRF token should be supplied in a X-CSRF-TOKEN cookie. To get the CSRF token there is /csrf GET API – not changed during the session

Step 2

Post API Invocation:
POST requests supply an input json format data in the message body and a X-CSRF-TOKEN cookie.
Post response contains success status and INR ID that represents transaction request unique reference number.

Swagger API: Assets Recognition Screen

Step 3

Get Transaction Status
getTransactStatus API, systemAdministration section, provides the transaction execution status and progress. The statuses are as follows: 'I' – Inserted, 'P' – Processed, 'E' – Error.

Swagger API: System Administration

DOKA-NG API System Info

The System Info API is accessible from the System Information section:

/v1/systemInformation/info

This provides information regarding the API deployment version, the DOKA-NG DB and the license.

Swagger API: System Information

dev/010how/120websrv/0200webservswagger.txt · Last modified: 2024/04/05 10:10 (external edit)