Make calls to SWIFT APIs is easy using SWIFT SDK. All you need to do is add the SWIFT SDKs as dependency when building your Java application through Maven or Gradle.
We built this demo Java application with Maven to show you how we are using it to make calls to SWIFT gpi APIs in the API Sandbox.
- Java 11 and below
- maven 3.5.* and above
Download SWIFT SDK from SWIFT Developer Portal, login is required for download.
Unpackage the zip file and install the dependency in your local .m2 repository.
$ install.sh
Update config/config-swift-connect.yaml
with your application credentials, consumer-key & consumer-secret. Obtain from SWIFT Developer Portal by creating an app.
To use forward proxies update config/config-swift-connect-fp.yaml
with your application credentials, consumer-key & consumer-secret and forward proxy information. Obtain from SWIFT Developer Portal by creating an app.
$ mvn clean install
$ java -Dlog4j.configuration=file:config/log4j.properties -jar target/gpi-v4-demo-jar-with-dependencies.jar config/config-swift-connect.yaml
To use forward proxies:
$ java -Dlog4j.configuration=file:config/log4j.properties -jar target/gpi-v4-demo-jar-with-dependencies.jar config/config-swift-connect-fp.yaml
The keystore (conf/keystore.jks) has these several entried that may need renewing when the Sandbox certificate is renewed:
- globalsign_root_ca_r3, 18 Oct 2022, trustedCertEntry, Sandbox server root ca
- globalsign_rsa_ov_ssl_ca_2018, 18 Oct 2022, trustedCertEntry, Sandbox server sub ca
- sandbox_pub, 18 Oct 2022, trustedCertEntry, Sandbox server cert. Potentially not needed given its roots are present (see above)
- selfsigned, 18 Jun 2020, PrivateKeyEntry, Demo client key