ballerinax/openair Ballerina library

1.5.2

Overview

The OpenAir API v1.0 connector(https://www.openair.com/download/OpenAirRESTAPIGuide.pdf) OpenAPI specification. The OpenAir REST API provides an interface for integration applications to exchange information with OpenAir. OpenAir REST API currently supports the following resources: Expense reports, Receipts, Attachments, Job codes, Contacts

Key Features

  • Programmatic access to create and manage resources via REST API
  • Access analytics, reports, and performance metrics
  • 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:

Quickstart

To use the OpenAir connector in your Ballerina application, update the .bal file as follows:

Step 1: Import connector

First, import the ballerinax/openair module into the Ballerina project.

Copy
import ballerinax/openair;

Step 2: Create a new connector instance

Create a openair:ClientConfig with bearer token obtained, then initialize the connector with it and the service URL according to the OpenAir REST API guide.

Copy
configurable http:BearerTokenConfig & readonly authConfig = ?;
openair:ClientConfig clientConfig = {auth : authConfig};
openair:Client baseClient = check new Client(clientConfig, serviceUrl = "<Service URL>");

Step 3: Invoke connector operation

  1. Now you can use the operations available within the connector. Note that they are in the form of remote operations.

    Following is an example to get a list of contacts using the connector.

    Copy
    public function main() {
        openair:OpenAirResponse|error response = baseClient->getContacts();
        if (response is openair:OpenAirResponse) {
            log:printInfo(response.toString());
        } else {
            log:printError(response.message());
        }
    }
  2. Use bal run command to compile and run the Ballerina program.

Import

import ballerinax/openair;Copy

Other versions

See more...

Metadata

Released date: 3 days ago

Version: 1.5.2

License: Apache-2.0


Compatibility

Platform: any

Ballerina version: 2201.8.0

GraalVM compatible: Yes


Pull count

Total: 30

Current verison: 0


Weekly downloads


Source repository


Keywords

Type/Connector

Vendor/OpenAI

Area/Productivity & Collaboration

Productivity/Project Management

Cost/Paid


Contributors