SMS Message

Sending SMS messages with Omnichannel API.

The easiest way to use Omnichannel API is with our official libraries. Libraries will take care of authentication, request validation and response handling.

Send a single SMS

Use the following example to send an SMS using Omnichannel API.

# pip install messente-api

from pprint import pprint
from messente_api import OmnimessageApi, SMS, Omnimessage, Configuration, ApiClient
from import ApiException

configuration = Configuration()
configuration.username = "YOUR_MESSENTE_API_USERNAME"
configuration.password = "YOUR_MESSENTE_API_PASSWORD"

api_instance = OmnimessageApi(ApiClient(configuration))

sms = SMS(sender="<sender name (optional)>", text="hello sms")

omnimessage = Omnimessage(messages=tuple([sms]), to="<recipient_phone_number>")

    response = api_instance.send_omnimessage(omnimessage)
        "Successfully sent Omnimessage with id: %s that consists of the following messages:"
        % response.omnimessage_id
    for message in response.messages:
except ApiException as exception:
    print("Exception when sending an omnimessage: %s\n" % exception)
// npm i messente_api

const MessenteApi = require('messente_api');

const defaultClient = MessenteApi.ApiClient.instance;
const basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR_MESSENTE_API_USERNAME';
basicAuth.password = 'YOUR_MESSENTE_API_PASSWORD';

const api = new MessenteApi.OmnimessageApi();

const sms = MessenteApi.SMS.constructFromObject({
  sender: '<sender name (optional)>',
  text: 'hello sms',

const omnimessage = MessenteApi.Omnimessage.constructFromObject({
  messages: [sms],
  to: '<recipient_phone_number>',

api.sendOmnimessage(omnimessage, (error, data) => {
  if (error) {
  } else {
    console.log('API called successfully. Returned data: ', data);

// composer require messente/messente-api-php

require_once __DIR__.'/vendor/autoload.php';

use Messente\Api\Api\OmnimessageApi;
use Messente\Api\Model\Omnimessage;
use Messente\Api\Configuration;
use Messente\Api\Model\SMS;

$config = Configuration::getDefaultConfiguration()

$apiInstance = new OmnimessageApi(
    new GuzzleHttp\Client(),

$omnimessage = new Omnimessage([
    'to' => '<recipient_phone_number>',

$sms = new SMS(
        'text' => 'hello sms',
        'sender' => '<sender name (optional)>',


try {
    $result = $apiInstance->sendOmnimessage($omnimessage);
} catch (Exception $e) {
    echo 'Exception when calling sendOmnimessage: ', $e->getMessage(), PHP_EOL;
import com.messente.ApiClient;
import com.messente.ApiException;
import com.messente.api.OmniMessageCreateSuccessResponse;
import com.messente.api.Omnimessage;
import com.messente.api.OmnimessageApi;
import com.messente.api.SMS;
import com.messente.auth.HttpBasicAuth;

import java.util.Arrays;

// repositories { jcenter() }
// dependencies { implementation 'com.messente.api:messente-api' }

public class Main {
    public static void main(String[] args) {
        ApiClient apiClient = new ApiClient();

        HttpBasicAuth basicAuth = (HttpBasicAuth) apiClient.getAuthentication("basicAuth");

        SMS sms = new SMS();
        sms.text("hello sms");
        sms.sender("<sender name (optional)>");

        OmnimessageApi apiInstance = new OmnimessageApi(apiClient);
        Omnimessage omnimessage = new Omnimessage();

        try {
            OmniMessageCreateSuccessResponse result = apiInstance.sendOmnimessage(omnimessage);
        } catch (ApiException e) {
# gem install messente_api

require 'messente_api'

MessenteApi.configure do |config|
  config.username = 'YOUR_MESSENTE_API_USERNAME'
  config.password = 'YOUR_MESSENTE_API_PASSWORD'

api_instance =
omnimessage = = '<recipient_phone_number>'
omnimessage.messages = [
    sender: '<sender name (optional)>',
    text: 'hello sms'

  result = api_instance.send_omnimessage(omnimessage)
  puts result
rescue MessenteApi::ApiError => e
  puts "Exception when calling send_omnimessage: #{e}"
  puts e.response_body
// PM > Install-Package com.Messente.Api

using System;
using System.Diagnostics;
using System.Collections.Generic;
using com.Messente.Api.Api;
using com.Messente.Api.Client;
using com.Messente.Api.Model;

namespace Example
    public class SendOmniMessageExample
        public static void Main()
            Configuration conf = new Configuration();
            conf.Username = "YOUR_MESSENTE_API_USERNAME";
            conf.Password = "YOUR_MESSENTE_API_PASSWORD";
            var apiInstance = new OmnimessageApi(conf);

            var sms = new SMS(
                sender: "<sender name (optional)>",
                text: "hello sms"
            List<object> messages = new List<object>();

            var omnimessage = new Omnimessage(
                to: "<recipient_phone_number>",
                messages: messages

                var result = apiInstance.SendOmnimessage(omnimessage);
            catch (Exception e)
                Debug.Print("Exception when calling SendOmnimessage: " + e.Message);

curl -X POST \
  '' \
  -H 'Content-Type: application/json' \
  -d '{
    "to": "<recipient_phone_number>",
    "messages": [
        "channel": "sms",
        "sender": "<sender name (optional)>",
        "text": "hello sms"


  "messages": [
      "channel": "sms",
      "message_id": "fr593ce7-68de-5e44-bc50-044a3ad0a7fa",
      "sender": "YOUR_PHONE_NUMBER"
  "omnimessage_id": "632c6f3d-49d0-4a8f-5k2n-74023d31e51d",

Use the omnimessage_id to keep track of the message delivery status.

Constructing Messages

There are few things to keep in mind when composing SMS messages.

Be aware of non-GSM friendly characters

A single SMS can contain 160 characters. However, SMS is built to use 7-bit GSM 03.38 character encoding set and this means that certain unicode characters (that are not in GSM character set) don't fit into the message.

If your message contains any characters not listed in the 7-bit alphabet then the message encoding will be set to UCS-2. With it, the message length is limited to 70 characters.

By default, the API will convert all non-GSM friendly characters to similar characters in GSM 03.38 encoding set. This allows you to send messages with non-unicode characters and not worry about the GSM specification.

You can turn the character replace feature off by configuring the autoconvert parameter in the message.

autoconvert: on(default)|full|off

Message Validity and Retry Policy

Messente forwards the SMS request to the operators, who, in turn, will retry SMS delivery for a minimum of 6 hours.

That being said, operators differ in their policies so some may retry SMS delivery up to 48 hours in total, starting with shorter retry intervals and switching to longer retry intervals towards the end. Some, on the other hand, may only retry for the required minimum of 6 hours indicated by us.

SMPP protocol

Although we don't encourage it we also support SMPP protocol for sending SMS messages. Learn how to set up SMPP integration.

Error example

  "errors": [
      "code": "105",
      "detail": "Invalid or disallowed sender Messente",
      "source": "payload[sms][sender]",
      "title": "Invalid data"
Key Value
title Error message
detail Longer description of the error message
source Location in the request body for this error message
code Machine-readable error code
101 Not found
102 Forbidden
103 Unauthorized
104 Internal Server Error
105 Invalid data
106 Missing data
107 Method not allowed