read

Omni-channel API 1.0 Preview: Sending your first Viber message

As you may already know, the biggest project we have been focusing on here in Messente for past few months is the omni-channel messaging API.

Previously, I wrote about how we got to omnichannel messaging, and now I'm going to give you a Developer Preview of the API and what it allows you to do.

An API with today's standards

You most probably know about JSON and RESTful APIs - they're how we roll with our new API. It will help you use your existing know-how to get started faster and build cool products and services!

Let's get straight to it - the developer bits and pieces I mean - here is an example of a command line curl query to send your first Viber message.

Example 1: Sending "Hello world" using Messente's omnichannel API

curl --user user:pass \
--data '{"to":"+440000000","scenarios":[{"channel":"viber"}],"viber":{"sender":"Messente","text":"Hello world!"}}' https://api.messente.com/v1/omnimessage

And that's it! As you may have noticed, it is a POST request with Basic Auth, and the request body is a nicely formatted JSON string.

Features beyond basic

Omni-channel message - Viber

In the example above you see only the basic features of the omni-channel API, but let's go through the longer list of features:

  • SMS and Viber support
  • Automated failover
  • More detailed delivery reports
  • Scheduled sending with timezone support

Supported messaging channels

Currently the omni-channel API supports SMS and Viber out of the box, but we already have RCS in the pipeline with inbound messages (two-way messaging) to follow with upcoming releases.

As different messaging channels have different features supported (Viber can have CTA buttons with images, SMS has special UDH), in the API call we also have different parameters available for different channels.

Example 2: API call that will fallback to SMS in case Viber fails

{
  "to": "+440000000",
  "scenarios": [
    {"channel": "viber", "validity": 60},
    {"channel": "sms"}
  ],
  "viber": {
    "sender": "Coffee Shop",
    "text": "Do you need a little coffee-kickstart on your way into the office today? Well, stop by the coffee shop and get half off any coffee with your personal code.",
    "image_url": "https://s15.postimg.cc/lk11pipez/drinking-coffee-morning.jpg",
    "button_url": "https://bit.ly/2sBbeQH",
    "button_text": "Get your code!"
  },
  "sms": {
    "autoconvert": "off",
    "sender": "CoffeeShop",
    "text": "stop by the coffee shop and get half off any coffee with your personal code: https://bit.ly/2sBbeQH"
  },
  "dlr_url": "https://dlr.myservice.com/omni-dlr/"
}

Automated failover 101

In the previous example we set Viber validity to 60 seconds. This means that if the Viber message is not delivered within 60 seconds or the user does not have Viber account at all, an SMS will be automatically sent to the same phone number instead.

As you can also see, you can set the preferred order or channels to use using the "scenarios" parameter.

Different message, different content

Omni-channel message - Viber

Besides setting the preferred order of message delivery (by the way, you are not charged for failed Viber messages), you can also set different parameters for different message types.

Good old SMS

SMS pretty much always works, but it is also limited. 160 characters - sounds familiar? For comparison, Viber supports 1000-character long message content.

Go and compare our message content (example above) for Viber text and SMS text in our SMS length calculator. Yes, they are different and you will quickly understand why :)

Viber - more bang for the buck

Rreeaaaalllllyyyy long messages - YES
Images - YES
CTA buttons - YES
Branded logo for sender - YES
Failed message is free - YES

Do I need to say more?

Live demo at the end of a recorded webinar

We unveiled all of the details in a recent webinar. Check out the live demo towards the end of the webinar (link starts at demo.)

And if you want to get started with the API, please, go ahead! The documentation is up, the API is stable, and we're taking feedback :) 

Omni-channel messaging is here

Check out our latest webinar going over the details (plus a demo) of the intelligent A2P messaging API.
Learn more