ballerinax/shorten.rest Ballerina library

1.5.2

Overview

The Shorten.REST API v1.0 connector(https://docs.shorten.rest/) OpenAPI specification.
The Shorten.REST API provides the capability to programmatically create short URLs for longer URL.

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:

  1. Create a Shorten.REST account.
  2. Obtain tokens - Follow this guide.

Quickstart

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

Step 1: Import connector

First, import the ballerinax/shorten.rest module into the Ballerina project.

Copy
import ballerinax/shorten.rest;

Step 2: Create a new connector instance

You can now make the connection configuration using the Shorten.REST API keys config.

Copy
rest:ApiKeysConfig & readonly apiKeyConfig = ?;
rest:Client baseClient = check new Client(apiKeyConfig);

Step 3: Invoke connector operation

Following is code demonstrates how to get all aliases using ballerinax/shorten.rest connector.

Copy
public function main() returns error? {
    rest:GetAliasesModel entity = check baseClient->getAliases();
}

Import

import ballerinax/shorten.rest;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: 31

Current verison: 0


Weekly downloads


Source repository


Keywords

Type/Connector

Vendor/Shorten.REST

Area/Marketing & Social Media

Marketing/Url Shortener

Cost/Freemium


Contributors