Knowledgebase : API Documentation > SMS API
Send Fully featured SMS
Posted by Administrator on 16 January 2018 10:51 pm

Endpoint for sending fully featured SMS is:

POST https://sms.enet.co.ke/sms/1/text/advanced

Header Parameters

NameValuesDescription
Authorization (required) Basic <Access token> Access token = base64encode(yourUsername:yourPassword)
Content-Type application/json Only application/json is supported for now
Accept application/json Only application/json is supported for now

Request Parameters

NameDescriptionParameter TypePossible value
bulkId This is a unique ID to identy the request string BULK-ID-123-xyz
from The sender ID that will be used to send the message numeric / alphanumeric Enet_Online
to The recipient Phone number numeric 254726872512
text The message being send text This is a test message
messageId A unique ID to identify the message being send string MESSAGE-ID-123-xyz
flash Can be true or false. If the value is set to true, a flash SMS will be sent. Otherwise, a normal SMS will be sent. The default value is false. boolean true
transliteration Conversion of a message text from one script to another.
Possible values: "TURKISH", "GREEK", "CYRILLIC", "CENTRAL_EUROPEAN" and "NON_UNICODE".
string TURKISH
languageCode Code for language character set of a message text.
Possible values: TR for Turkish, ES for Spanish and PT for Portuguese.
string TR
intermediateReport The real-time Intermediate delivery report that will be sent on your callback server. Can be true or false. boolean true
notifyUrl The URL on your callback server on which the Delivery report will be sent. url https://myapp.com/sms_notify.php
       
notifyContentType Preferred Delivery report content type. Can be application/json or application/xml. string application/json
callbackData Additional client's data that will be sent on the notifyUrl. The maximum value is 200 characters. string no123456
validityPeriod The message validity period in minutes. When the period expires, it will not be allowed for the message to be sent. Validity period longer than 48h is not supported (in this case, it will be automatically set to 48h). integer 720
sendAt Date and time when the message is to be sent. Used for scheduled SMS (SMS not sent immediately, but at scheduled time). datetime 2017-01-07T17:00:00.000+01:00
deliveryTimeWindow Scheduling object that allows setting up detailed time windows in which the message can be sent. Consists of from, to and days properties.
 - Days property is mandatory.
 - From and to properties should be either both included, to allow finer time window granulation or both omitted, to include whole days in the delivery time window.
object  
 - from Exact time of day in which the sending can start. Consists of hour and minute properties, both mandatory. Time is expressed in the UTC timezone. object  
 - to Exact time of day in which the sending will end. Consists of hour and minute properties, both mandatory. Time is expressed in the UTC timezone. object  
 - hour Hour when the time window opens when used in from property or closes when used in to property. integer 10
 - minute Minute when the time window opens when used in from property or closes when used in to property. integer 15
 - days Days which are included in the delivery time window. Values are: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY. At least one day must be stated. array of days  

Examples

POST /sms/1/text/advanced HTTP/1.1
Host: sms.enet.co.ke
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/json
Content-Type: application/json

{
  "bulkId":"BULK-ID-123-xyz",
  "messages":[
    {
      "from":"Enet_Online",
      "destinations":[
        {
          "to":"254726872512",
          "messageId":"MESSAGE-ID-123-xyz"
        },
        {
          "to":"254722xxxxxx"
        }
      ],
      "text":"Artık Ulusal Dil Tanımlayıcısı ile Türkçe karakterli smslerinizi rahatlıkla iletebilirsiniz.",
      "flash":false,
      "language":{
        "languageCode":"TR"
      },
      "transliteration":"TURKISH",
      "intermediateReport":true,
      "notifyUrl":"https://myapp.com/sms_notify.php",
      "notifyContentType":"application/json",
      "callbackData":"no123456",
      "validityPeriod": 720
    },
    {
      "from":"Ecobiz",
      "destinations":[
        {
          "to":"254733xxxxxx"
        }
      ],
      "text":"A long time ago, in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.",
      "sendAt":"2015-07-07T17:00:00.000+01:00",
      "deliveryTimeWindow": {
        "from": {
          "hour": 6,
          "minute": 0
        },
        "to": {
          "hour": 15,
          "minute": 30
        },
        "days": [
          "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY"
        ]
      }
    }
  ]
}

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "bulkId": "BULK-ID-123-xyz",
    "trackingProcessKey": "9243E3F4BEDC719D83C2A38A483E6CB3",
    "messages": [
        {
            "to": "254726872512",
            "status": {
                "groupId": 1,
                "groupName": "PENDING",
                "id": 7,
                "name": "PENDING_ENROUTE",
                "description": "Message sent to next instance"
            },
            "smsCount": 1,
            "messageId": "MESSAGE-ID-123-xyz"
        },
        {
            "to": "254722xxxxxx",
            "status": {
                "groupId": 1,
                "groupName": "PENDING",
                "id": 7,
                "name": "PENDING_ENROUTE",
                "description": "Message sent to next instance"
            },
            "smsCount": 1,
            "messageId": "2033912860760522207"
        },
        {
            "to": "254733xxxxxx",
            "status": {
                "groupId": 1,
                "groupName": "PENDING",
                "id": 26,
                "name": "PENDING_ACCEPTED",
                "description": "Pending Accepted"
            },
            "messageId": "2033912860760522208"
        }
    ]
}