Skip to Content
faviconTilil Technologies

Bulk SMS API


Preamble

This document provides a quick step by step guide on how to send bulk and premium messages using an application interface (API). It has been made simple to enable a quick integration into our bulk messaging services. A more descriptive guide can be found at http://tililtech.com. To note is that Tilil Technologies is always developing its systems to suit every client’s needs and also to achieve the best data integrity as possible. We also customize the APIs to every client’s request. So, if you need SOAP, XML, Direct database insertion or the bulk messaging system installed in your datacenter or in your intranet talk to us

Sending a Message

Below is a sample sendsms JSON data:

{
"api_key": "{{ Test API Key}}",
"service": 0,
"mobile": "0708400000",
"response_type": "json",
"shortcode": "Tilil",
"message": "This is a message.\n\nRegards\nTilil"
}

Where:

VariableTypeDescriptionExample Value
api_keyStringThe authentication string provided to the customer{{ Test API Key}}
shortcodeStringThe origination alphanumeric or numeric codeTilil
messagePreDescription for messageThis is a message.\n\nRegards\nTilil
mobileStringDescription for mobile0708400000
service_idIntDescription for service_id0
response_typeStringDescription for response_typejson
import requests
# Replace with your actual API key
api_key = "YOUR_API_KEY"
# Recipient phone number
recipient_number = "0708400000"
# Message content
message = "This is a test message sent via Python script."
# Base URL for the API endpoint
base_url = "https://api.tililtech.com/sms/v3/sendsms"
# Prepare the request data
data = {
"api_key": api_key,
"service": 0,
"mobile": recipient_number,
"response_type": "json",
"shortcode": "Tilil",
"message": message
}
# Send the POST request
response = requests.post(base_url, json=data)
# Check for successful response
if response.status_code == 200:
# Parse the JSON response
response_data = response.json()
# Check for successful message sending
if response_data[0]["status_code"] == "1000":
print("Message sent successfully!")
print(f"Message ID: {response_data[0]['message_id']}")
else:
print(f"Error sending message: {response_data[0]['status_desc']}")
else:
print(f"API request failed with status code: {response.status_code}")

Success Request Response

[
{
"status_code": "1000",
"status_desc": "Success",
"message_id": 288369252,
"mobile_number": "254708400000",
"network_id": "1",
"message_cost": 1,
"credit_balance": 148
}
]

Failed Request Response

[
{
"status_code": "1003",
"status_desc": "Invalid mobile number",
"message_id": "0",
"mobile_number": "123",
"network_id": "",
"message_cost": "",
"credit_balance": ""
}
]

Where:

VariableDescription
status_codeThe numeric status code to help in API integrations.
Please refer to the next table for a description of our status codes.
status_descA short description of the status code
message_idA unique identifier of every message that is successfully accepted
mobile_numberA well-formatted recipient mobile number
network_idThe network identifier of the recipient mobile number
message_costThe amount deducted from your account for this particular message
credit_balanceThe balance remaining in your account after the request

API Status Codes and Descriptions

status_codeStatus Description (status_desc)
0Unknown error
1Success
1000Success
1001Invalid sender name {$senderValue}
1002Network not allowed
1003Invalid mobile number
1004Low bulk credits
1005Failed. System error
1006Invalid credentials
1007Database connection failed
1008Database selection failed
1009No DLR
1009Unsupported data type
1010Unsupported request type
1011Invalid user state