Calling Connectors from the FintechOS Platform

The instructions below explain how to invoke a connector's capabilities in your server automation scripts.

Prerequisites

  • Make sure that the Data Core authentication settings are set up in the Configuration Manager. The following keys must be set:
    • kv/{environment name}/b2cportal/app-settings/DataCore_ClientId
    • kv/{environment name}/b2cportal/app-settings/DataCore_ClientSecret
    • kv/{environment name}/b2cportal/app-settings/DataCore_KeycloakUrl
  • Make sure that the desired connector is deployed and running on your environment (either production or sandbox). For more information on how to configure and monitor your connectors, see the Console Management Application API documentation.

1 Create a Web API Client Library for the Connector

Create a Web API client library based on the connector's API definitions file. See the FintechOS Studio documentation for information on how to create a client library from an OpenAPI specification file. Make sure to check the User Service Account Token option to automatically manage authorization when a server automation script invokes the library.

HINT  
You can use the Get Connector endpoint from the Console Management Application API to retrieve the connector's definition URL.

Once the library is generated, you can edit its definitions in the TypeScript Definition tab to optimize the IntelliSense auto-complete suggestions displayed in your code editor.

2 Save the Connector's Base URL in a Dedicated System Parameter

Create a system parameter to store the connector's Base URL. You will reference this system parameter whenever you import the connector's Web API client library.

HINT  
You can use the Get Connector endpoint from the Console Management Application API to retrieve the connector's base URL.

3 Create a Utility Code Library for the Desired Connector Capabilities

When using the connector to creating generic, technical capabilities that are independent from a specific implementation's data domain or business processes, it is recommended to store the desired methods in a dedicated utility code library. To do so, create a server automation script library that imports the Web API client library and defines any methods you find useful. E.g.:

Copy
let baseUrl = getSystemParameterByName("DataCore_BaseUrl");
let dcClient = importWebApiClient('DataCore_Lib', baseUrl);
function CreditReport (creditRequest){
    var response = dcClient.CreditReport(creditRequest);
    return(response);
}

function GetCreditReportHeaderRecord(creditRequest)
{
    var response = dcClient.CreditReport(creditRequest);
    return(response.creditProfile[0].headerRecord);
}

4 Invoke the Desired Methods in your Server Automation Scripts

To use the connector's capabilities in a server automation script, attach the utility library to the script and call the desired methods, e.g.:

var result= CreditReport(payload);