Web API Client Libraries

Web API client libraries allow you to work with external APIs using proxy methods native to the FintechOS Platform development environment. Web API client libraries are generated automatically by FintechOS Studio from OpenAPI specification files supplied by the web service provider. Once generated, you can import the library into any server automation script that requires access to the API.

HINT  
You can access the API specification files of a FintechOS Platform instance at the following location: <host_address>/ftosapi/swagger/index.html

Create a Web API client library from an OpenAPI specification file


You should install the .Net core runtime version that corresponds to the FintechOS instance, even if there are other versions installed on the machine. For more details regarding the installation, go to https://docs.microsoft.com/en-us/dotnet/core/additional-tools/dotnet-svcutil-guide.

Additionally, depending on your .NET Core SDK version, run the following commands:

  • For .NET Core SDK 3.0 or above, run:
    Copy
    dotnet tool install dotnet-svcutil --tool-path <WEB_APP_FOLDER>\bin
  • For .NET Core SDK 2.2 or below:
    1. Run
      Copy
      dotnet tool install dotnet-svcutil --global
    2. Copy the <USERPROFILE_FOLDER>\.dotnet\tools folder content to %WEB_APP_FOLDER%\bin

Follow the below steps to create a Web API client library.

  1. In the Main Menu, go to Ecosystem > Web API Client Libraries.
  2. In the Web API Client Libraries List page, click Insert.
  3. Fill in the library's details.

  4. Click Save and Reload. After the library is generated, you can review its definitions in the Typescript Definition tab.
  5. Click Save and Close.

Use a Web API client library in server automation scripts

In your automation script, use the importWebApiClient function to import the Web API client library in a JSON object that contains the API specifications. The object exposes methods matching the API's endpoints and has full IntelliSense auto-complete support.

For details, see the Server SDK Reference Guide.

Add certificate support to WebApi client and WCF client

WebAPI client offers a way for consuming external web services by providing a definition for the external service with an OpenAPI file and import it into the platform and provide an object to use. This feature allows a user to work with web services and web sites that require a certificate authentication for example Certsign.

HINT  
To do so, the user needs a valid certificate.

There is a method for this process setCertificate which accepts workflow client certificate, this is to actually use a certificate. By using a server method that provides the certificate, this method uses the configurations from web.config. In the web.config file, the certificate needs to be configured by providing a storeLocation, storeName, thumbPrint.