Send Whatsapp SMS


{info} Ensure you read Whatsapp Overview HERE first.

Endpoint

For sending messages, the base url is:

@bulk_base/api/v1

{info} This endpoint is rate limited to 120 requests per second.

Method

Method URI
POST /whatsapp/send-message

Request Params

Param Type Description
sender string(required) The Phone Number to send the message with
recipient string(required) Phone Number to receive message. Should start with country code with 12 characters (e.g 254 for kenya) or 07 with 10 characters for Kenya or 7 with 9 characters for Kenya.
message OBJECT(required) Message structure, click HERE to see available message structures
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,
endpoint string(optional) Your endpoint that we will call to send delivery receipt for a given message. Click HERE for delivery receipt structure

Message Object

Message body defines the type of message being sent via whatsapp.

Currently available types are text, image, document and template

Text

used to send simple Textual messages.

Request Params

Param Type Description
type string(required) value should be text
text string(required) Message to be sent to specified Recipient

Sample Text Request Body

{
    "sender": "2547XXXXXXXX",
    "recipient": "2547XXXXXXXX",
    "message": {
        "type": "text",
        "text": "Test Whatsapp"
    }
}

Image

Used to send Image Object.

Valid Image types are jpeg, png.

The Imgae should be less than 2MB

Request Params

Param Type Description
type string(required) value should be image
image_url string(required) A Valid HTTP endpoint that points to the image file directly.

Sample Image Request Body

{
    "sender": "2547XXXXXXXX",
    "recipient": "2547XXXXXXXX",
    "message": {
        "type": "image",
        "image_url": "https://example.com/image_1.jpg"
    }
}

Sample Success Response

StatusCode 200

Content

{
    "status": true,
    "message": "Message Successfully Queued",
    "data": {
        "uniqueId": 5,
        "correlator": 999,
        "from": "254XXXXXXXXX"
    }
}

Read Receipts Structure

All Requested read receipts will be delivered via a POST method..

Available deliveryStatus are Read and Error

Sample Read receipt Body


{
  "phone": "2547XXXXXXXX",
  "correlator": "999",
  "uniqueId": 4,
  "deliveryStatus": "Read",
  "remarks": "Message Read",
  "dated": "2020-05-11 15:30:20"
}