Send Voice SMS

Our Voice Messaging API enables you to transform text messages into voice messages to any country. You can select from 26 languages and different attributes such as male or female voice, speaking rate, repeat, and more.


Endpoint

For sending messages, the base url is:

@bulk_base/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 /voice-sms

Request Params

Param Type Description
originator string(required) The Originator Phone number to send the message with.
message string(required) Short Message to be sent.
phone string(required) Phone Number to receive Voice 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.
voice integer(optional) Voice to use during the call. 1 for Female and 2 for Male (Defaults to Female).
repeat integer(optional) The number of times the message should be repeated. Valid range is from 1 to 10 (defaults to 1).
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 the structure.

Sample Request Header

{
    "Content-type: application/json",
    "Accept: application/json",
    "Auntorization: Bearer 123456666"
}

Sample Request Body

{
  "originator": "254716079675",
  "message": "Hi from Voice API",
  "phone": "254716079675",
  "correlator": 1
}

Sample Success Response

StatusCode 200

Content

{
  "status": true,
  "message": "Message successfully queued!",
  "data": {
    "correlator": 2,
    "uniqueId": "unique-string",
    "phone": "254716079675",
  }    
}

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

[
    {
      "originator": "254716079675",
      "message": "Hi from Voice API 1",
      "phone": "254716079675",
      "correlator": 1
    },
     {
       "originator": "254716079675",
       "message": "Hi from Voice API 2",
       "phone": "254722079675",
       "correlator": 1
     }
]

Sample Success Response

StatusCode 200

Content

[
    {
        "status": true,
          "message": "Message successfully queued!",
          "data": {
            "correlator": 2,
            "uniqueId": "unique-string",
            "phone": "254716079675",
          }   
    },
    {
        "status": true,
          "message": "Message successfully queued!",
          "data": {
            "correlator": 2,
            "uniqueId": "unique-string",
            "phone": "254722079675",
          }   
    }
]

{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

Code 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": "Answered",
     "deliveryTime": "2020-01-01 00:00:00"
 }