Send SMS


Endpoint

For sending messages, the base url is:

https://rebuetext.com/api/v1

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
time_to_send string(optional) The time you want to schedule the message to be send in this format Y-m-d H:i e.g 2024-10-31 18:00 if left out, the message will be processed immediately
delivery_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 1",
    "phone": "0708XXXXXX",
    "correlator": 1
}

Sample Success Response

[
    {
        "status": true,
        "message": "Message queued successfully",
        "data": {
            "short_code": "CLOUD_REBUE",
            "phone": "254708XXXXXX",
            "operator": "Safaricom",
            "message": "Test API 1",
            "correlator": 1,
            "delivery_endpoint": null,
            "batch_id": "b493d826-7255-4886-abdd-5550cd084198",
            "uniqueId": "d4cd3f5c-3b22-4174-85aa-392e3435c783",
            "time_to_send": "2024-11-22T20:01:24.750745Z",
            "sms_units": 1,
            "length": 10,
            "remarks": "Message queued successfully",
            "created_at": "2024-11-22 23:01:24"
        }
    }
]

Sample Request Body (comma separated phone numbers)

{
    "sender": "CLOUD_REBUE",
    "message": "Test API 1",
    "phone": "0708XXXXXX,0741XXXXXX",
    "correlator": 1
}

Sample Success Response

StatusCode 200

Content

[
    {
        "status": true,
        "message": "Message queued successfully",
        "data": {
            "short_code": "CLOUD_REBUE",
            "phone": "254708XXXXXX",
            "operator": "Safaricom",
            "message": "Test API 1",
            "correlator": 1,
            "delivery_endpoint": null,
            "batch_id": "7fd96580-468f-4e76-b452-9f196eae2ee8",
            "uniqueId": "686b21bb-c88f-4af0-98f5-0ef48f545b80",
            "time_to_send": "2024-10-31T15:00:00.000000Z",
            "sms_units": 1,
            "length": 10,
            "remarks": "Message queued successfully",
            "created_at": "2024-11-22 22:55:42"
        }
    },
    {
        "status": true,
        "message": "Message queued successfully",
        "data": {
            "short_code": "CLOUD_REBUE",
            "phone": "254741XXXXXX",
            "operator": "Safaricom",
            "message": "Test API 1",
            "correlator": 1,
            "delivery_endpoint": null,
            "batch_id": "7fd96580-468f-4e76-b452-9f196eae2ee8",
            "uniqueId": "4d141817-a8cb-440f-b4a8-6395f138d6f1",
            "time_to_send": "2024-10-31T15:00:00.000000Z",
            "sms_units": 1,
            "length": 10,
            "remarks": "Message queued successfully",
            "created_at": "2024-11-22 22:55:42"
        }
    }
]

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 1",
        "phone": "0708XXXXXX",
        "time_to_send":"2024-10-31 18:00",
        "delivery_endpoint": "https://cloudrebue.co.ke",
        "correlator": 1
     },
     {
        "sender": "ANZIANO",
        "message": "Test API 2",
        "phone": "07xxx",
        "correlator": 2
     },
     {
        "sender": "REBUETEXT",
        "message": "Test API 2",
        "phone": "0741XXXXXX",
        "correlator": 3
     }
]

Sample Success Response

StatusCode 200

Content

[
    {
        "status": true,
        "message": "Message queued successfully",
        "data": {
            "short_code": "CLOUD_REBUE",
            "phone": "254708XXXXXX",
            "operator": "Safaricom",
            "message": "Test API 1",
            "correlator": 1,
            "delivery_endpoint": "https://cloudrebue.co.ke",
            "batch_id": "0f1e970e-9172-4d24-a116-82358617aef2",
            "uniqueId": "cfb5669a-db88-4083-b273-8daaea62f1be",
            "time_to_send": "2024-10-31T15:00:00.000000Z",
            "sms_units": 1,
            "length": 10,
            "remarks": "Message queued successfully",
            "created_at": "2024-11-22 23:06:10"
        }
    },
    {
        "status": false,
        "message": "Invalid number",
        "data": {
            "short_code": "ANZIANO",
            "phone": "2547",
            "operator": "Unknown",
            "message": "Test API 2",
            "correlator": 2,
            "delivery_endpoint": null,
            "batch_id": "0f1e970e-9172-4d24-a116-82358617aef2",
            "uniqueId": "978e7cc6-7479-43ac-add1-c68e2a2a5e75",
            "time_to_send": "2024-11-22T20:06:10.704965Z",
            "sms_units": 0,
            "length": 10,
            "remarks": "Invalid number",
            "created_at": "2024-11-22 23:06:10"
        }
    },
    {
        "status": false,
        "message": "Unauthorized sender 'REBUETEXT' for this account.",
        "data": {
            "short_code": "REBUETEXT",
            "phone": "254741XXXXXX",
            "correlator": 3,
            "uniqueId": "af79ee83-1d7d-4dfd-a99d-a917e0f2bcf1",
            "sms_units": 0,
            "remarks": "Unauthorized sender"
        }
    }
]

{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": 1,
     "uniqueId": "unique-string",
     "deliveryStatus": "DeliveredToTerminal",
     "deliveryTime": "2024-11-01 00:00:00"
 }

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