PHP frameworkGuide · official SDK soon
Send SMS in Tunisia from Laravel with the built-in HTTP client.
Laravel's Http client handles authentication, timeouts and errors for you. Add your key to .env and send an SMS from a controller, a job or a notification. The official Laravel package is on its way.
What it does
- Config in config/services.php and your .env file.
- Send from a queued job so requests never slow down.
- Idempotency-Key based on the order ID: a retried job never sends twice.
- Clear exceptions with ->throw() on 4xx or 5xx errors.
Setup
- 1Add the sendimo key to config/services.php and SENDIMO_API_KEY to .env.
- 2Call the API with Http::withToken() from your code.
- 3Put sends in a job (ShouldQueue) for bulk sending.
- 4Receive statuses on a webhook route and update your models.
// config/services.php
'sendimo' => [
'key' => env('SENDIMO_API_KEY'),
],
// .env
SENDIMO_API_KEY=sk_live_...use Illuminate\Support\Facades\Http;
$response = Http::withToken(config('services.sendimo.key'))
->withHeaders(['Idempotency-Key' => "order-{$order->id}-confirm"])
->timeout(10)
->post('https://api.sendimo.tn/v1/messages', [
'to' => $order->phone,
'from' => 'SENDIMO',
'text' => "Your order #{$order->id} is confirmed.",
'reference' => "order-{$order->id}",
])
->throw(); // 4xx/5xx → RequestException
$messageId = $response->json('id'); // msg_01HF8Z3K9QX2{
"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 integrationJavaScript / Node.jsLanguage
Send SMS in Tunisia from Node.js with fetch.
View integrationJavaLanguage
Send SMS in Tunisia from Java, with no dependency.
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