Getting Started

Sending SMS messages with Messente is as simple as completing a few steps. 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. This way you can securely identify yourself as the API user.

We'll automatically add some credits to your account so you can test the API for free.

Create an account Where can I find my API key

2. Verify yourself as sender

To avoid spammers and people with bad intentions we require you to identify yourself. Registering a branded sender name is a manual process and might take a bit of time.

But you can still *start testing the API immediately* by registering your phone number as sender ID. In that case you can try sending messages to yourself right away.

Verify yourself as sender

The phone number is kept securely in our database and we will never share or use this number for any other reason.

Read more about branded sender names

3. Send your first SMS

Choose your programming language and use the following code to send your first SMS

Take a look at the complete API spec about sending messages

# 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();
        }
    }
}
    
# 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. Multi-channel message with fallback

You're not only limited to SMS when you use Messente. We also provide Viber and WhatsApp messages (with more integrations coming).

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.

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.

Use the code sample to test it out.

The full specification

# 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);
    }
});

Summary

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. Additionally we support Viber and WhatsApp messages (with more to come).

Go to API specification