This is the official ClickSend SDK. Documentation can be found here.
- Sign Up for a free ClickSend account.
- Copy your API key from the API Credentials area.
- Java 1.7+
- Maven/Gradle
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.
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>
Add this dependency to your project's build file:
compile "com.github.clicksend:clicksend-java-client:1.0.0"
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
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 for our SDK and REST API can be found here.
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.