Statum Company Logo

Sms API

Our SMS API is the ultimate solution for any company to start their SMS campaign, either for SMS marketing, event notification, scheduled reminders, holiday greetings, SMS auto-responder, SMS auto follow-up, SMS lucky draw… and many more!

Our SMS Platform is a powerful, fully scalable communication enabler that equips you with the tools you need to manage your business communication more effectively.

To use the service, you will need to get a sender id. This could be a short code (12345) or alphanumeric (Statum).

An alphanumeric is a custom sender id that is registered with Mobile Service Providers and that can be stamped on SMS messages being sent out to users. For example, if your business name is Statum, you can purchase that alphanumeric and brand messages going out from your account as being from Statum.

A short code is an easy-to-remember, 5 to 6 digit number used to send SMS or MMS messages. If you own a pizza restaurant, for example, you may have customers text “CHEESE” to 12345 to receive discounts or use the short code to engage with your customers as it is two way SMS.

One important distinction between alphanumerics and short codes is that with alphanumerics, users will NOT be able to reply to that sender id. Also, note that alphanumerics are case sensitive.

Once you purchase an alphanumeric or short code, you will have the option of using it as the sender id for messages originating from your account.

To request for a sender id, kindly reach out through [email protected] and we will configure a service for you.

HTTP POST Resource URL

https://api.statum.co.ke/api/v2/sms

API request

Send sms through your application by making a HTTP POST request to the endpoint above.

In addition to the API standard request headers , the body of the request should contain the following fields:

Parameter Type Description Example
phone_number String The recipient of the message in international format. 254721553678
message String This is the message to be sent. This is a test Message through our API
sender_id String This is the registered sender Id. Statum

Sample SMS API request

<?php
// credentials from your developer account
$consumerKey = "568473daf6614cb196caeb5f8805985f";
$consumerSecret = "5a07f41de16e40e4b08b4001142a5a10";
$auth = base64_encode($consumerKey . ":" . $consumerSecret);

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.statum.co.ke/api/v2/sms',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
         "phone_number": "254721553678",
         "sender_id": "Statum",
         "message": "This is a test Message through our API"
        }',
  CURLOPT_HTTPHEADER => array(
        "Authorization: Basic $auth",
        "Content-Type: application/json"
      ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

API response

The body of the response will be a JSON object containing the following fields:

Parameter Type Description Example
status_code Number The status code of the transaction. 200
description String The status description of the transaction. Operation successful
request_id String The unique reference number as assigned by the Statum API. 35235f08c981474abd388755ed43a427

Sample API response payload

{
    "status_code": 200,
    "description": "Operation successful.",
    "request_id": "35235f08c981474abd388755ed43a427"
}

API result

The Sms API sends a notification when a specific event happens. For example, when a message is delivered to the recipient successfully, we immediately let you know via a notification with the details of that transaction. To receive these notifications you need to setup a callback URL on your developer account.

The POST parameters that will be passed will be as follows:

Parameter Type Description Example
request_id String The unique reference number as assigned by the Statum API 35235f08c981474abd388755ed43a427
result_code String The result code of the transaction. 200
result_desc String The result description of delivery status. Success

API result sample payload

{
  "result_code": "200",
  "result_desc": "Success",
  "request_id": "35235f08c981474abd388755ed43a427"
}
Copyright © 2017 - 2024 Statum