Messente logo

Getting Started

Sending messages with Messente is a few steps away. Here's a short guide to get you started.

1. Setup your account

The first thing you have to do to start using Messente is create an account and get your API key (secure ID of an API user). We'll automatically add some credits to your account to test the API for free.

Create an account Where can I find my API key

2. Verify yourself as a sender

To differentiate genuine users from spammers and people with bad intentions, we require you to verify yourself by registering your phone number. Once verified, you can use Messente’s interface to send the message to your number.

Verify yourself as sender

Registering a branded sender name is a manual process and might take up to 24 hours to activate it.

Read more about branded sender names.

Your phone number is kept securely in our database and will never be shared or used for any other reason.

3. Send your first SMS

To use Messente’s API to send your first SMS, copy and use the following code for your choice of programming language.

Find a detailed API reference on sending message.

# gem 'omnichannel', '~> 1.0.0'

require 'omnichannel'

# setup authorization
Omnichannel.configure do |config|
    # Configure HTTP basic authorization: basicAuth
    config.username = 'MESSENTE_API_USERNAME'
    config.password = 'MESSENTE_API_PASSWORD'
end

api_instance = Omnichannel::OmnimessageApi.new

omnimessage = Omnichannel::Omnimessage.new
omnimessage.to = 'RECIPIENT_PHONE_NUMBER'
omnimessage.messages = [
    Omnichannel::SMS.new(
        {
            :sender => "YOUR_PHONE_NUMBER",
            :text => "Hello SMS!"
        }
    )
]

begin
    result = api_instance.send_omnimessage(omnimessage)
    puts "SMS successfully sent!"
rescue Omnichannel::ApiError => e
    puts "There was a problem sending SMS: #{e}"
    puts e.response_body
end
    
// PM > Install-Package com.Messente.Omnichannel

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

namespace Example
{
    public class SendOmniMessageExample
    {
        public static void Main()
        {
            // Configure HTTP basic authorization: basicAuth
            Configuration.Default.Username = "MESSENTE_API_USERNAME";
            Configuration.Default.Password = "MESSENTE_API_PASSWORD";

            List messages = new List();
            var sms = new SMS(sender: "YOUR_PHONE_NUMBER", text: "Hello SMS!");

            messages.Add(sms);

            var apiInstance = new OmnimessageApi();
            var omnimessage = new Omnimessage(to: "RECIPIENT_PHONE_NUMBER", messages: messages);

            try
            {
                OmniMessageCreateSuccessResponse result = apiInstance.SendOmnimessage(omnimessage);
                Debug.Print("SMS successfully sent!");
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("There was a problem sending SMS: " + e.Message);
            }

        }
    }
}
    
// composer require messente/messente-omnichannel-php

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

use \Messente\Omnichannel\Api\OmnimessageApi;
use \Messente\Omnichannel\Configuration;
use \Messente\Omnichannel\Model\Omnimessage;
use \Messente\Omnichannel\Model\Viber;
use \Messente\Omnichannel\Model\SMS;
use \Messente\Omnichannel\Model\WhatsApp;
use \Messente\Omnichannel\Model\WhatsAppText;

// Configure HTTP basic authorization: basicAuth
$config = Configuration::getDefaultConfiguration()
    ->setUsername('MESSENTE_API_USERNAME')
    ->setPassword('MESSENTE_API_PASSWORD');

$apiInstance = new OmnimessageApi(new GuzzleHttp\Client(), $config);
$omnimessage = new Omnimessage(["to" => "RECIPIENT_PHONE_NUMBER"]);

$whatsAppText = new WhatsAppText(["body" => "Hello WhatsApp!"]);
$whatsapp = new WhatsApp(['text' => $whatsAppText, "sender" => "YOUR_PHONE_NUMBER"]);
$viber = new Viber( ["text" => "Hello Viber!", "sender" => "YOUR_PHONE_NUMBER"]);
$sms = new SMS(["text" => "Happy messaging!", "sender" => "YOUR_PHONE_NUMBER"]);
$omnimessage->setMessages([$viber, $whatsapp, $sms]);

try {
    $result = $apiInstance->sendOmnimessage($omnimessage);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling OmknimessageApi->sendOmnimessage: ', $e->getMessage(), PHP_EOL;
}
    
curl https://api.messente.com/v1/omnimessage \
    -u MESSENTE_API_USERNAME:MESSENTE_API_PASSWORD \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{ "to": "RECIPIENT_PHONE_NUMBER", "messages": [{ "channel": "whatsapp", "sender": "YOUR_PHONE_NUMBER", "text": "Hello WhatsApp!" }, { "channel": "viber", "sender": "YOUR_PHONE_NUMBER", "text": "Hello Viber!" }, { "channel": "sms", "sender": "YOUR_PHONE_NUMBER", "text": "Happy messaging!" }] }'
    
// compile "com.messente.omnichannel:omnichannel-java"

public class Main {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure HTTP basic authorization: basicAuth
        HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
        basicAuth.setUsername("MESSENTE_API_USERNAME");
        basicAuth.setPassword("MESSENTE_API_PASSWORD");

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

        Viber viber = new Viber();
        viber.text("Viber text");
        viber.sender("YOUR_PHONE_NUMBER");

        WhatsApp whatsApp = new WhatsApp();
        WhatsAppText whatsAppText = new WhatsAppText();
        whatsAppText.body("WhatsApp text");
        whatsApp.text(whatsAppText);

        SMS sms = new SMS();
        sms.text("Happy messaging!");
        sms.sender("YOUR_PHONE_NUMBER");

        omnimessage.setMessages(Arrays.asList(whatsApp, viber, sms));
        omnimessage.setTo("RECIPIENT_PHONE_NUMBER");

        try {
            OmniMessageCreateSuccessResponse result = apiInstance.sendOmnimessage(omnimessage);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when sending SMS message");
            e.printStackTrace();
        }
    }
}
    
// npm install omnichannel_api --save

const OmnichannelApi = require('omnichannel_api');

const defaultClient = OmnichannelApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
const basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'MESSENTE_API_USERNAME';
basicAuth.password = 'MESSENTE_API_PASSWORD';

const api = new OmnichannelApi.OmnimessageApi();

const whatsAppText = OmnichannelApi.WhatsAppText.constructFromObject({
	body: "Hello WhatsApp!",
	preview_url: false
});

const whatsapp = OmnichannelApi.WhatsApp.constructFromObject({
	text: whatsAppText,
    sender: "YOUR_PHONE_NUMBER"
});

const viber = OmnichannelApi.Viber.constructFromObject({
	text: "Hello Viber!",
	sender: "YOUR_PHONE_NUMBER"
});

const sms = OmnichannelApi.SMS.constructFromObject({
    text: "Happy messaging!",
    sender: 'YOUR_PHONE_NUMBER'
});

const omnimessage = OmnichannelApi.Omnimessage.constructFromObject({
    messages: [viber, whatsapp, sms],
    to: "RECIPIENT_PHONE_NUMBER"
});

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

from omnichannel import OmnimessageApi, Viber, SMS, Omnimessage, Configuration, ApiClient, WhatsApp, WhatsAppText
from omnichannel.rest import ApiException

# API information from https://dashboard.messente.com/api-settings
configuration = Configuration()
configuration.username = "MESSENTE_API_USERNAME"
configuration.password = "MESSENTE_API_PASSWORD"

# create an instance of the API class
api_instance = OmnimessageApi(ApiClient(configuration))

whatsapp = WhatsApp(sender="YOUR_PHONE_NUMBER", text=WhatsAppText(body="Hello WhatsApp"))
viber = Viber(sender="YOUR_PHONE_NUMBER", text="Hello Viber")
sms = SMS(sender="YOUR_PHONE_NUMBER", text="Happy messaging!" )

omnimessage = Omnimessage(to="RECIPIENT_PHONE_NUMBER", messages=(viber, whatsapp, sms))

try:
    response = api_instance.send_omnimessage(omnimessage)
    print("SMS successfully sent with id %s:" % response.omnimessage_id)
except ApiException as e:
    print("There was a problem sending message: %s\n" % e)
    

4. Get automatic delivery reports

Messente tracks the status of your sent message and reports status updates to you.

To be able to view the status, you must add a callback URL to the code used at your end. Messente will use this URL to make HTTP POST requests, if there is an status update.

Here is a code snippet for you to test it out quickly.

Learn more about the delivery status

# 1. Get a temporary WebHook URL from https://webhook.site/ .
# Leave the website open. This is where you'll see your incoming delivery reports.

# 2. Edit the previous code example by adding the delivery URL to the request.
var omnimessage = new Omnimessage(to: "RECIPIENT_PHONE_NUMBER", messages: messages, dlr_url: "YOUR_WEBHOOK_URL");

# 3. Send an SMS with the script and monitor the incoming requests in the webhook website.
    
# 1. Get a temporary WebHook URL from https://webhook.site/ .
# Leave the website open. This is where you'll see your incoming delivery reports.

# 2. Edit the previous code example by adding the delivery URL to the request.
omnimessage.dlr_url = 'YOUR_WEBHOOK_URL'

# 3. Send an SMS with the script and monitor the incoming requests in the webhook website.
    
# 1. Get a temporary WebHook URL from https://webhook.site/ .
# Leave the website open. This is where you'll see your incoming delivery reports.

# 2. Edit the previous code example by adding the delivery URL to the request.
omnimessage = Omnimessage(to="RECIPIENT_PHONE_NUMBER", messages=(sms,), dlr_url="YOUR_WEBHOOK_URL")

# 3. Send an SMS with the script and monitor the incoming requests in the webhook website.
    
// 1. Get a temporary WebHook URL from https://webhook.site/ .
// Leave the website open. This is where you'll see your incoming delivery reports.

// 2. Edit the previous code example by adding the delivery URL to the request.
const omnimessage = OmnichannelApi.Omnimessage.constructFromObject({
	messages: [sms],
	to: "RECIPIENT_PHONE_NUMBER",
	dlr_url: "YOUR_WEBHOOK_URL"
});

// 3. Send an SMS with the script and monitor the incoming requests in the webhook website.
// 1. Get a temporary WebHook URL from https://webhook.site/ .
// Leave the website open. This is where you'll see your incoming delivery reports.

// 2. Edit the previous code example by adding the delivery URL to the request.
$omnimessage = new Omnimessage(["to" => "RECIPIENT_PHONE_NUMBER", "dlr_url" => "YOUR_WEBHOOK_URL"]);

// 3. Send an SMS with the script and monitor the incoming requests in the webhook website.
    
// 1. Get a temporary WebHook URL from https://webhook.site/ .
// Leave the website open. This is where you'll see your incoming delivery reports.

// 2. Edit the previous code example by adding the delivery URL to the request.
omnimessage.setTo("RECIPIENT_PHONE_NUMBER");
omnimessage.setDlrUrl("YOUR_WEBHOOK_URL");

// 3. Send an SMS with the script and monitor the incoming requests in the webhook website.
    
# 1. Get a temporary WebHook URL from https://webhook.site/ .
# Leave the website open. This is where you'll see your incoming delivery reports.

# 2. Edit the previous code example by adding the delivery URL to the request.
curl https://api.messente.com/v1/omnimessage \
    -u MESSENTE_API_USERNAME:MESSENTE_API_PASSWORD \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{ "to": "RECIPIENT_PHONE_NUMBER", "messages": [{ "channel": "sms", "sender": "YOUR_PHONE_NUMBER", "text": "Happy messaging!" }] }, "dlr_url": "YOUR_WEBHOOK_URL"'

# 3. Send an SMS with the script and monitor the incoming requests in the webhook website.
    

5. Set multi-channel message with priority

Messente is not limited to SMS. Using Messente, you can send messages to several channels including Viber and WhatsApp (with more integrations coming up). 

Messente also allows you to set channel priority or fallback priority. If the message recipient has not signed up or is not available on one of the channels, then Messente tries the next available channel.

For example, you can send a message to Viber first and if the user is not registered to Viber, then Messente tries Whatsapp. If the user is not available on Whatsapp either, then Messente tries SMS.

Here is another code snippet to play around with.

Find a detailed API reference on sending message.

# pip install omnichannel-api

from omnichannel import OmnimessageApi, Viber, SMS, Omnimessage, Configuration, ApiClient, WhatsApp, WhatsAppText
from omnichannel.rest import ApiException

# API information from https://dashboard.messente.com/api-settings
configuration = Configuration()
configuration.username = "MESSENTE_API_USERNAME"
configuration.password = "MESSENTE_API_PASSWORD"

# create an instance of the API class
api_instance = OmnimessageApi(ApiClient(configuration))

whatsapp = WhatsApp(sender="YOUR_PHONE_NUMBER", text=WhatsAppText(body="Hello WhatsApp"))
viber = Viber(sender="YOUR_PHONE_NUMBER", text="Hello Viber")
sms = SMS(sender="YOUR_PHONE_NUMBER", text="Happy messaging!" )

omnimessage = Omnimessage(to="RECIPIENT_PHONE_NUMBER", messages=(viber, whatsapp, sms))

try:
    response = api_instance.send_omnimessage(omnimessage)
    print("SMS successfully sent with id %s:" % response.omnimessage_id)
except ApiException as e:
    print("There was a problem sending message: %s\n" % e)
    
curl https://api.messente.com/v1/omnimessage \
    -u MESSENTE_API_USERNAME:MESSENTE_API_PASSWORD \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{ "to": "RECIPIENT_PHONE_NUMBER", "messages": [{ "channel": "whatsapp", "sender": "YOUR_PHONE_NUMBER", "text": "Hello WhatsApp!" }, { "channel": "viber", "sender": "YOUR_PHONE_NUMBER", "text": "Hello Viber!" }, { "channel": "sms", "sender": "YOUR_PHONE_NUMBER", "text": "Happy messaging!" }] }'
    
// compile "com.messente.omnichannel:omnichannel-java"

public class Main {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure HTTP basic authorization: basicAuth
        HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
        basicAuth.setUsername("MESSENTE_API_USERNAME");
        basicAuth.setPassword("MESSENTE_API_PASSWORD");

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

        Viber viber = new Viber();
        viber.text("Viber text");
        viber.sender("YOUR_PHONE_NUMBER");

        WhatsApp whatsApp = new WhatsApp();
        WhatsAppText whatsAppText = new WhatsAppText();
        whatsAppText.body("WhatsApp text");
        whatsApp.text(whatsAppText);

        SMS sms = new SMS();
        sms.text("Happy messaging!");
        sms.sender("YOUR_PHONE_NUMBER");

        omnimessage.setMessages(Arrays.asList(whatsApp, viber, sms));
        omnimessage.setTo("RECIPIENT_PHONE_NUMBER");

        try {
            OmniMessageCreateSuccessResponse result = apiInstance.sendOmnimessage(omnimessage);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when sending SMS message");
            e.printStackTrace();
        }
    }
}
    
// composer require messente/messente-omnichannel-php

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

use \Messente\Omnichannel\Api\OmnimessageApi;
use \Messente\Omnichannel\Configuration;
use \Messente\Omnichannel\Model\Omnimessage;
use \Messente\Omnichannel\Model\Viber;
use \Messente\Omnichannel\Model\SMS;
use \Messente\Omnichannel\Model\WhatsApp;
use \Messente\Omnichannel\Model\WhatsAppText;

// Configure HTTP basic authorization: basicAuth
$config = Configuration::getDefaultConfiguration()
    ->setUsername('MESSENTE_API_USERNAME')
    ->setPassword('MESSENTE_API_PASSWORD');

$apiInstance = new OmnimessageApi(new GuzzleHttp\Client(), $config);
$omnimessage = new Omnimessage(["to" => "RECIPIENT_PHONE_NUMBER"]);

$whatsAppText = new WhatsAppText(["body" => "Hello WhatsApp!"]);
$whatsapp = new WhatsApp(['text' => $whatsAppText, "sender" => "YOUR_PHONE_NUMBER"]);
$viber = new Viber( ["text" => "Hello Viber!", "sender" => "YOUR_PHONE_NUMBER"]);
$sms = new SMS(["text" => "Happy messaging!", "sender" => "YOUR_PHONE_NUMBER"]);
$omnimessage->setMessages([$viber, $whatsapp, $sms]);

try {
    $result = $apiInstance->sendOmnimessage($omnimessage);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling OmknimessageApi->sendOmnimessage: ', $e->getMessage(), PHP_EOL;
}
    
// npm install omnichannel_api --save

const OmnichannelApi = require('omnichannel_api');

const defaultClient = OmnichannelApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
const basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'MESSENTE_API_USERNAME';
basicAuth.password = 'MESSENTE_API_PASSWORD';

const api = new OmnichannelApi.OmnimessageApi();

const whatsAppText = OmnichannelApi.WhatsAppText.constructFromObject({
	body: "Hello WhatsApp!",
	preview_url: false
});

const whatsapp = OmnichannelApi.WhatsApp.constructFromObject({
	text: whatsAppText,
    sender: "YOUR_PHONE_NUMBER"
});

const viber = OmnichannelApi.Viber.constructFromObject({
	text: "Hello Viber!",
	sender: "YOUR_PHONE_NUMBER"
});

const sms = OmnichannelApi.SMS.constructFromObject({
    text: "Happy messaging!",
    sender: 'YOUR_PHONE_NUMBER'
});

const omnimessage = OmnichannelApi.Omnimessage.constructFromObject({
    messages: [viber, whatsapp, sms],
    to: "RECIPIENT_PHONE_NUMBER"
});

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

require 'omnichannel'

# setup authorization
Omnichannel.configure do |config|
    # Configure HTTP basic authorization: basicAuth
    config.username = 'MESSENTE_API_USERNAME'
    config.password = 'MESSENTE_API_PASSWORD'
end

api_instance = Omnichannel::OmnimessageApi.new

omnimessage = Omnichannel::Omnimessage.new
omnimessage.to = 'RECIPIENT_PHONE_NUMBER'
omnimessage.messages = [
    Omnichannel::WhatsApp.new(
        {
            :sender => "YOUR_PHONE_NUMBER",
            :text => Omnichannel::WhatsAppText.new(
                {
                    :body => "Hello from WhatsApp!",
                    :preview_url => false
                }
            )
        }
    ),
    Omnichannel::Viber.new(
        {
            :sender => "YOUR_PHONE_NUMBER",
            :text => "Hello from Viber!"
        }
    ),
    Omnichannel::SMS.new(
        {
            :sender => "YOUR_PHONE_NUMBER",
            :text => "Hello SMS!"
        }
    )
]

begin
    result = api_instance.send_omnimessage(omnimessage)
    puts "SMS successfully sent!"
rescue Omnichannel::ApiError => e
    puts "There was a problem sending SMS: #{e}"
    puts e.response_body
end
    
// PM > Install-Package com.Messente.Omnichannel

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

namespace Example
{
    public class SendOmniMessageExample
    {
        public static void Main()
        {
            // Configure HTTP basic authorization: basicAuth
            Configuration.Default.Username = "MESSENTE_API_USERNAME";
            Configuration.Default.Password = "MESSENTE_API_PASSWORD";

            List messages = new List();
            var sms = new SMS(sender: "YOUR_PHONE_NUMBER", text: "Hello SMS!");
            var viber = new Viber(text: "Hello viber!");
            var whatsapp = new WhatsApp(text: new WhatsAppText(body: "Hello WhatsApp!"));

            messages.Add(viber);
            messages.Add(whatsapp);
            messages.Add(sms);

            var apiInstance = new OmnimessageApi();
            var omnimessage = new Omnimessage(to: "RECIPIENT_PHONE_NUMBER", messages: messages);

            try
            {
                OmniMessageCreateSuccessResponse result = apiInstance.SendOmnimessage(omnimessage);
                Debug.Print("SMS successfully sent!");
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("There was a problem sending SMS: " + e.Message);
            }

        }
    }
}
    

Congratulations!

You're now ready to start sending.

Take a look at the full API specification about delivery reports and error codes.

Our Messaging API is not limited to SMS. We also support Viber and WhatsApp messages among many others. And the list of channels we support is increasing each day!

Keep in touch for news on integrations with additional channels.

Go to API specification