Sending SMS

Although, this API is supported, we suggest using a more modern and feature-rich Omnichannel API for sending SMS messages.

Sending SMS to the handset using Messente HTTP SMS Messaging API

You can deliver SMS to any handset using Messente's HTTP SMS API and later use the returned MessageID to check Delivery Report for this message.

You can send SMS to any number by making a HTTP GET or HTTP POST call to Messente API.

Messaging API endpoints

Main API endpoint
Backup API endpoint


// Messente API username and password
define('MESSENTE_API_USERNAME', '34edae9e1a5e563f5eced203f09f229e');
define('MESSENTE_API_PASSWORD', '385c064fc6d687c01e529348d3685cb1');
define('MESSENTE_SMS_DLR_URL', '');

// Initial message statuses
$status = NULL;
$MessageID = NULL;
$ErrorCode = NULL;

// Make HTTP call to Messente API
$url = ''.
    'username' => MESSENTE_API_USERNAME,
    'password' => MESSENTE_API_PASSWORD,
    'from' => 'MyDelivery',
    'to' => '+44000000000',
    'text' => 'Your parcel will be delivered at 10AM',
    'dlr-url' => MESSENTE_SMS_DLR_URL
$ch = curl_init($url);

$response = curl_exec($ch);
list($resp, $code) = explode(' ', $response);

// Check if the sms delivery request was successful
if ($resp == 'OK') {
  $status = TRUE;
  $MessageID = $code;
} else {
  $status = FALSE;
  $ErrorCode = $code;

if ($status == TRUE) {
  echo 'Message sent successfully with MessageID '.$MessageID;
  // TODO: Save the message to database and store MessageID
  // INSERT INTO messages (from, to, text, msgid, sent_time)
  // VALUES (:from, :to, :text, :MessageID, NOW())
} else {
  echo 'Sending message failed with error code '.$ErrorCode;
import messente

# Initialize Messente API library
api = messente.Messente(

# Send SMS
response = api.sms.send({
    "from": "MyDelivery",
    "to": "+44000000000",
    "text": "Your parcel will be delivered at 10AM"
if response.is_ok():
print("Message sent:", response.get_sms_id())
print("Message failed:", response.error_code)

API Reference

For full list of response codes and HTTPI API request parameters, refer to the API Reference - Sending SMS.


Messente has HTTP API libraries for various languages including PHP, Python, Java and C#. Check out the Messente Libraries section in our documentation.