Module interzoid.globaltime
ballerinax/interzoid.globaltime Ballerina library
Overview
The Interzoid Get Global Time API connector(https://www.interzoid.com/services/getglobaltime) OpenAPI specification.
The Interzoid Get Global Time connector module provides retrieves the current time for a city or geographic location around the globe. For additional help getting started with the API, visit Interzoid Get Global Time API.
Key Features
- Programmatic access to create and manage resources via REST API
- Manage user accounts and profiles
- Secure authentication with API key or OAuth support
Prerequisites
Before using this connector in your Ballerina application, complete the following:
- Create Interzoid Account
- Obtaining tokens - follow this link and obtain the license key.
Quickstart
To use the Interzoid zip code detailed information connector in your Ballerina application, update the .bal file as follows:
Step 1: Import connector
First, import the ballerinax/interzoid.globaltime module into the Ballerina project.
import ballerinax/interzoid.globaltime;
Step 2: Create a new connector instance
You can now make the connection configuration using license key.
You can do this step in two ways. You can use any one of this.
-
Option 1 : Configure license key in ballerina file directly.
globaltime:ApiKeysConfig apiKeyConfig = { license:"<PRIVATE LICENSE KEY>" }; globaltime:Client myClient = check new Client(apiKeyConfig); -
Option 2 : Configure license key in
Config.tomlfile and configure it in ballerina file, using configurables.- Set up license key in
Config.tomlas shown below.
[apiKeyConfig.apiKeys] license:"<PRIVATE LICENSE KEY>"- Configure the client in ballerina file as shown below.
configurable ApiKeysConfig & readonly apiKeyConfig = ?; globaltime:Client myClient = check new Client(apiKeyConfig); - Set up license key in
Step 3: Invoke connector operation
- You can get the current time for a global locale.
globaltime:GlobalTime time = myClient->getGlobalTime(locale); - Use
bal runcommand to compile and run the Ballerina program.