Omnichannel API

Sending Omnimessage

To send a Omnimessage, make the request to following API endpoint:

POST https://api.messente.com/v1/omnimessage

Request headers

HTTP headerDescription
AuthorizationrequiredBasic authentication using Messente API username and password
Content-TyperequiredSet to application/json
AcceptrequiredSet to application/json

Request payload

KeyDescription
torequiredPhone number of recipient in international format (+440000000)
messages[]requiredAn array of SmsMessage, ViberMessage and WhatsAppMessage in the preferred delivery order.
At least one Message must be provided, no duplicate object types allowed.

SmsMessage
channelrequiredSet to sms
textrequiredAll characters (Unicode) and long messages are supported
senderOptional parameter that sets the Sender name.
Value must be encoded in UTF-8.
When not set, the default API Sender Name for the account is used instead
udhUDH parameter of the SMS, hex-encoded
autoconvert
ondefaultUse replacement settings from the account's API Auto Replace settings page
fullAll non GSM 03.38 characters will be replaced with suitable alternatives
offMessage content is not modified in any way

ViberMessage
channelrequiredSet to viber
senderOptional parameter that sets the Sender name. "sender" value must be encoded in UTF-8. When not set, the default API Sender Name for the account is used instead
text
Content of the viber message (maximum of 1000 characters)
button_textThe text on the button
button_urlThe URL of the button
image_urlEmbedded image URL

* Possible combinations of text, image and button elements for ViberMessage:

TextButtonImage
Only text
Text with button
Text, image and button
Only image  

WhatsApp
channelrequiredSet to whatsapp
senderOptional parameter that sets the Sender name. "sender" value must be encoded in UTF-8. When not set, the default API Sender Name for the account is used instead
text
body
Text content for WhatsApp message
preview_link
(optional)
Whether to preview URLs included in the message

audio
content
Base64-encoded string containing binary audio

document
content
Base64-encoded string containing binary document
caption (optional)
Caption describing the document
image
content
Base64-encoded string containing binary image
caption
(optional)
Caption describing the image

dlr_urlURL where the automatic Delivery Request is made.
Defaults to value set in API settings

Request example


POST /v1/omnimessage HTTP/1.1
Host: api.messente.com
Content-Type: application/json
Accept: application/json
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
{
"to": "+37251916062",
"dlr_url": "https://myserver.com/dlr/messente/",
"messages": [
{
"channel": "whatsapp",
"sender": "Messente",
"text": {
"body": "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.",
"preview_link": true
},
},
{
"channel": "viber",
"sender": "Messente",
"text": "You're all checked in to your flight! Here's your mobile boarding pass. Need help with anything else?",
"image_url": "https://s15.postimg.cc/v4kocjc7v/Sample_QR_code.png",
"button_text": "Update flight info",
"button_url": "http://bit.ly/2M0r8LC"
},
{
"channel": "sms",
"sender": "Messente",
"text": "You're all checked in to your flight! Here's your mobile boarding pass. http://bit.ly/2M0r8LC"
}
]
}

Response body

KeyValue
omnimessage_idUnique identifier for this Omnimessage
toThe phone number which received the message
messages[]Array of MessageResults objects that were specified to be sent

MessageResult
message_idUnique identifier for this message
senderSender that was used
channelChannel for this message - smsviber or whatsapp
errors[]In case there is an error with the message request, the errors are displayed here

ErrorItem
titleError message
detailLonger description of the error message
codeMachine-readable error code

101Not found
102Forbidden
103Unauthorized
104Invalid data
105Internal Server Error
106Missing data
107Method not allowed
sourceLocation in the request body for this error message

Response body example

{
"messages": [
{
"channel": "whatsapp",
"message_id": "eb687d55-8e80-46de-a98d-2718503d5a56",
"sender": "Messente"
},
{
"channel": "viber",
"message_id": "57c8dae1-3f79-47e8-bb1d-a5aaa824ffad",
"sender": "Messente"
},
{
"channel": "sms",
"message_id": "e25c189e-c9f7-404b-9532-dfe1f168d8f5",
"sender": "Messente"
}
],
"omnimessage_id": "1dc8e83c-61de-4e99-a0b0-80da6c82b6fc",
"to": "+37251916062"
}