ballerinax/mft Ballerina library

1.0.0

Overview

This is a generated connector for MFT REST API v1.0 OpenAPI specification. The MFT REST API provides a secure AS2 secured channel for such communications, and offers your company, multiple ways to upload/download files, or automate the exchange through integration mechanisms.

Prerequisites

Before using this connector in your Ballerina application, complete the following:

Quickstart

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

Step 1: Import connector

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

Copy
import ballerinax/mft;

Step 2: Create a new connector instance

Create a mft:Client instance using an API token.

Copy
mft:Client mftClient = check new ({authorization: <VALID_API_TOKEN>});

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 on listing received messages.

    List Received Messages

    Copy
    public function main() {
        SuccessfulMessageListRetrievalResponse messageResponse = check mftClient->listReceivedMessages();
        if messageResponse.messages == [] {
            io:println("No messages received!!");
            return;
        }
        foreach var message in messageResponse.messages {
            io:println("MESSAGE ID >>>" +message.toString());
        }
    }

    Following is an example on single message retrieval.

    Retrieve an Inbox (Received) Message

    Copy
    public function main() {
        AS2Message messageResponse2 = check mftClient->retrieveInboxMessage(messageResponse1.messages[0]);
        io:println(">>>", messageResponse2);
    }

    Following is an example on listing certificates available.

    List Certificates

    Copy
    public function main() {
        SuccessfulCertListRetrievalResponse listCertificates = check mftClient->listCertificates();
        io:println(listCertificates);
    }
  2. Use bal run command to compile and run the Ballerina program.

Import

import ballerinax/mft;Copy

Metadata

Released date: over 2 years ago

Version: 1.0.0

License: Apache-2.0


Compatibility

Platform: any

Ballerina version: 2201.0.2

GraalVM compatible: Yes


Pull count

Total: 0

Current verison: 0


Weekly downloads


Source repository


Keywords

IT Operations/Message Brokers

Cost/Freemium


Contributors

Other versions

1.0.0