Knowledgebase : API Documentation > SMS API
Send fully-featured textual message
Posted by Administrator on 27 July 2019 06:21 pm

Resource 

https://sms.enet.co.ke/sms/2/text/advanced

Parameters

Property nameTypeDescription
bulkId string The ID which uniquely identifies the request. Bulk ID will be received only when you send a message to more than one destination address.
from string Represents a sender ID which can be alphanumeric or numeric. Alphanumeric sender ID length should be between 3 and 11 characters (Example: CompanyName). Numeric sender ID length should be between 3 and 14 characters.
to* string Message destination address. Addresses must be in international format (Example: 41793026727).
messageId string The ID that uniquely identifies the message sent.
text string Text of the message that will be sent.
flash boolean 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.
transliteration string Conversion of a message text from one script to another.
Possible values: "TURKISH""GREEK""CYRILLIC""CENTRAL_EUROPEAN" and "NON_UNICODE".
languageCode string Code for language character set of a message text.
Possible values: TR for Turkish, ES for Spanish and PT for Portuguese.
intermediateReport boolean The real-time Intermediate delivery report that will be sent on your callback server. Can be true or false.
notifyUrl string The URL on your callback server on which the Delivery report will be sent.
notifyContentType string Preferred Delivery report content type. Can be application/json or application/xml.
callbackData string Additional client's data that will be sent on the notifyUrl. The maximum value is 200 characters.
validityPeriod int 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).
sendAt datetime Date and time when the message is to be sent. Used for scheduled SMS (SMS not sent immediately, but at scheduled time).
deliveryTimeWindow object Scheduling object that allows setting up detailed time windows in which the message can be sent. Consists of fromto 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.
from object Exact time of day in which the sending can start. Consists of hour and minute properties, both mandatory. Time is expressed in the UTC time zone.
to object Exact time of day in which the sending will end. Consists of hour and minute properties, both mandatory. Time is expressed in the UTC time zone.
hour int Hour when the time window opens when used in from property or closes when used in to property.
minute int Minute when the time window opens when used in from property or closes when used in to property.
days array_string Days which are included in the delivery time window. Values are: MONDAYTUESDAYWEDNESDAYTHURSDAYFRIDAYSATURDAYSUNDAY. At least one day must be stated.
track string Indicates if the message has to be tracked for Conversion rates.
Possible values: SMS and URL
processKey string Key that uniquely identifies Conversion tracking process.
type string User-defined type of the Conversion tracking process or flow type or message type, etc. Example: ONE_TIME_PIN or SOCIAL_INVITES.
baseUrl string Custom base url used for shortening links from SMS text in URL Conversion rate tracking use-case.

Request Example

POST /sms/2/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":"254722012345"
				}
			],
			"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://www.example.com/sms/advanced",
			"notifyContentType":"application/json",
			"callbackData":"DLR callback data",
			"validityPeriod": 720
		},
		{
			"from":"41793026700",
			"destinations":[
				{
					"to":"254722546321"
				}
			],
			"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"
				]
			}
		}
	],
	"tracking":{
		"track":"SMS",
		"type":"MY_CAMPAIGN"
	}
}
					

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": 26,
                "name": "PENDING_ACCEPTED",
                "description": "Message sent to next instance"
            },
            "messageId": "MESSAGE-ID-123-xyz"
        },
        {
            "to": "254722012345",
            "status": {
                "groupId": 1,
                "groupName": "PENDING",
                "id": 26,
                "name": "PENDING_ACCEPTED",
                "description": "Message sent to next instance"
            },
            "messageId": "2033912860760522207"
        },
        {
            "to": "254722543210",
            "status": {
                "groupId": 1,
                "groupName": "PENDING",
                "id": 26,
                "name": "PENDING_ACCEPTED",
                "description": "Pending Accepted"
            },
            "messageId": "2033912860760522208"
        }
    ]
}