{"__v":5,"_id":"565485099c4c6d0d00aeda02","category":{"__v":8,"_id":"56669e857cc81e0d00253f8e","pages":["568ceacb8a7ca5190039643a","5693a7995f1c951900644b25","5698e793d36db20d00ddba45","56a0ce7441766e0d00b28cf8","56a0d36544f3d80d00a2c242","56a0d3e0aca0730d003e3475","56a5ecf7b91d8d0d008349cc","56d595dba0b5600b000b1e75"],"project":"54eb50e5615ffc1900305a16","version":"54eb63b859b1172100334fae","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-12-08T09:10:29.254Z","from_sync":false,"order":4,"slug":"omni-channel-messaging","title":"OMNI channel messaging"},"editedParams":true,"editedParams2":true,"parentDoc":null,"project":"54eb50e5615ffc1900305a16","user":"54eb4fdedf7add210007b29b","version":{"__v":19,"_id":"54eb63b859b1172100334fae","forked_from":"54eb63a1867e1917009b711d","project":"54eb50e5615ffc1900305a16","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"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-11-24T15:40:57.528Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"language":"json","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\":{\n        \"phoneNumber\": \"41793026727\",\n        \"emailAddress\": \"email:::at:::example.com\"\n      }\n    },\n    { \n    \t\"to\":{\n        \"phoneNumber\": \"41793026731\"\n      }\n    }\n  ],\n  \"sms\": {\n  \t\"text\": \"This is custom SMS text.\"\n  },\n  \"parseco\": {\n  \t\"text\": \"But I can send also a custom Parseco text.\"\n  },\n  \"viber\": {\n  \t\"text\": \"Or to have fun with Viber text.\"\n  },\n  \"voice\": {\n  \t\"text\": \"Or make a call and read this text\"\n  },\n  \"facebook\": {\n  \t\"text\": \"Receive a message in Facebook Messenger.\"\n  },\n  \"email\":{\n    \"text\":\"Finally, send an email.\",\n    \"subject\": \"Email subject\"\n   }  \n}","name":""},{"code":"POST /omni/1/advanced HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/xml\n\n<request>\n  <bulkId>BULK-ID-123-xyz</bulkId>\n  <scenarioKey>AD9E01A5DC7BEE2C2B828D208182A611</scenarioKey>\n  <destinations>\n  \t<destination>\n    \t<to>\n        <phoneNumber>41793026727</phoneNumber>\n        <emailAddress>email@example.com</emailAddress>\n      </to>\n      <messageId>MESSAGE-ID-123-xyz</messageId>\n    </destination>\n    <destination>\n      <to>\n        <phoneNumber>41793026731</phoneNumber>\n      </to>\n    </destination>\n  </destinations>\n  <sms>\n    <text>SMS text</text>\n  </sms>\n  <parseco>\n    <text>Parseco text</text>\n  </parseco>\n  <viber>\n    <text>Viber text</text>\n  </viber>\n  <voice>\n    <text>Voice text</text>\n  </voice>\n  <email>\n    <text>Email text</text>\n    <subject>Subject</subject>\n  </email>\n</request>","language":"xml"},{"code":"curl -X POST \\\n-H \"Content-Type: application/json\" \\\n-H \"Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\" \\\n-d '{ \n\t\"bulkId\":\"BULK-ID-123-xyz\",\n  \"scenarioKey\":\"AD9E01A5DC7BEE2C2B828D208182A611\",  \n  \"destinations\":[ \n  \t{ \n    \t\"messageId\":\"MESSAGE-ID-123-xyz\",\n      \"to\":{\n        \"phoneNumber\": \"41793026727\",\n        \"emailAddress\": \"email@example.com\"\n      }\n    },\n    { \n    \t\"to\":{\n        \"phoneNumber\": \"41793026731\"\n      }\n    }\n  ],\n  \"sms\": {\n  \t\"text\": \"This is custom SMS text.\"\n  },\n  \"parseco\": {\n  \t\"text\": \"But I can send also a custom Parseco text.\"\n  },\n  \"viber\": {\n  \t\"text\": \"Or to have fun with Viber text.\"\n  },\n  \"voice\": {\n  \t\"text\": \"Or make a call and read this text\"\n  },\n  \"email\":{\n    \"text\":\"Email message text.\",\n    \"subject\": \"Test subject\"\n   }\n}' https://api.infobip.com/omni/1/advanced","language":"curl"},{"code":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, array(\n  CURLOPT_URL => \"http://api.infobip.com/omni/1/advanced\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"POST\",\n  CURLOPT_POSTFIELDS => \"{ \\\"bulkId\\\":\\\"BULK-ID-123-xyz\\\", \\\"scenarioKey\\\":\\\"AD9E01A5DC7BEE2C2B828D208182A611\\\", \\\"destinations\\\":[ { \\\"messageId\\\":\\\"MESSAGE-ID-123-xyz\\\", \\\"to\\\":{ \\\"phoneNumber\\\":\\\"41793026727\\\", \\\"emailAddress\\\":\\\"email@example.com\\\" } }, { \\\"to\\\":{ \\\"phoneNumber\\\":\\\"41793026731\\\" } } ], \\\"sms\\\":{ \\\"text\\\":\\\"This is custom SMS text.\\\" }, \\\"parseco\\\":{ \\\"text\\\":\\\"But I can send also a custom Parseco text.\\\" }, \\\"viber\\\":{ \\\"text\\\":\\\"Or to have fun with Viber text.\\\" }, \\\"voice\\\":{ \\\"text\\\":\\\"Or make a call and read this text\\\" }, \\\"facebook\\\":{ \\\"text\\\":\\\"Receive a message in Facebook Messenger.\\\" }, \\\"email\\\":{ \\\"text\\\":\\\"Finally, send an email.\\\", \\\"subject\\\":\\\"Email subject\\\" } }\",\n  CURLOPT_HTTPHEADER => array(\n    \"accept: application/json\",\n    \"authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\",\n    \"content-type: application/json\"\n  ),\n));\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}","language":"php"},{"code":"require 'uri'\nrequire 'net/http'\n\nurl = URI(\"https://api.infobip.com/omni/1/advanced\")\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\nhttp.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"authorization\"] = 'Basic RklUdGVhbTpGSVR4VElQ'\nrequest[\"content-type\"] = 'application/json'\nrequest[\"cache-control\"] = 'no-cache'\nrequest[\"postman-token\"] = 'ba1c51d5-26df-2cbf-a4de-58a95ac687cd'\nrequest.body = \"{ \\n  \\\"bulkId\\\":\\\"BULK-ID-123-xyz\\\",\\n  \\\"scenarioKey\\\":\\\"AD9E01A5DC7BEE2C2B828D208182A611\\\",  \\n  \\\"destinations\\\":[ \\n  \\t{ \\n    \\t\\\"messageId\\\":\\\"MESSAGE-ID-123-xyz\\\",\\n      \\\"to\\\":{\\n        \\\"phoneNumber\\\": \\\"41793026727\\\",\\n        \\\"emailAddress\\\": \\\"email@example.com\\\"\\n      }\\n    },\\n    { \\n    \\t\\\"to\\\":{\\n        \\\"phoneNumber\\\": \\\"41793026731\\\"\\n      }\\n    }\\n  ],\\n  \\\"sms\\\": {\\n  \\t\\\"text\\\": \\\"This is custom SMS text.\\\"\\n  },\\n  \\\"parseco\\\": {\\n  \\t\\\"text\\\": \\\"But I can send also a custom Parseco text.\\\"\\n  },\\n  \\\"viber\\\": {\\n  \\t\\\"text\\\": \\\"Or to have fun with Viber text.\\\"\\n  },\\n  \\\"voice\\\": {\\n  \\t\\\"text\\\": \\\"Or make a call and read this text\\\"\\n  },\\n  \\\"email\\\":{\\n    \\\"text\\\":\\\"Email message text.\\\",\\n    \\\"subject\\\": \\\"Test subject\\\"\\n   }\\n}\"\n\nresponse = http.request(request)\nputs response.read_body","language":"ruby"},{"code":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.infobip.com\")\n\npayload = \"{ \\n  \\\"bulkId\\\":\\\"BULK-ID-123-xyz\\\",\\n  \\\"scenarioKey\\\":\\\"AD9E01A5DC7BEE2C2B828D208182A611\\\",  \\n  \\\"destinations\\\":[ \\n  \\t{ \\n    \\t\\\"messageId\\\":\\\"MESSAGE-ID-123-xyz\\\",\\n      \\\"to\\\":{\\n        \\\"phoneNumber\\\": \\\"41793026727\\\",\\n        \\\"emailAddress\\\": \\\"email@example.com\\\"\\n      }\\n    },\\n    { \\n    \\t\\\"to\\\":{\\n        \\\"phoneNumber\\\": \\\"41793026731\\\"\\n      }\\n    }\\n  ],\\n  \\\"sms\\\": {\\n  \\t\\\"text\\\": \\\"This is custom SMS text.\\\"\\n  },\\n  \\\"parseco\\\": {\\n  \\t\\\"text\\\": \\\"But I can send also a custom Parseco text.\\\"\\n  },\\n  \\\"viber\\\": {\\n  \\t\\\"text\\\": \\\"Or to have fun with Viber text.\\\"\\n  },\\n  \\\"voice\\\": {\\n  \\t\\\"text\\\": \\\"Or make a call and read this text\\\"\\n  },\\n  \\\"email\\\":{\\n    \\\"text\\\":\\\"Email message text.\\\",\\n    \\\"subject\\\": \\\"Test subject\\\"\\n   }\\n}\"\n\nheaders = {\n    'content-type': \"application/json\",\n    'authorization': \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\"\n    }\n\nconn.request(\"POST\", \"/omni/1/advanced\", payload, headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))","language":"python"},{"code":"HttpResponse<String> response = Unirest.post(\"https://api.infobip.com/omni/1/advanced\")\n  .header(\"content-type\", \"application/json\")\n  .header(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\")\n  .body(\"{ \\n  \\\"bulkId\\\":\\\"BULK-ID-123-xyz\\\",\\n  \\\"scenarioKey\\\":\\\"AD9E01A5DC7BEE2C2B828D208182A611\\\",  \\n  \\\"destinations\\\":[ \\n  \\t{ \\n    \\t\\\"messageId\\\":\\\"MESSAGE-ID-123-xyz\\\",\\n      \\\"to\\\":{\\n        \\\"phoneNumber\\\": \\\"41793026727\\\",\\n        \\\"emailAddress\\\": \\\"email@example.com\\\"\\n      }\\n    },\\n    { \\n    \\t\\\"to\\\":{\\n        \\\"phoneNumber\\\": \\\"41793026731\\\"\\n      }\\n    }\\n  ],\\n  \\\"sms\\\": {\\n  \\t\\\"text\\\": \\\"This is custom SMS text.\\\"\\n  },\\n  \\\"parseco\\\": {\\n  \\t\\\"text\\\": \\\"But I can send also a custom Parseco text.\\\"\\n  },\\n  \\\"viber\\\": {\\n  \\t\\\"text\\\": \\\"Or to have fun with Viber text.\\\"\\n  },\\n  \\\"voice\\\": {\\n  \\t\\\"text\\\": \\\"Or make a call and read this text\\\"\\n  },\\n  \\\"email\\\":{\\n    \\\"text\\\":\\\"Email message text.\\\",\\n    \\\"subject\\\": \\\"Test subject\\\"\\n   }\\n}\")\n  .asString();","language":"java"},{"code":"var client = new RestClient(\"https://api.infobip.com/omni/1/advanced\");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\");\nrequest.AddHeader(\"content-type\", \"application/json\");\nrequest.AddParameter(\"application/json\", \"{ \\n  \\\"bulkId\\\":\\\"BULK-ID-123-xyz\\\",\\n  \\\"scenarioKey\\\":\\\"AD9E01A5DC7BEE2C2B828D208182A611\\\",  \\n  \\\"destinations\\\":[ \\n  \\t{ \\n    \\t\\\"messageId\\\":\\\"MESSAGE-ID-123-xyz\\\",\\n      \\\"to\\\":{\\n        \\\"phoneNumber\\\": \\\"41793026727\\\",\\n        \\\"emailAddress\\\": \\\"email@example.com\\\"\\n      }\\n    },\\n    { \\n    \\t\\\"to\\\":{\\n        \\\"phoneNumber\\\": \\\"41793026731\\\"\\n      }\\n    }\\n  ],\\n  \\\"sms\\\": {\\n  \\t\\\"text\\\": \\\"This is custom SMS text.\\\"\\n  },\\n  \\\"parseco\\\": {\\n  \\t\\\"text\\\": \\\"But I can send also a custom Parseco text.\\\"\\n  },\\n  \\\"viber\\\": {\\n  \\t\\\"text\\\": \\\"Or to have fun with Viber text.\\\"\\n  },\\n  \\\"voice\\\": {\\n  \\t\\\"text\\\": \\\"Or make a call and read this text\\\"\\n  },\\n  \\\"email\\\":{\\n    \\\"text\\\":\\\"Email message text.\\\",\\n    \\\"subject\\\": \\\"Test subject\\\"\\n   }\\n}\", ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);","language":"csharp"},{"code":"var data = JSON.stringify({ \n\t\"bulkId\":\"BULK-ID-123-xyz\",\n  \"scenarioKey\":\"AD9E01A5DC7BEE2C2B828D208182A611\",  \n  \"destinations\":[ \n  \t{ \n    \t\"messageId\":\"MESSAGE-ID-123-xyz\",\n      \"to\":{\n        \"phoneNumber\": \"41793026727\",\n        \"emailAddress\": \"email@example.com\"\n      }\n    },\n    { \n    \t\"to\":{\n        \"phoneNumber\": \"41793026731\"\n      }\n    }\n  ],\n  \"sms\": {\n  \t\"text\": \"This is custom SMS text.\"\n  },\n  \"parseco\": {\n  \t\"text\": \"But I can send also a custom Parseco text.\"\n  },\n  \"viber\": {\n  \t\"text\": \"Or to have fun with Viber text.\"\n  },\n  \"voice\": {\n  \t\"text\": \"Or make a call and read this text\"\n  },\n  \"email\":{\n    \"text\":\"Email message text.\",\n    \"subject\": \"Test subject\"\n   }\n});\n\nvar xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n  if (this.readyState === this.DONE) {\n    console.log(this.responseText);\n  }\n});\n\nxhr.open(\"POST\", \"https://api.infobip.com/omni/1/advanced\");\nxhr.setRequestHeader(\"content-type\", \"application/json\");\nxhr.setRequestHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\");\n\nxhr.send(data);","language":"javascript"}]},"results":{"codes":[{"status":200,"language":"json","code":"HTTP/1.1 200 OK\nContent-Type: application/json\n\n{   \n    \"bulkId\":\"BULK-ID-123-xyz\",\n    \"messages\":[   \n        {   \n            \"to\":{\n              \"phoneNumber\": \"41793026727\",\n              \"emailAddress\": \"email@example.com\"\n            },\n            \"status\":{   \n                \"groupId\":0,\n                \"groupName\":\"ACCEPTED\",\n                \"id\":0,\n                \"name\":\"MESSAGE_ACCEPTED\",\n                \"description\":\"Message accepted\"\n            },\n            \"messageId\":\"MESSAGE-ID-123-xyz\"\n        },\n        {   \n            \"to\":{\n              \"phoneNumber\": \"41793026731\"\n            },\n            \"status\":{   \n                \"groupId\":0,\n                \"groupName\":\"ACCEPTED\",\n                \"id\":0,\n                \"name\":\"MESSAGE_ACCEPTED\",\n                \"description\":\"Message accepted\"\n            },\n            \"messageId\":\"9304a5a3ab19-1ca1-be74-76ad87651ed25f35\"\n        }\n    ]\n}","name":"OK - JSON"},{"name":"OK - XML","status":200,"language":"xml","code":"HTTP/1.1 200 OK\nContent-Type: application/xml\n\n<omniResponse>\n\t<bulkId>BULK-ID-123-xyz</bulkId>\n\t<messages>\n  \t<message>\n\t\t\t<to>\n        <phoneNumber>41793026727</phoneNumber>\n        <emailAddress>email@example.com</emailAddress>\n      </to>\n\t\t\t<status>\n\t\t\t\t<groupId>0</groupId>\n\t\t\t\t<groupName>ACCEPTED</groupName>\n\t\t\t\t<id>0</id>\n\t\t\t\t<name>MESSAGE_ACCEPTED</name>\n\t\t\t\t<description>Message accepted</description>\n\t\t\t</status>\n\t\t\t<messageId>MESSAGE-ID-123-xyz</messageId>\n\t\t</message>\n\t\t<message>\n\t\t\t<to>\n        <phoneNumber>41793026731</phoneNumber>\n      </to>\n\t\t\t<status>\n\t\t\t\t<groupId>0</groupId>\n\t\t\t\t<groupName>ACCEPTED</groupName>\n\t\t\t\t<id>0</id>\n\t\t\t\t<name>MESSAGE_ACCEPTED</name>\n\t\t\t\t<description>Message accepted</description>\n\t\t\t</status>\n\t\t\t<messageId>9304a5a3ab19-1ca1-be74-76ad87651ed25f35</messageId>\n  \t</message>\n  </messages>\n</omniResponse>"}]},"settings":"554860d6d2c8410d006c215e","auth":"required","params":[{"_id":"565327d17d29410d004a0839","ref":"","in":"body","required":true,"desc":"Destination phone number. Addresses must be in international format (Example: `41793026727`).","default":"","type":"string","name":"phoneNumber"},{"_id":"56fbef3a587e43170081eb3c","ref":"","in":"body","required":false,"desc":"Destination email address.","default":"","type":"string","name":"emailAddress"},{"_id":"565327d17d29410d004a083a","ref":"","in":"body","required":false,"desc":"The ID that uniquely identifies the message sent.","default":"","type":"string","name":"messageId"},{"_id":"565327d17d29410d004a0838","ref":"","in":"body","required":false,"desc":"The ID which uniquely identifies the request. Bulk ID will be received only when you send a message to more than one destination address.","default":"","type":"string","name":"bulkId"},{"_id":"565327d17d29410d004a0837","ref":"","in":"body","required":false,"desc":"Scenario key that uniquely identifies the scenario which will be used when sending message. If this field is not set, the default scenario will be used.","default":"","type":"string","name":"scenarioKey"},{"_id":"565485099c4c6d0d00aeda05","ref":"","in":"body","required":false,"desc":"SMS specific data. The data will be used if the message is sent through SMS channel.","default":"","type":"object","name":"sms"},{"_id":"565485099c4c6d0d00aeda04","ref":"","in":"body","required":false,"desc":"Parseco specific data. The data will be used if the message is sent through Parseco channel.","default":"","type":"object","name":"parseco"},{"_id":"56d8113bc83c5f0b00d286fa","ref":"","in":"body","required":false,"desc":"Voice specific data. The data will be used if the message is sent through voice channel.","default":"","type":"object","name":"voice"},{"_id":"565485099c4c6d0d00aeda03","ref":"","in":"body","required":false,"desc":"Viber specific data. The data will be used if the message is sent through Viber channel.","default":"","type":"object","name":"viber"},{"_id":"584fe405b832763900aa5b4b","ref":"","in":"body","required":false,"desc":"Facebook Messenger specific data. The data will be used if the message is sent through Facebook channel.","default":"","type":"object","name":"facebook"},{"_id":"56fbef3a587e43170081eb3b","ref":"","in":"body","required":false,"desc":"Email specific data. The data will be used if the message is sent through email channel.","default":"","type":"object","name":"email"},{"_id":"565327d17d29410d004a0836","ref":"","in":"body","required":false,"desc":"Text of the message that will be sent.","default":"","type":"string","name":"text"},{"_id":"573d798acac1861700e3ef0d","ref":"","in":"body","required":false,"desc":"The message validity period in minutes. When the period expires, the message will be automatically sent using the next OMNI step. Validity period longer than 48h is not supported (in this case, it will be automatically set to 48h).","default":"","type":"string","name":"validityPeriod"},{"_id":"573d798acac1861700e3ef0c","ref":"","in":"body","required":false,"desc":"Date and time when the message is to be sent. Used for scheduled OMNi messaging (first message in the OMNI flow not sent immediately, but at scheduled time).","default":"","type":"datetime","name":"sendAt"}],"url":"/omni/:version/advanced"},"isReference":true,"order":5,"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"We will attempt to send message over steps defined in given scenario. If sending over first defined step fails, we will attempt to send it over second and so on.\",\n  \"title\": \"Sending message with scenario key\"\n}\n[/block]\n\n# Response format \n\nIf successful, response header HTTP status code will be `200 OK` and the message will be sent.\n\nIf you try to send the message without authorization, you will receive an `401 Unauthorized` error .\n\n### OmniResponse\n\n|Parameter|Type|Description|\n|-|-|-|\n|*bulkId*|String|The ID that uniquely identifies the request. Bulk ID will be received only when a message is sent to more than one destination address.|\n|*messages*|[OmniResponseDetails[]](#section-omniresponsedetails)|Array of sent message objects, one object per every message.|\n\n### OmniResponseDetails\n\n|Parameter|Type|Description|\n|-|-|-|\n|*to*|[To](#section-to)|The message destination address.|\n|*status*|[Status](#section-status)|Indicates whether the message is  sent successfully, not sent, delivered, not delivered, waiting for delivery or any other possible status.|\n|*messageId*|String|The ID that uniquely identifies the sent message.|\n\n#### To\n\n|Parameter|Type|Description|\n|-|-|-|\n|*phoneNumber*|String|The message destination phone number.|\n|*emailAddress*|String|The message destination email address.|\n\n\n#### Status\n\n|Parameter|Type|Description|\n|-|-|-|\n|*groupId*|int|Status [group ID](http://dev.infobip.com/v1/docs/response-codes#status-object-example).|\n|*groupName*|String|Status [group name](http://dev.infobip.com/v1/docs/response-codes#status-object-example).|\n|*id*|int|Status [ID](http://dev.infobip.com/v1/docs/response-codes#status-object-example).|\n|*name*|String|Status [name](http://dev.infobip.com/v1/docs/response-codes#status-object-example).|\n|*description*|String|Human readable [description](http://dev.infobip.com/v1/docs/response-codes#status-object-example) of the status.|\n|*action*|String|[Action](http://dev.infobip.com/v1/docs/response-codes#status-object-example) that should be taken to eliminate the error.|\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Additional example\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Send scheduled OMNI message with custom Validity period\"\n}\n[/block]\nYou can schedule your OMNI messages with a predefined date and time.\n\nTo reach the users in a fastest and most effective way define validity periods for each message step. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"scenarioKey\\\": \\\"AD9E01A5DC7BEE2C2B828D208182A611\\\",\\n  \\\"destinations\\\":[ \\n        { \\n          \\\"to\\\":{\\n              \\\"phoneNumber\\\": \\\"41793026727\\\",\\n              \\\"emailAddress\\\": \\\"email@example.com\\\"\\n            }\\n        }\\n    ],\\n  \\\"viber\\\": {\\n    \\t\\\"text\\\": \\\"Viber message is going first.\\\",\\n    \\t\\\"validityPeriod\\\":1\\n  },\\n  \\\"sms\\\": {\\n    \\t\\\"text\\\": \\\"After one minute I'm trying to reach the user on SMS\\\",\\n    \\t\\\"validityPeriod\\\":1\\n  },\\n   \\\"email\\\": {\\n    \\t\\\"text\\\": \\\"Two minutes after the initial message I'm reaching the user on email.\\\",\\n     \\t\\\"subject\\\":\\\"Hey - turn on your mobile phone!\\\",\\n   \\t  \\\"validityPeriod\\\":1\\n  },\\n  \\\"sendAt\\\":\\\"2016-04-26T10:52:15.000+01:00\\\"\\n}\",\n      \"language\": \"json\",\n      \"name\": null\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Result Format\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"HTTP/1.1 200 OK\\nContent-Type: application/json\\n\\n{   \\n    \\\"messages\\\":[   \\n        {   \\n            \\\"to\\\":{\\n              \\\"phoneNumber\\\": \\\"41793026727\\\",\\n              \\\"emailAddress\\\": \\\"email@example.com\\\"\\n            },\\n            \\\"status\\\":{   \\n                \\\"groupId\\\":0,\\n                \\\"groupName\\\":\\\"ACCEPTED\\\",\\n                \\\"id\\\":0,\\n                \\\"name\\\":\\\"MESSAGE_ACCEPTED\\\",\\n                \\\"description\\\":\\\"Message accepted\\\"\\n            },\\n            \\\"messageId\\\":\\\"MESSAGE-ID-123-xyz\\\"\\n        }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","excerpt":"This method allows you to send a message to one or more destination addresses over OMNI channel.","slug":"omni-send-advanced-message","type":"post","title":"OMNI: Send advanced message"}

postOMNI: Send advanced message

This method allows you to send a message to one or more destination addresses over OMNI channel.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

phoneNumber:
required
string
Destination phone number. Addresses must be in international format (Example: `41793026727`).
emailAddress:
string
Destination email address.
messageId:
string
The ID that uniquely identifies the message sent.
bulkId:
string
The ID which uniquely identifies the request. Bulk ID will be received only when you send a message to more than one destination address.
scenarioKey:
string
Scenario key that uniquely identifies the scenario which will be used when sending message. If this field is not set, the default scenario will be used.
sms:
object
SMS specific data. The data will be used if the message is sent through SMS channel.
parseco:
object
Parseco specific data. The data will be used if the message is sent through Parseco channel.
voice:
object
Voice specific data. The data will be used if the message is sent through voice channel.
viber:
object
Viber specific data. The data will be used if the message is sent through Viber channel.
facebook:
object
Facebook Messenger specific data. The data will be used if the message is sent through Facebook channel.
email:
object
Email specific data. The data will be used if the message is sent through email channel.
text:
string
Text of the message that will be sent.
validityPeriod:
string
The message validity period in minutes. When the period expires, the message will be automatically sent using the next OMNI step. Validity period longer than 48h is not supported (in this case, it will be automatically set to 48h).
sendAt:
datetime
Date and time when the message is to be sent. Used for scheduled OMNi messaging (first message in the OMNI flow not sent immediately, but at scheduled time).

Examples


Result Format


Documentation

[block:callout] { "type": "info", "body": "We will attempt to send message over steps defined in given scenario. If sending over first defined step fails, we will attempt to send it over second and so on.", "title": "Sending message with scenario key" } [/block] # Response format If successful, response header HTTP status code will be `200 OK` and the message will be sent. If you try to send the message without authorization, you will receive an `401 Unauthorized` error . ### OmniResponse |Parameter|Type|Description| |-|-|-| |*bulkId*|String|The ID that uniquely identifies the request. Bulk ID will be received only when a message is sent to more than one destination address.| |*messages*|[OmniResponseDetails[]](#section-omniresponsedetails)|Array of sent message objects, one object per every message.| ### OmniResponseDetails |Parameter|Type|Description| |-|-|-| |*to*|[To](#section-to)|The message destination address.| |*status*|[Status](#section-status)|Indicates whether the message is sent successfully, not sent, delivered, not delivered, waiting for delivery or any other possible status.| |*messageId*|String|The ID that uniquely identifies the sent message.| #### To |Parameter|Type|Description| |-|-|-| |*phoneNumber*|String|The message destination phone number.| |*emailAddress*|String|The message destination email address.| #### Status |Parameter|Type|Description| |-|-|-| |*groupId*|int|Status [group ID](http://dev.infobip.com/v1/docs/response-codes#status-object-example).| |*groupName*|String|Status [group name](http://dev.infobip.com/v1/docs/response-codes#status-object-example).| |*id*|int|Status [ID](http://dev.infobip.com/v1/docs/response-codes#status-object-example).| |*name*|String|Status [name](http://dev.infobip.com/v1/docs/response-codes#status-object-example).| |*description*|String|Human readable [description](http://dev.infobip.com/v1/docs/response-codes#status-object-example) of the status.| |*action*|String|[Action](http://dev.infobip.com/v1/docs/response-codes#status-object-example) that should be taken to eliminate the error.| [block:api-header] { "type": "basic", "title": "Additional example" } [/block] [block:api-header] { "type": "basic", "title": "Send scheduled OMNI message with custom Validity period" } [/block] You can schedule your OMNI messages with a predefined date and time. To reach the users in a fastest and most effective way define validity periods for each message step. [block:code] { "codes": [ { "code": "{\n \"scenarioKey\": \"AD9E01A5DC7BEE2C2B828D208182A611\",\n \"destinations\":[ \n { \n \"to\":{\n \"phoneNumber\": \"41793026727\",\n \"emailAddress\": \"email@example.com\"\n }\n }\n ],\n \"viber\": {\n \t\"text\": \"Viber message is going first.\",\n \t\"validityPeriod\":1\n },\n \"sms\": {\n \t\"text\": \"After one minute I'm trying to reach the user on SMS\",\n \t\"validityPeriod\":1\n },\n \"email\": {\n \t\"text\": \"Two minutes after the initial message I'm reaching the user on email.\",\n \t\"subject\":\"Hey - turn on your mobile phone!\",\n \t \"validityPeriod\":1\n },\n \"sendAt\":\"2016-04-26T10:52:15.000+01:00\"\n}", "language": "json", "name": null } ] } [/block] [block:api-header] { "type": "basic", "title": "Result Format" } [/block] [block:code] { "codes": [ { "code": "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{ \n \"messages\":[ \n { \n \"to\":{\n \"phoneNumber\": \"41793026727\",\n \"emailAddress\": \"email@example.com\"\n },\n \"status\":{ \n \"groupId\":0,\n \"groupName\":\"ACCEPTED\",\n \"id\":0,\n \"name\":\"MESSAGE_ACCEPTED\",\n \"description\":\"Message accepted\"\n },\n \"messageId\":\"MESSAGE-ID-123-xyz\"\n }\n}", "language": "json" } ] } [/block]