LanguageGuide · official SDK soon

Send SMS in Tunisia from PHP, with no dependency.

The cURL extension, available on almost every PHP server, is all you need to call the Sendimo API. No framework required, no package to install. The official PHP SDK is on its way.

What it does

  • Works in plain PHP and with any framework.
  • OTP codes, order confirmations, appointment reminders.
  • JSON errors with a stable code (insufficient_balance, sender_not_approved…).
  • 8-digit local numbers accepted and normalized to +216.

Setup

  1. 1Check that the cURL extension is enabled (php -m | grep curl).
  2. 2Put your API key in the SENDIMO_API_KEY environment variable.
  3. 3POST to /v1/messages and check for HTTP 202.
  4. 4Receive delivery statuses by webhook.
Send an SMSPHP
<?php
$ch = curl_init('https://api.sendimo.tn/v1/messages');
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT        => 10,
    CURLOPT_HTTPHEADER     => [
        'Authorization: Bearer ' . getenv('SENDIMO_API_KEY'),
        'Content-Type: application/json',
        'Idempotency-Key: order-4821-otp',
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'to'        => '+21620123456',
        'from'      => 'SENDIMO',
        'text'      => 'Your code is 482913. It expires in 5 minutes.',
        'reference' => 'order-4821',
    ]),
]);

$body   = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE); // 202
curl_close($ch);

if ($status !== 202) {
    throw new RuntimeException($body['error']['code'] . ': ' . $body['error']['message']);
}
echo $body['id']; // msg_01HF8Z3K9QX2
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.