This is the Java library for the Messente Omnichannel API
Building the API client library requires:
- Java 1.7+
 - Maven/Gradle
 
To install the API client library to your local Maven repository, simply execute:
mvn clean installTo deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
mvn clean deployRefer to the OSSRH Guide for more information.
Add this dependency to your project's POM:
<dependency>
  <groupId>com.messente.omnichannel</groupId>
  <artifactId>omnichannel-java</artifactId>
  <version>0.1.0</version>
  <scope>compile</scope>
</dependency>Add this dependency to your project's build file:
compile "com.messente.omnichannel:omnichannel-java:0.1.0"At first generate the JAR by executing:
mvn clean packageThen manually install the following JARs:
target/omnichannel-java-0.1.0.jartarget/lib/*.jar
Please follow the installation instruction and execute the following Java code:
public class Main {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        // Configure HTTP basic authorization: basicAuth
        HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
        basicAuth.setUsername("<MESSENTE_API_USERNAME>");
        basicAuth.setPassword("<MESSENTE_API_PASSWORD>");
        OmnimessageApi apiInstance = new OmnimessageApi();
        Omnimessage omnimessage = new Omnimessage(); // Omnimessage | Omnimessage to be sent
        Viber viber = new Viber();
        viber.text("Viber text");
        viber.sender("Messente");
        SMS sms = new SMS();
        sms.text("SMS text");
        WhatsApp whatsApp = new WhatsApp();
        WhatsAppText whatsAppText = new WhatsAppText();
        whatsAppText.body("WhatsApp text");
        whatsApp.text(whatsAppText);
        omnimessage.setMessages(Arrays.<Object>asList(whatsApp, viber, sms));
        omnimessage.setTo("<recipient phone number in e.164 format>");
        try {
            OmniMessageCreateSuccessResponse result = apiInstance.sendOmnimessage(omnimessage);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling OmnimessageApi#sendOmnimessage");
            e.printStackTrace();
        }
    }
}All URIs are relative to https://api.messente.com/v1
| Class | Method | HTTP request | Description | 
|---|---|---|---|
| DeliveryReportApi | retrieveDeliveryReport | GET /omnimessage/{omnimessage_id}/status | Retrieves the delivery report for the Omnimessage | 
| OmnimessageApi | cancelScheduledMessage | DELETE /omnimessage/{omnimessage_id} | Cancels a scheduled Omnimessage | 
| OmnimessageApi | sendOmnimessage | POST /omnimessage | Sends an Omnimessage | 
- Channel
 - DeliveryReportResponse
 - DeliveryResult
 - Err
 - ErrorItem
 - ErrorResponse
 - MessageResult
 - OmniMessageCreateSuccessResponse
 - Omnimessage
 - ResponseErrorCode
 - ResponseErrorTitle
 - SMS
 - Status
 - Viber
 - WhatsAppAudio
 - WhatsAppDocument
 - WhatsAppImage
 - WhatsAppText
 
Authentication schemes defined for the API:
- Type: HTTP basic authentication
 
It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.