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

  1. 1Use Spring Boot 3.2 or newer (RestClient).
  2. 2Add sendimo.api-key to application.properties.
  3. 3Declare the RestClient bean and inject it into your service.
  4. 4Expose a webhook endpoint to receive delivery statuses.
ConfigurationProperties
# application.properties
sendimo.api-key=${SENDIMO_API_KEY}
Send an SMSJava
// 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"
    }
}
Response 202 AcceptedJSON
{
  "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

Ready to send your SMS?

Launching soon in Tunisia. Join early access.