OMNI channel: Introduction
Welcome to the OMNI channel messaging solution.
OMNI channel is a messaging solution that enables you to communicate with your users through various messaging channels. Infobip resolves all of the technical complexities, providing you with a turnkey solution for delivering custom textual messages and rich content.
Leverage your communication options with OMNI messaging and engage your users over the following channels:
- SMS
- VOICE
- VIBER
- PUSH
How it works
OMNI scenario
OMNI scenario has to be defined before you start sending messages to users. This scenario is used to define the flow of how the message will be sent. Since we support various communication channels, you'll have to define steps and the order of those steps in your scenario flow.
Below is an example showing how to create a scenario with steps and the order of those steps in the scenario flow:
POST /omni/1/scenarios HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
{
"name":"My first scenario",
"flow": [
{
"from": "InfoSMS",
"channel": "SMS"
},
{
"from": "41793026727",
"channel": "VOICE"
},
{
"from": "DemoViberApplication",
"channel": "VIBER"
},
{
"from": "DemoFBMessengerApplication",
"channel": "FACEBOOK"
},
{
"from": "your@email.com",
"channel": "EMAIL"
},
{
"from": "233623e3c860b49ec69a464834343481-8bj4el4a-256d-23fd-56ad-b5bc3d568b53",
"channel": "PUSH"
}
],
"default": true
}
When sending a message, the Infobip platform will attempt to send the message based on the order of steps in your scenario flow. If a user can't receive the message with a specific scenario channel, the failover mechanism will be triggered and the message will be sent over the next step.
Note:
You must have a default scenario with at least one step in the scenario flow. If you want to use Viber as a communication channel, please contact us for service setup.
When creating steps in the scenario flow, you need to define the from
parameter that represents the sender of the specific channel. Note that for Viber you have to use your Viber service ID that is provided by Infobip.
Find out more details about OMNI scenarios in our API Scenario specification.
Sending OMNI message
After creating the first scenario, you are ready to send your OMNI messages through the defined communication channels.
There are two API methods that can be used for sending messages, simple and advanced. The simple API method enables you to send a single textual message over various channels. This functionality is useful when you need to send a generic text and to have a failover mechanism:
POST /omni/1/text HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
{
"destinations":[
{
"to":{
"phoneNumber": "41793026727",
"emailAddress": "email@example.com"
}
}
],
"text": "A long time ago in a galaxy far, far away..."
}
On the other hand, you can use the advanced API method when you want to send custom content over a specific communication channel.
POST /omni/1/advanced HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
{
"bulkId":"BULK-ID-123-xyz",
"scenarioKey":"AD9E01A5DC7BEE2C2B828D208182A611",
"destinations":[
{
"messageId":"MESSAGE-ID-123-xyz",
"to":"41793026727"
},
{
"to":"41793026731"
}
],
"sms": {
"text": "This is custom SMS text. Over SMS I can send a text with 160 characters."
},
"viber": {
"text": "But if I use Viber, my message text will have capacity of 1.000 characters."
},
"facebook": {
"text": "If I use Facebook comunication channel, message text will have the capacity of 1.000 characters."
},
"voice": {
"text": "And with Voice, my user will receive voice message converted from text."
},
"email":{
"text":"Email combines together the longest possible message length and a nice subject.",
"subject": "And here goes the nice email subject"
},
"push": {
"text": "this PUSH message will pop up on your mobile device."
},
}
Depending on the channel you're using, you can specify various text length:
Parameters
Channel | Text length |
---|---|
SMS | Max 160 characters for one message. |
Viber | Max 1.000 characters. |
Facebook Messenger | Max 1.000 characters. |
Voice | Unlimited. |
Unlimited. | |
Push | Max 4.000 characters. |
Note:
When sending OMNI messages, you can specify the scenario you’re using by setting the scenarioKey
parameter. If you don’t specify this parameter the OMNI message will be sent over the default scenario.
Find out more details on how to send a Single OMNI message or how to Customize your content for the specific channel in our API endpoint specifications.