# Java SDK

Official Java client for the Instasent Transactional API. Download the JAR, construct an InstasentClient with your api_sms token, and call sendSms.

Thin client over the Transactional HTTP endpoints. For anything outside the methods below, use a plain HTTP client — the [Reference](/transactional-api/http/reference) documents every endpoint.

## Installation

Download the JAR and add it to your project's classpath:

- [JAR](https://github.com/instasent/instasent-java-lib/releases/download/0.1.4/instasent-java-lib.jar)
- [JAR with dependencies](https://github.com/instasent/instasent-java-lib/releases/download/v0.1.4/instasent-client-0.1.4-jar-with-dependencies.jar)

## Send an SMS

```java
import com.instasent.InstasentClient;
import java.io.IOException;
import java.util.Map;

public class Main {
    public static void main(String[] args) throws IOException {
        InstasentClient client = new InstasentClient(System.getenv("INSTASENT_TOKEN"), true);
        Map<String, String> response = client.sendSms("My company", "+34666666666", "test message");
        System.out.println(response);
    }
}
```

## Available methods

```java
client.sendSms(sender, to, text, callback);
client.getSms(page, perPage);
client.getSmsById(messageId);
```

## Getting help

For help installing or using the library, contact [support@instasent.com](mailto:support@instasent.com). Bugs and feature requests belong on the [GitHub repository](https://github.com/instasent/instasent-java-lib).
