Three steps: connect a phone, get an API key, send SMS from your system.
https://sms.designsmartech.co.tzDashboard → API → Generate API key. Send it with every request as a header:
X-API-Key: YOUR_API_KEY
Never put it in browser JavaScript or a public file. Use it on the server side only.
| Field | Type | Description |
|---|---|---|
to | string / array | One number, comma-separated numbers or an array. 07… / 06… numbers are converted to +255… automatically. |
message | string | Message text, up to 1600 characters (long SMS are split automatically). |
reference | string (optional) | Your own ID, e.g. an order or invoice number, to track the SMS later. |
device_id | int (optional) | Force the SMS to go through a specific phone. |
Response (HTTP 201):
{ "ok": true, "queued": 1,
"messages": [ { "id": 215, "to": "+255712345678", "status": "queued" } ],
"invalid": [] }
Statuses: queued → sending → sent → delivered, or failed (with an error).
| HTTP | Meaning |
|---|---|
| 400 | Invalid request (e.g. missing number or message) |
| 401 | Missing or invalid API key |
| 402 | Subscription expired. Renew from the dashboard. |
| 403 | Account suspended |
| 429 | Your plan's monthly SMS limit has been reached |
Every response contains "ok": true|false; when false it also contains "error" with a description.
PHP
function smartech_sms($to, $message, $reference = null) {
$ch = curl_init('https://sms.designsmartech.co.tz/api/send.php');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 20,
CURLOPT_HTTPHEADER => ['X-API-Key: YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode(compact('to', 'message', 'reference')),
]);
$res = json_decode((string) curl_exec($ch), true);
curl_close($ch);
return $res;
}
smartech_sms('0712345678', 'Your parcel SC1023 has arrived.', 'SC1023');
JavaScript (Node.js 18+)
await fetch('https://sms.designsmartech.co.tz/api/send.php', {
method: 'POST',
headers: { 'X-API-Key': process.env.SMARTECH_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({ to: '0712345678', message: 'Hello!' })
});
Python
import requests
requests.post('https://sms.designsmartech.co.tz/api/send.php',
headers={'X-API-Key': 'YOUR_API_KEY'},
json={'to': '0712345678', 'message': 'Hello!'})
cURL
curl -X POST https://sms.designsmartech.co.tz/api/send.php \
-H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{"to":"0712345678","message":"Hello!"}'