APIs

APIs

Introduction

 

The following describes the InterFormNG2 APIs.

 

<NG2_URL> is used to denote the base URL of InterFormNG2, by default https://localhost:8086

 

 

Swagger documentation

Swagger documentation for external API, authorization and webservice input is available for the InterFormNG2 apis. This documentation is available on: https://localhost:8086/swagger-ui.html

You need to sign on to InterFormNG2 first in order to access this documentation. One way to do that is to sign on to InterFormNG2 first via https://localhost:8086

and then add this: "/swagger-ui.html" (without "") to the address in the browser. Then you will see this:

 

NG2Swagger001

 

 

Testing with Postman

The API can for instance be tested with Postman.

The attached zip file contains an environment definition and a request collection for Postman. This can be unzipped and then the two files can be imported to a Postman workspace.

 

 

Authentication

The token request returns an access token that is used for authentication/authorization on all other requests. The access_token must be used as an authorization HTTP header of "bearer" type on all other requests.

 

The request Content-Type header must be "application/x-www-form-urlencoded".

 

The Authorization header must be basic auth with username "interform" and password "Io14oarPPnv3Bso10bagGA9Ovns2lvxt".

 

POST <NG2_URL>/oauth/token

 

Input:

Key

Value

username

<username>[/tenantId]

password

password of the user above

grant_type

"password"

 

 

For username, it is enough to specify user name if the user is only associated with one tenant. If the user is associated with multiple tenants, then the tenant id must also be specified.

Note that the grant_type is the constant value "password".

 

JSON example output:

 

{

 "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwd0NoYW5nZVJlcXVpcmVkIjp0cnVlLCJ1c2VyX25hbWUiOiJyZW1vdGVAaW50ZXJmb3JtNDAwLmNvbSIsInNjb3BlIjpbInJlYWQiLCJ3cml0ZSJdLCJ0ZW5hbnRJZCI6ImltcG9ydCIsImV4cCI6MTYxOTUyMzM0MSwiYXV0aG9yaXRpZXMiOlsiUk9MRV9XRUJfU0VSVklDRSJdLCJqdGkiOiJhMGE1ZjcyZi02Mzc0LTRhZDEtYWZkNy0wZjZhODdlZDUyOTUiLCJjbGllbnRfaWQiOiJpbnRlcmZvcm0ifQ.G9-gN51l3TbShPOdydCJND88xgHdlQUawpanQUDKcHo",

 "token_type": "bearer",

 "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwd0NoYW5nZVJlcXVpcmVkIjp0cnVlLCJ1c2VyX25hbWUiOiJyZW1vdGVAaW50ZXJmb3JtNDAwLmNvbSIsInNjb3BlIjpbInJlYWQiLCJ3cml0ZSJdLCJhdGkiOiJhMGE1ZjcyZi02Mzc0LTRhZDEtYWZkNy0wZjZhODdlZDUyOTUiLCJ0ZW5hbnRJZCI6ImltcG9ydCIsImV4cCI6MTYxOTU1NTc0MSwiYXV0aG9yaXRpZXMiOlsiUk9MRV9XRUJfU0VSVklDRSJdLCJqdGkiOiJkNmFjYTRhYi0zOTk2LTRkNDctOTNlOC1iYWY1YWIyMGQ3YzYiLCJjbGllbnRfaWQiOiJpbnRlcmZvcm0ifQ.6H3CvvMnbukeKktwT61gJuIAaDVxmkcKQNdlJKz9uQY",

 "expires_in": 3599,

 "scope": "read write",

 "pwChangeRequired": true,

 "tenantId": "default",

 "jti": "a0a5f72f-6374-4ad1-afd7-0f6a87ed5295"

}

 

The access_token must be used as Authorization bearer token on subsequent requests.

expires_in is the number of seconds until the token expires and must be renewed.

Other values are irrelevant for API usage.

 

These sections of APIs are available:

 

1.APIs for job logs

2.APIs for printers

    • Related Articles

    • APIs for job logs

      Below the APIs for job logs are listed. APIs are introduced here. Get job log names This returns a list of all the logger names that are used in the job log. These can be used as filter criteria when searching the job log. GET ...
    • APIs for printers

      Below you see a list of the APIs for printers in InterFormNG2. APIs are introduced here. List system printer names This returns a list with the names of all printers that are installed on the O/S on the InterFormNG2 host machine. GET ...
    • Call external HTTP(s) rest apis

      Calling external HTTP(s) rest api's In InterFormNG2 it is possible to call (most) external HTTP REST APIs / Webservices and form submits using workflow components. The calls are based on RFC2616 Hypertext Transfer Protocol HTTP/1.1 ...
    • Settings

      The settings of InterFormNG2 are set in two levels: 1.Settings for system level. These settings are used globally on the InterFormNG2 installation - for all tenants. 2.Settings for tenant. These are the settings for one specific tenant/environment. ...
    • HTTP Post multipart Request

      In InterFormNG2 it is possible to call (most) external HTTP REST APIs / Webservices and form submits using workflow components. The calls are based on RFC2616 Hypertext Transfer Protocol HTTP/1.1 https://www.ietf.org/rfc/rfc2616.txt The external HTTP ...