Skip to content

ClickSend/clicksend-java

Repository files navigation

The official Java library for ClickSend v3 API

This is the official ClickSend SDK. Documentation can be found here.

Requirements

  • Sign Up for a free ClickSend account.
  • Copy your API key from the API Credentials area.
  • Java 1.7+
  • Maven/Gradle

Installation

To install the API client library to your local Maven repository, simply execute:

mvn clean install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn clean deploy

Refer to the OSSRH Guide for more information.

Maven users

Add this dependency to your project's POM:

<dependency>
  <groupId>com.github.clicksend</groupId>
  <artifactId>clicksend-java-client</artifactId>
  <version>1.0.0</version>
  <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

compile "com.github.clicksend:clicksend-java-client:1.0.0"

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/clicksend-java-client-1.0.0.jar
  • target/lib/*.jar

Getting Started

Please follow the installation instruction and execute the following Java code:

import ClickSend.*;
import ClickSend.auth.*;
import ClickSend.Model.*;
import ClickSend.Api.AccountApi;

import java.io.File;
import java.util.*;

public class AccountApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure HTTP basic authorization: BasicAuth
        HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth");
        BasicAuth.setUsername("YOUR USERNAME");
        BasicAuth.setPassword("YOUR PASSWORD");

        AccountApi apiInstance = new AccountApi();
        try {
            String result = apiInstance.accountGet();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountApi#accountGet");
            e.printStackTrace();
        }
    }
}

Documentation

Documentation for our SDK and REST API can be found here.

Documentation for Authorization

Authentication schemes defined for the API:

BasicAuth

  • Type: HTTP basic authentication

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.

About

ClickSend Java SDK

Resources

Stars

Watchers

Forks

Packages

No packages published