Java frameworkGuide · official SDK soon
Send SMS in Tunisia from Spring Boot with RestClient.
Declare a RestClient preconfigured with your key, then inject it into your services. Java records work directly as request and response bodies. The official Spring Boot starter is on its way.
What it does
- API key in application.properties, read from the environment.
- A RestClient bean with the base URL and authentication already set.
- Java records for the request and response, mapped by Jackson.
- Idempotency-Key based on your order for safe retries.
Setup
- 1Use Spring Boot 3.2 or newer (RestClient).
- 2Add sendimo.api-key to application.properties.
- 3Declare the RestClient bean and inject it into your service.
- 4Expose a webhook endpoint to receive delivery statuses.
# application.properties
sendimo.api-key=${SENDIMO_API_KEY}// Spring Boot 3.2+ (RestClient)
@Configuration
class SendimoConfig {
@Bean
RestClient sendimo(@Value("${sendimo.api-key}") String apiKey) {
return RestClient.builder()
.baseUrl("https://api.sendimo.tn/v1")
.defaultHeader("Authorization", "Bearer " + apiKey)
.build();
}
}
record SendSms(String to, String from, String text, String reference) {}
record Message(String id, String status) {}
@Service
class OrderNotifier {
private final RestClient sendimo;
OrderNotifier(RestClient sendimo) {
this.sendimo = sendimo;
}
Message confirm(Order order) {
return sendimo.post()
.uri("/messages")
.header("Idempotency-Key", "order-" + order.id() + "-confirm")
.body(new SendSms(order.phone(), "SENDIMO", "Your order is confirmed.", "order-" + order.id()))
.retrieve()
.body(Message.class); // 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 integrationJavaLanguage
Send SMS in Tunisia from Java, with no dependency.
View integrationGoLanguage
Send SMS in Tunisia from Go with net/http.
View integration