Module cloudmersive.currency
ballerinax/cloudmersive.currency Ballerina library
1.5.1
Overview
This is a generated connector from Cloudmersive OpenAPI specification.
The Cloudmersive Currency APIs help you retrieve exchange rates and convert prices between currencies.
Prerequisites
- Create a Cloudmersive account
- Obtain tokens
- Use this guide to obtain the API key related to your account.
Quickstart
To use the Cloudmersive Currency connector in your Ballerina application, update the .bal file as follows:
Step 1 - Import connector
First, import the ballerinax/cloudmersive.currency module into the Ballerina project.
import ballerinax/cloudmersive.currency;
Step 2 - Create a new connector instance
You can now make the connection configuration using the access token.
currency:ApiKeysConfig config = { apikey : "<your apiKey>" }; currency:Client baseClient = check new Client(clientConfig);
Step 3 - Invoke connector operation
- Get all currency types
currency:AvailableCurrencyResponse|error bEvent = baseClient->currencyExchangeGetAvailableCurrencies(); if (bEvent is currency:AvailableCurrencyResponse) { log:printInfo("Currency List: " + bEvent.toString()); } else { log:printError(msg = bEvent.toString()); }
- Use
bal run
command to compile and run the Ballerina program