🚧 SignThem is currently in beta. Some features may be incomplete.
Integration Guide
SDK coming soon

Java Esignature API Integration

The SignThem REST API is fully accessible from Java using any HTTP library. The example below uses OkHttp 4.x and Gson, a common combination in Spring Boot and Android projects. A dedicated Java SDK with Maven/Gradle artifacts is on the roadmap - join the waitlist to be notified.

Installation

xml
# Maven - add to pom.xml
<dependency>
  <groupId>com.squareup.okhttp3</groupId>
  <artifactId>okhttp</artifactId>
  <version>4.12.0</version>
</dependency>

Create and send an envelope

The example below creates an envelope, adds a recipient with a signature field, and sends it. The recipient receives an email with a secure signing link.

Java
import okhttp3.*;
import com.google.gson.*;
import java.io.IOException;

public class SignThemExample {

    private static final String API_KEY  = System.getenv("SIGNTHEM_API_KEY");
    private static final String BASE_URL = "https://signthem.ai/api/v1";
    private static final OkHttpClient http   = new OkHttpClient();
    private static final Gson         gson   = new Gson();
    private static final MediaType    JSON   = MediaType.get("application/json");

    public static void main(String[] args) throws IOException {
        // 1. Create an envelope
        String createBody = gson.toJson(new JsonObject() {{
            addProperty("name", "Service Agreement");
            add("documents", new JsonArray() {{
                add(new JsonObject() {{
                    addProperty("url", "https://yourapp.com/contracts/agreement.pdf");
                }});
            }});
        }});

        Request createReq = new Request.Builder()
            .url(BASE_URL + "/envelopes")
            .header("Authorization", "Bearer " + API_KEY)
            .post(RequestBody.create(createBody, JSON))
            .build();

        String envelopeId;
        try (Response res = http.newCall(createReq).execute()) {
            JsonObject body = gson.fromJson(res.body().string(), JsonObject.class);
            envelopeId = body.get("id").getAsString();
        }

        // 2. Add recipient with signature field
        String recipientBody = gson.toJson(Map.of(
            "email",  "[email protected]",
            "name",   "Jane Smith",
            "fields", List.of(
                Map.of("type", "signature", "page", 1, "x", 100, "y", 600),
                Map.of("type", "date",      "page", 1, "x", 320, "y", 600)
            )
        ));

        Request addReq = new Request.Builder()
            .url(BASE_URL + "/envelopes/" + envelopeId + "/recipients")
            .header("Authorization", "Bearer " + API_KEY)
            .post(RequestBody.create(recipientBody, JSON))
            .build();
        http.newCall(addReq).execute().close();

        // 3. Send envelope
        Request sendReq = new Request.Builder()
            .url(BASE_URL + "/envelopes/" + envelopeId + "/send")
            .header("Authorization", "Bearer " + API_KEY)
            .post(RequestBody.EMPTY)
            .build();
        http.newCall(sendReq).execute().close();

        System.out.println("Envelope sent: " + envelopeId);
    }
}

Why Java developers choose SignThem

Works with OkHttp, Apache HttpClient, or the Java 11+ HttpClient

Integrates into Spring Boot apps as an injectable service bean

Webhook events can be handled in any Spring MVC or JAX-RS controller

Official Java SDK with Maven Central artifacts coming soon

Native SDK in development

A first-party SDK for this language is on the roadmap. In the meantime, the REST API works with any HTTP client as shown in the example above. Join the waitlist and we will notify you when the SDK ships.

Related resources

Ready to add e-signatures to your app?

Create an account to get your API key. Plans start at $6/mo. No usage fees on top.