{"_id":"56618ad455e4450d00e62b89","parentDoc":null,"user":"54eb4fdedf7add210007b29b","category":{"_id":"56669e857cc81e0d00253f8e","project":"54eb50e5615ffc1900305a16","__v":8,"pages":["568ceacb8a7ca5190039643a","5693a7995f1c951900644b25","5698e793d36db20d00ddba45","56a0ce7441766e0d00b28cf8","56a0d36544f3d80d00a2c242","56a0d3e0aca0730d003e3475","56a5ecf7b91d8d0d008349cc","56d595dba0b5600b000b1e75"],"version":"54eb63b859b1172100334fae","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-12-08T09:10:29.254Z","from_sync":false,"order":6,"slug":"omni-channel-messaging","title":"OMNI channel messaging"},"project":"54eb50e5615ffc1900305a16","version":{"_id":"54eb63b859b1172100334fae","project":"54eb50e5615ffc1900305a16","forked_from":"54eb63a1867e1917009b711d","__v":28,"createdAt":"2015-02-23T17:30:32.501Z","releaseDate":"2015-02-23T17:30:32.501Z","categories":["54eb63b959b1172100334faf","54eb63b959b1172100334fb0","54eb63b959b1172100334fb1","54eb63b959b1172100334fb2","54ed8dd4ab373e2300f50eae","54ed99b2ab373e2300f50ede","55153a6de68daa2f00cff838","551546edbc466623002afe72","5515472ac28d6125001b8884","55154749c28d6125001b8885","555d9b4106dfec0d00d38ea7","5613e06e433e5735007c7708","5624bbb785a31117001c5403","56669e857cc81e0d00253f8e","568b8d837a42220d00498311","56a632277ef6620d00e2f18a","56d8147c3eb4dd0b00201aac","57a9ce2fac6db30e000d7efd","57a9cf4e944ea60e00dc3f74","58172386715dce0f00da4aa0","582dc59ee1b8692300c0dd03","589b19b4fec2730f0082e040","58b04a023529383900a759b5","58b92d1598157a0f004869bf","592e7685c58275000f20174f","59392839e376d4002f8a0474","59393064e376d4002f8a05a1","5947ae0d4005e2000f3a4fec","594a74df1d1de5001ab3517a","5954bc387a147f001b918915","59b8eeeb707542001076d3b6"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1"},"__v":22,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-12-04T12:45:08.059Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":true,"order":0,"body":"**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.\n\nLeverage your communication options with OMNI messaging and engage your users over the following channels:\n\n- **SMS** \n- **VOICE** \n- **VIBER** \n- **EMAIL**\n- **FACEBOOK** \n- **PUSH**  \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"How it works\"\n}\n[/block]\n# OMNI scenario\n\n**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.\n\nBelow is an example showing how to create a scenario with steps and the order of those steps in the scenario flow:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"POST /omni/1/scenarios HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nContent-Type: application/json\\n\\n{\\n  \\\"name\\\":\\\"My first scenario\\\",\\n  \\\"flow\\\": [\\n    {\\n      \\\"from\\\": \\\"InfoSMS\\\",\\n      \\\"channel\\\": \\\"SMS\\\"\\n    },\\n    {\\n      \\\"from\\\": \\\"41793026727\\\",\\n      \\\"channel\\\": \\\"VOICE\\\"\\n    },\\n    {\\n      \\\"from\\\": \\\"DemoViberApplication\\\",\\n      \\\"channel\\\": \\\"VIBER\\\"\\n    },\\n    {\\n      \\\"from\\\": \\\"DemoFBMessengerApplication\\\",\\n      \\\"channel\\\": \\\"FACEBOOK\\\"\\n    },\\n    {\\n      \\\"from\\\": \\\"your:::at:::email.com\\\",\\n      \\\"channel\\\": \\\"EMAIL\\\"\\n    },\\n    {\\n      \\\"from\\\": \\\"233623e3c860b49ec69a464834343481-8bj4el4a-256d-23fd-56ad-b5bc3d568b53\\\",\\n      \\\"channel\\\": \\\"PUSH\\\"\\n    }\\n  ],\\n  \\\"default\\\": true\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nWhen 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 fail-over mechanism will be triggered and the message will be sent over the next step.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Note:\",\n  \"body\": \"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](mailto:api@infobip.com) for service setup.\"\n}\n[/block]\nWhen 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. \n\n**Find out more details about OMNI scenarios in our [API Scenario specification](doc:omni-create-scenario).**\n\n# Sending OMNI message\n\nAfter creating the first scenario, you are ready to send your OMNI messages through the defined communication channels.\n\nThere 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 fail-over mechanism: \n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"POST /omni/1/text HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nContent-Type: application/json\\n\\n{ \\n    \\\"destinations\\\":[ \\n        { \\n          \\\"to\\\":{\\n              \\\"phoneNumber\\\": \\\"41793026727\\\",\\n              \\\"emailAddress\\\": \\\"email@example.com\\\"\\n            }\\n        }\\n    ],\\n    \\\"text\\\": \\\"A long time ago in a galaxy far, far away...\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nOn the other hand, you can use the **advanced** API method when you want to send custom content over a specific communication channel. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"POST /omni/1/advanced HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nContent-Type: application/json\\n\\n{ \\n\\t\\\"bulkId\\\":\\\"BULK-ID-123-xyz\\\",\\n  \\\"scenarioKey\\\":\\\"AD9E01A5DC7BEE2C2B828D208182A611\\\",  \\n  \\\"destinations\\\":[ \\n  \\t{ \\n    \\t\\\"messageId\\\":\\\"MESSAGE-ID-123-xyz\\\",\\n      \\\"to\\\":\\\"41793026727\\\"\\n    },\\n    { \\n    \\t\\\"to\\\":\\\"41793026731\\\"\\n    }\\n  ],\\n  \\\"sms\\\": {\\n  \\t\\\"text\\\": \\\"This is custom SMS text. Over SMS I can send a text with 160 characters.\\\"\\n  },\\n  \\\"viber\\\": {\\n  \\t\\\"text\\\": \\\"But if I use Viber, my message text will have capacity of 1.000 characters.\\\"\\n  },\\n  \\\"facebook\\\": {\\n  \\t\\\"text\\\": \\\"If I use Facebook comunication channel, message text will have the capacity of 1.000 characters.\\\"\\n  },\\n  \\\"voice\\\": {\\n  \\t\\\"text\\\": \\\"And with Voice, my user will receive voice message converted from text.\\\"\\n  },\\n  \\\"email\\\":{\\n    \\\"text\\\":\\\"Email combines together the longest possible message length and a nice subject.\\\",\\n    \\\"subject\\\": \\\"And here goes the nice email subject\\\"\\n   },\\n  \\\"push\\\": {\\n  \\t\\\"text\\\": \\\"this PUSH message will pop up on your mobile device.\\\"\\n  },\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nDepending on the channel you're using, you can specify various text length:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Channel\",\n    \"h-1\": \"Text length\",\n    \"0-0\": \"SMS\",\n    \"0-1\": \"Max 160 characters for one message\",\n    \"1-0\": \"Viber\",\n    \"1-1\": \"Max 1.000 characters\",\n    \"3-0\": \"Voice\",\n    \"3-1\": \"Unlimited\",\n    \"4-0\": \"Email\",\n    \"4-1\": \"Unlimited\",\n    \"5-0\": \"PUSH\",\n    \"5-1\": \"Max 4.000 characters\",\n    \"2-0\": \"Facebook Messenger\",\n    \"2-1\": \"Max 1.000 characters\"\n  },\n  \"cols\": 2,\n  \"rows\": 6\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Note:\",\n  \"body\": \"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.\"\n}\n[/block]\n**Find out more details on how to send a [Single OMNI message](doc:omni-send-simple-message) or how to [Customize your content for the specific channel](doc:omni-send-advanced-message) in our API endpoint specifications.**","excerpt":"","slug":"omni-introduction","type":"basic","title":"OMNI channel: Introduction"}

OMNI channel: Introduction


**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** - **EMAIL** - **FACEBOOK** - **PUSH** [block:api-header] { "type": "basic", "title": "How it works" } [/block] # 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: [block:code] { "codes": [ { "code": "POST /omni/1/scenarios HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/json\n\n{\n \"name\":\"My first scenario\",\n \"flow\": [\n {\n \"from\": \"InfoSMS\",\n \"channel\": \"SMS\"\n },\n {\n \"from\": \"41793026727\",\n \"channel\": \"VOICE\"\n },\n {\n \"from\": \"DemoViberApplication\",\n \"channel\": \"VIBER\"\n },\n {\n \"from\": \"DemoFBMessengerApplication\",\n \"channel\": \"FACEBOOK\"\n },\n {\n \"from\": \"your@email.com\",\n \"channel\": \"EMAIL\"\n },\n {\n \"from\": \"233623e3c860b49ec69a464834343481-8bj4el4a-256d-23fd-56ad-b5bc3d568b53\",\n \"channel\": \"PUSH\"\n }\n ],\n \"default\": true\n}", "language": "json" } ] } [/block] 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 fail-over mechanism will be triggered and the message will be sent over the next step. [block:callout] { "type": "info", "title": "Note:", "body": "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](mailto:api@infobip.com) for service setup." } [/block] 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](doc:omni-create-scenario).** # 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 fail-over mechanism: [block:code] { "codes": [ { "code": "POST /omni/1/text HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/json\n\n{ \n \"destinations\":[ \n { \n \"to\":{\n \"phoneNumber\": \"41793026727\",\n \"emailAddress\": \"email@example.com\"\n }\n }\n ],\n \"text\": \"A long time ago in a galaxy far, far away...\"\n}", "language": "json" } ] } [/block] On the other hand, you can use the **advanced** API method when you want to send custom content over a specific communication channel. [block:code] { "codes": [ { "code": "POST /omni/1/advanced HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/json\n\n{ \n\t\"bulkId\":\"BULK-ID-123-xyz\",\n \"scenarioKey\":\"AD9E01A5DC7BEE2C2B828D208182A611\", \n \"destinations\":[ \n \t{ \n \t\"messageId\":\"MESSAGE-ID-123-xyz\",\n \"to\":\"41793026727\"\n },\n { \n \t\"to\":\"41793026731\"\n }\n ],\n \"sms\": {\n \t\"text\": \"This is custom SMS text. Over SMS I can send a text with 160 characters.\"\n },\n \"viber\": {\n \t\"text\": \"But if I use Viber, my message text will have capacity of 1.000 characters.\"\n },\n \"facebook\": {\n \t\"text\": \"If I use Facebook comunication channel, message text will have the capacity of 1.000 characters.\"\n },\n \"voice\": {\n \t\"text\": \"And with Voice, my user will receive voice message converted from text.\"\n },\n \"email\":{\n \"text\":\"Email combines together the longest possible message length and a nice subject.\",\n \"subject\": \"And here goes the nice email subject\"\n },\n \"push\": {\n \t\"text\": \"this PUSH message will pop up on your mobile device.\"\n },\n}", "language": "json" } ] } [/block] Depending on the channel you're using, you can specify various text length: [block:parameters] { "data": { "h-0": "Channel", "h-1": "Text length", "0-0": "SMS", "0-1": "Max 160 characters for one message", "1-0": "Viber", "1-1": "Max 1.000 characters", "3-0": "Voice", "3-1": "Unlimited", "4-0": "Email", "4-1": "Unlimited", "5-0": "PUSH", "5-1": "Max 4.000 characters", "2-0": "Facebook Messenger", "2-1": "Max 1.000 characters" }, "cols": 2, "rows": 6 } [/block] [block:callout] { "type": "info", "title": "Note:", "body": "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." } [/block] **Find out more details on how to send a [Single OMNI message](doc:omni-send-simple-message) or how to [Customize your content for the specific channel](doc:omni-send-advanced-message) in our API endpoint specifications.**