Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The https://finapi.jira.com/wiki/spaces/AAPD/pages/3226828807/Access+Java+SDK+usage#Authorization-and-Creation-of-a-User-Identity section described the necessary Java calls to create a user and retrieve a user token.

Note: The following usage examples assume that you retrieved a user token via the Access API first and registered it globally within the Web Form 2.0 SDK:

...

Code Block
AccountInformationServicesApi accountInformationServicesApi = new AccountInformationServicesApi();
WebForm webForm = accountInformationServicesApi.createForBankConnectionImport(new BankConnectionImportDetails());

The BankConnectionImportDetails class supports many parameters to control the web form flow behavior.
E.g. If the bank to be imported is already known, you can provide it as a service parameter, either the bank id or a search string, so the created web form won’t ask the user to select a bank.
The following example provides the id of the finAPI demo bank:

...

As a result of step 1, a web form is generated. Use webForm.getUrl() returned in the first step to present the web form to the user to authorize access (login at the bank and complete the second-factor authentication procedure).

No Web Form 2.0 API call is required for in this step.

Step 3 - Check the status of the Web Form

As no callback was registered during step 1 (which would have directly informed you about web form completion, including the status), you need to poll the “Get a web form” service unless it returns a final status. The id of the web form created in step 1 must be given as the parameter:

Code Block
AccountInformationServicesApi accountInformationServicesApi = new AccountInformationServicesApi();
WebForm updatedWebForm = new WebFormsApi().getWebForm(webForm.getId());

// TODO react on updatedWebForm.getStatus()

...

If the web form is finished successfully, the status of the bank connection can be checked, which is done with the Access API. Use bank connection may still be in the process of downloading accounts and transactions in the background (please check /wiki/spaces/AAPD/pages/2766405656 for details). So before you can access accounts and transactions, you need to wait until the update status is READY. Use the getBankConnection service for this and provide the bankConnectionId returned in step 3 as the parameter:

Code Block
if (updatedWebForm.getStatus() == COMPLETED) {
    BankConnectionsApi bankConnectionsApi = new BankConnectionsApi();
    BankConnection bankConnection = bankConnectionsApi.getBankConnection(
        updatedWebForm.getPayload().getBankConnectionId(), null);

    // TODO check bankConnection.getUpdateStatus()
}

...

 until 'READY'
}

Step 5 - Get Accounts and Transactions

Retrieving accounts Accounts and transactions is done with are available through the Access API. Please refer to https://finapi.jira.com/wiki/spaces/AAPD/pages/3226828807/Access+Java+SDK+usage#Get-Accounts-and-Transactions for SDK usage examples.

...