API & guide

Integration guide

Three steps: connect a phone, get an API key, send SMS from your system.

1. Phone2. API key3. Sending SMSSMS statusErrorsExamples

1Connect your phone

  1. In the dashboard go to Phones → Add phone and copy the token (it is shown only once).
  2. Install the Smartech SMS app (APK) on an Android phone.
  3. In the app open Settings, enter the URL below and the token, then tap Test. https://sms.designsmartech.co.tz
  4. Allow SMS, phone and battery permissions, then go Home and switch the gateway on.
⏳ Android 13+: if "Allow" for SMS is greyed out, open Settings → Apps → Smartech SMS → ⋮ → Allow restricted settings, then allow SMS.

2Get an API key

Dashboard → 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.

3Sending SMS

POSThttps://sms.designsmartech.co.tz/api/send.php
FieldTypeDescription
tostring / arrayOne number, comma-separated numbers or an array. 07… / 06… numbers are converted to +255… automatically.
messagestringMessage text, up to 1600 characters (long SMS are split automatically).
referencestring (optional)Your own ID, e.g. an order or invoice number, to track the SMS later.
device_idint (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": [] }

SMS status

GEThttps://sms.designsmartech.co.tz/api/status.php?id=215
GEThttps://sms.designsmartech.co.tz/api/status.php?reference=SC1023

Statuses: queued → sending → sent → delivered, or failed (with an error).

Errors

HTTPMeaning
400Invalid request (e.g. missing number or message)
401Missing or invalid API key
402Subscription expired. Renew from the dashboard.
403Account suspended
429Your plan's monthly SMS limit has been reached

Every response contains "ok": true|false; when false it also contains "error" with a description.

Examples

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!"}'