Send SMS


Endpoint

For sending messages, the base url is:

https://bulk.cloudrebue.co.ke/api/v1

{info} This endpoint is rate limited to 120 requests per second. Consider sending in Batches for higher volume throughput

Method

Method URI
POST send-sms

Request Params

Param Type Description
sender string(required) The Sender ID to send the message with
message string(required) Short Message to be sent
phone string(required) Phone Number to receive message. Should start with country code with 12 characters (e.g 254 for kenya) or 07/01 with 10 characters for Kenya or 7/1 with 9 characters for Kenya.
correlator string(optional) A Unique identifier generated by YOUR system, for each message. We forward delivery receipts together with your correlator, to help you identify the message in your system associated with the delivery receipt
link_id string(varies) An initiator identifier that was sent by an originating message, MUST be provided when sending on-demand messages
endpoint string(optional) Your endpoint that we will call to send delivery receipt for a given message. Click HERE for the structure

Sample Request Header

{
    "Content-type: application/json",
    "Accept: application/json",
    "Authorization: Bearer 123456789"
}

Sample Request Body

Sample Request Body (single phone numbers)

{
  "sender": "CLOUD_REBUE",
  "message": "Test API",
  "phone": "2547XXXXXXXX",
  "correlator": 1
}

Sample Request Body (comma separated phone numbers)

{
  "sender": "CLOUD_REBUE",
  "message": "Test API",
  "phone": "2547XXXXXXXX,2547XXXXXXYZ",
  "correlator": 1
}

Sample Success Response

StatusCode 200

Content

[
   {
      "status":true,
      "message":"Message successfully queued!",
      "data":{
         "correlator":"1",
         "uniqueId":"aded7b1a-d786-4168-bb48-0bd12def5821",
         "client_id":"1",
         "phone":"2547XXXXXXXX",
         "operator":"safaricom",
         "sms_units":1,
         "short_code":"BizTxt",
         "message":"Test message",
         "link_id":"link-id-here",
         "end_point":"https:\/\/example.com\/delivery",
         "batch_id":"e3c812f4-a027-49a0-9375-b0ecdeef1602",
         "created_at":"2021-12-03 08:51:16"
      }
   }
]

OR

[
   {
      "status":true,
      "message":"Message successfully queued!",
      "data":{
         "correlator":"1",
         "uniqueId":"aded7b1a-d786-4168-bb48-0bd12def5821",
         "client_id":"1",
         "phone":"2547XXXXXXXX,2547XXXXXXYZ",
         "operator":"safaricom",
         "sms_units":1,
         "short_code":"BizTxt",
         "message":"Test message",
         "link_id":"link-id-here",
         "end_point":"https:\/\/example.com\/delivery",
         "batch_id":"e3c812f4-a027-49a0-9375-b0ecdeef1602",
         "created_at":"2021-12-03 08:51:16"
      }
   }
]

Sending in Batches

This will help overally reduce on network/resource usage by chunking multiple messages into a single request.

{danger} For batch sending, a maximum of 100 concurrent messages can be sent on a single JSON request body

[
    {
        "sender": "CLOUD_REBUE",
        "message": "Test API",
        "phone": "07XXXXXXXX",
        "correlator": 1
     },
     {
        "sender": "BizTxt",
        "message": "Test API 2",
        "phone": "07XXXXXXXX",
        "correlator": 2
     }
]

Sample Success Response

StatusCode 200

Content

[
    {
        "status": true,
        "message": "Message successfully queued!",
        "data": {
            "correlator": 1,
            "uniqueId": "unique-string",
            "phone": "254XXXXXXXXX",
            "sms_units": 1
        }
    },
    {
        "status": true,
        "message": "Message successfully queued!",
        "data": {
            "correlator": 2,
            "uniqueId": "unique-string",
            "phone": "254XXXXXXXXX",
            "sms_units": 1
        }
    }
]

{info} Official SDKs can be obtained HERE. Also consider having a look at our responses format HERE In order to anticipate all the formats our responses are returned in, and hence a better handling of the same.

Sample Error Response

StatusCode 401

Reason Invalid or Missing Token

Content

{
    "status": false,
    "message": "Unauthenticated."
}

Delivery Receipts Structure

All Requested delivery receipts will be delivered via a POST method with the below structure.


{
     "phone": "254XXXXXXXXX",
     "correlator": 2,
     "uniqueId": "unique-string",
     "deliveryStatus": "DeliveredToTerminal",
     "deliveryTime": "2020-01-01 00:00:00"
 }

{danger} The Generated Auth Token Gives a person full access to your account. Don't share it under any circumstance️