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.
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:
- RunCopy
dotnet tool install dotnet-svcutil --global
- Copy the
<USERPROFILE_FOLDER>\.dotnet\tools
folder content to%WEB_APP_FOLDER%\bin
- Run
Follow the below steps to create a Web API client library.
- In the Main Menu, go to Ecosystem > Web API Client Libraries.
- In the Web API Client Libraries List page, click Insert.
- Fill in the library's details.
- Name - Enter a name for the Web API client library.
- Description - Optional library description.
- Min Platform Version - Optionally select the oldest API version endpoints you wish to extract from the source file.
- Use Service Account Token - Select if the library is used to Call External Services via Service Pipes, Call an Asynchronous Flow via API, or Product APIs. This will automatically manage authorization when a server automation script invokes the library. Otherwise, you will have to add the authorization code in your scripts (e.g.: Create a Server Automation Script that Invokes the Web API Client Library).
- API Definition - Paste the contents of the OpenAPI specification file.
- Click Save and Reload. After the library is generated, you can review its definitions in the Typescript Definition tab.
- 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.
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.