LanguageGuide · official SDK soon
Send SMS in Tunisia from Java, with no dependency.
The java.net.http client that ships with the JDK is all you need to call the Sendimo API. Nothing to add to Maven or Gradle. The official Java SDK is on its way.
What it does
- Only the JDK (Java 17 or newer for text blocks).
- Configurable timeouts on every request.
- JSON responses that are easy to read with Jackson or Gson.
- Works in any JVM app: Jakarta EE, Quarkus, Micronaut…
Setup
- 1Use Java 17 or newer.
- 2Put your API key in the SENDIMO_API_KEY environment variable.
- 3POST to /v1/messages with HttpClient.
- 4Receive delivery statuses by webhook.
// Java 17+ (java.net.http, no dependency)
HttpClient client = HttpClient.newHttpClient();
String body = """
{
"to": "+21620123456",
"from": "SENDIMO",
"text": "Your code is 482913. It expires in 5 minutes.",
"reference": "order-4821"
}
""";
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.sendimo.tn/v1/messages"))
.header("Authorization", "Bearer " + System.getenv("SENDIMO_API_KEY"))
.header("Content-Type", "application/json")
.header("Idempotency-Key", "order-4821-otp")
.timeout(Duration.ofSeconds(10))
.POST(HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode()); // 202
System.out.println(response.body()); // {"id":"msg_01HF8Z3K9QX2","status":"queued",...}{
"id": "msg_01HF8Z3K9QX2",
"status": "queued",
"to": "+21620123456",
"from": "SENDIMO",
"text": "Your code is 482913. It expires in 5 minutes.",
"encoding": "GSM-7",
"segments": 1,
"network": "ooredoo",
"cost": { "amount": "0.140", "currency": "TND" },
"reference": "order-4821",
"scheduled_at": null,
"created_at": "2026-10-30T09:15:00Z"
}Next steps
Other integrations
PythonLanguage
Send SMS in Tunisia from Python with the Sendimo API.
View integrationPHPLanguage
Send SMS in Tunisia from PHP, with no dependency.
View integrationLaravelPHP framework
Send SMS in Tunisia from Laravel with the built-in HTTP client.
View integrationJavaScript / Node.jsLanguage
Send SMS in Tunisia from Node.js with fetch.
View integrationSpring BootJava framework
Send SMS in Tunisia from Spring Boot with RestClient.
View integrationGoLanguage
Send SMS in Tunisia from Go with net/http.
View integration