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.

# pip install omnichannel-api

from omnichannel import OmnimessageApi, SMS, Omnimessage, Configuration, ApiClient
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))

sms = SMS(sender="YOUR_PHONE_NUMBER", text="Happy messaging!" )
omnimessage = Omnimessage(to="RECIPIENT_PHONE_NUMBER", messages=(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 SMS: %s\n" % e)
    
// 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 sms = OmnichannelApi.SMS.constructFromObject({
    text: "Happy messaging!",
    sender: 'YOUR_PHONE_NUMBER'
});

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

api.sendOmnimessage(omnimessage, (error, data) => {
    if (error) {
        console.error(error);
    } else {
        console.log('API called successfully. Returned data: ', data);
    }
});
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!" }] }'
    
// 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\SMS;

// 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"]);

$sms = new SMS(["text" => "Happy messaging!", "sender" => "YOUR_PHONE_NUMBER"]);
$omnimessage->setMessages([$sms]);

try {
    $result = $apiInstance->sendOmnimessage($omnimessage);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling OmnimessageApi->sendOmnimessage: ', $e->getMessage(), PHP_EOL;
}
    
// 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();

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

        omnimessage.setMessages(Arrays.asList(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();
        }
    }
}
    

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.
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;<div class="doc-content-container with-code blue with-icon">
  <div class="container-icon"><i data-feather="fast-forward"></i></div>

  <div class="row">
    <div class="col-xs-12 col-md-12 col-lg-5 content-text">
      <h2>5. Multi-channel message with fallback</h2>
                        <p>You're not only limited to SMS when you use Messente. We also provide <a href="https://www.viber.com/" target="_blank">Viber</a> and <a href="https://www.whatsapp.com/" target="_blank">WhatsApp</a> messages (with more integrations coming).
                        </p><p>Moreover you can send a multi-channel message with a fallback option. Meaning you can prepare a single message to multiple channels and our system will automatically try to send the message to them one-by-one. If recipient is not signed up or available in one of the channels then the next channel is tried.</p>
                        <p>For example you can easily send a message to first Viber (if user isn't registered) then to WhatsApp and then to SMS with setting the channel priorities yourself.</p>
                        <p>Use the code sample to test it out.</p>
                       
                          <p class="mb-5">
<a href="/documentation/omnichannel-api/sending-omnimessage" target="_self" class="arrowed-link">The full specification</a>
<!--<a href="/documentation/omnichannel-api/sending-omnimessage" target="_self" class="arrowed-link">How to register a Viber sender ID?</a>-->
<!--<a href="/documentation/omnichannel-api/sending-omnimessage" target="_self" class="arrowed-link">How to register a WhatsApp sender ID?</a>-->
</p>
    </div> // 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);
    }
});

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