{"__v":6,"_id":"565327d17d29410d004a0835","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":21,"_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","58b04a023529383900a759b5","58b92d1598157a0f004869bf"],"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-23T14:50:57.486Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"name":"JSON","language":"json","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:::at:::example.com\"\n            }\n        }\n    ],\n    \"text\": \"A long time ago in a galaxy far, far away...\"\n}"},{"code":"POST /omni/1/text HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/xml\n\n\n<request>\n\t<destinations>\n  \t<destination>\n\t\t\t<to>\n        <phoneNumber>41793026727</phoneNumber>\n        <emailAddress>email@example.com</emailAddress>\n      </to>\n\t\t</destination>\n  </destinations>\n\t<text>A long time ago in a galaxy far, far away...</text>\n</request>","language":"xml"}]},"method":"post","results":{"codes":[{"name":"OK - JSON","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\":\"4242f196ba50-a356-2f91-831c4aa55f351ed2\"\n        }\n    ]\n}","language":"json","status":200},{"code":"HTTP/1.1 200 OK\nContent-Type: application/xml\n\n<omniResponse>\n\t<messages>\n  \t<message>\n\t\t\t<to>\n        <phoneNumber>41793026727</phoneNumber>\n        <emailAddress>email@example.com</emailAddress>\n      </to>\n      <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>4242f196ba50-a356-2f91-831c4aa55f351ed2</messageId>\n\t\t</message>\n  </messages>\n</omniResponse>","language":"xml","status":200,"name":"OK - XML"}]},"settings":"554860d6d2c8410d006c215e","auth":"required","params":[{"_id":"565327d17d29410d004a0839","ref":"","in":"body","required":true,"desc":"Destination phone number. Phone numbers must be in international format (Example: `41793026727`).","default":"","type":"string","name":"phoneNumber"},{"_id":"56fbe7364c3cea190015d9f2","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.","default":"","type":"string","name":"scenarioKey"},{"_id":"565327d17d29410d004a0836","ref":"","in":"body","required":false,"desc":"Text of the message that will be sent.","default":"","type":"string","name":"text"},{"_id":"56fbe7714c3cea190015d9f3","ref":"","in":"body","required":false,"desc":"Email subject","default":"","type":"string","name":"mailSubject"}],"url":"/omni/:version/text"},"isReference":true,"order":4,"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# 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# Send multiple messages with specific scenario key\n\n**Request**\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            \\\"messageId\\\":\\\"MESSAGE-ID-123-xyz\\\",\\n            \\\"to\\\":{\\n              \\\"phoneNumber\\\": \\\"41793026727\\\",\\n              \\\"emailAddress\\\": \\\"email@example.com\\\"\\n            }\\n        },\\n        { \\n            \\\"to\\\":{\\n              \\\"phoneNumber\\\": \\\"41793026731\\\"\\n            }\\n        }\\n    ],\\n    \\\"bulkId\\\":\\\"Bulk-ID-12xyz\\\",\\n    \\\"scenarioKey\\\":\\\"AD9E01A5DC7BEE2C2B828D208182A611\\\",\\n    \\\"text\\\": \\\"Failover text\\\",\\n    \\\"mailSubject\\\": \\\"Email subject\\\"\\n}\",\n      \"language\": \"json\"\n    },\n    {\n      \"code\": \"POST /omni/1/text HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nContent-Type: application/xml\\n\\n\\n<request>\\n\\t<destinations>\\n  \\t<destination>\\n\\t\\t\\t<messageId>MESSAGE-ID-123-xyz</messageId>\\n\\t\\t\\t<to>\\n        <phoneNumber>41793026727</phoneNumber>\\n        <emailAddress>email@example.com</emailAddress>\\n      </to>\\n\\t\\t</destination>\\n\\t\\t<destination>\\n\\t\\t\\t<to>\\n        <phoneNumber>41793026731</phoneNumber>\\n      </to>\\n\\t\\t</destinations>\\n  </destinations>\\n\\t<bulkId>Bulk-ID-12xyz</bulkId>\\n\\t<scenarioKey>AD9E01A5DC7BEE2C2B828D208182A611</scenarioKey>\\n\\t<text>Failover text</text>\\n  <mailSubject>Email subject</mailSubject>\\n</request>\",\n      \"language\": \"xml\"\n    },\n    {\n      \"code\": \"curl -X POST \\n-H \\\"Content-Type: application/json\\\"  \\\\\\n-H \\\"Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ\\\"  \\\\\\n-d '{ \\n    \\\"destinations\\\":[ \\n        { \\n            \\\"messageId\\\":\\\"MESSAGE-ID-123-xyz\\\",\\n            \\\"to\\\":{\\n              \\\"phoneNumber\\\": \\\"41793026727\\\",\\n              \\\"emailAddress\\\": \\\"email@example.com\\\"\\n            }\\n        },\\n        { \\n            \\\"to\\\":{\\n              \\\"phoneNumber\\\": \\\"41793026731\\\"\\n            }\\n        }\\n    ],\\n    \\\"bulkId\\\":\\\"Bulk-ID-12xyz\\\",\\n    \\\"scenarioKey\\\":\\\"AD9E01A5DC7BEE2C2B828D208182A611\\\",\\n    \\\"text\\\": \\\"Failover text\\\",\\n    \\\"mailSubject\\\": \\\"Email subject\\\"\\n}' https://api.infobip.com/1/omni/1/text'\",\n      \"language\": \"curl\"\n    },\n    {\n      \"code\": \"<?php\\n\\n$curl = curl_init();\\n\\ncurl_setopt_array($curl, array(\\n  CURLOPT_URL => \\\"http://api.infobip.com/omni/1/text\\\",\\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 => \\\"{ \\\\\\\"destinations\\\\\\\":[ { \\\\\\\"messageId\\\\\\\":\\\\\\\"MESSAGE-ID-123-xyz\\\\\\\", \\\\\\\"to\\\\\\\":{ \\\\\\\"phoneNumber\\\\\\\": \\\\\\\"41793026727\\\\\\\", \\\\\\\"emailAddress\\\\\\\": \\\\\\\"email@example.com\\\\\\\" } }, { \\\\\\\"to\\\\\\\":{ \\\\\\\"phoneNumber\\\\\\\": \\\\\\\"41793026731\\\\\\\" } } ], \\\\\\\"bulkId\\\\\\\":\\\\\\\"Bulk-ID-12xyz\\\\\\\", \\\\\\\"scenarioKey\\\\\\\":\\\\\\\"AD9E01A5DC7BEE2C2B828D208182A611\\\\\\\", \\\\\\\"text\\\\\\\": \\\\\\\"Failover text\\\\\\\", \\\\\\\"mailSubject\\\\\\\": \\\\\\\"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}\",\n      \"language\": \"php\"\n    },\n    {\n      \"code\": \"require 'uri'\\nrequire 'net/http'\\n\\nurl = URI(\\\"https://api.infobip.com/1/omni/1/text\\\")\\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\\\"] = '4f2fb75b-3e6a-159e-34e7-78cb8d8e7a9c'\\nrequest.body = \\\"{ \\\\n    \\\\\\\"destinations\\\\\\\":[ \\\\n        { \\\\n            \\\\\\\"messageId\\\\\\\":\\\\\\\"MESSAGE-ID-123-xyz\\\\\\\",\\\\n            \\\\\\\"to\\\\\\\":{\\\\n              \\\\\\\"phoneNumber\\\\\\\": \\\\\\\"41793026727\\\\\\\",\\\\n              \\\\\\\"emailAddress\\\\\\\": \\\\\\\"email@example.com\\\\\\\"\\\\n            }\\\\n        },\\\\n        { \\\\n            \\\\\\\"to\\\\\\\":{\\\\n              \\\\\\\"phoneNumber\\\\\\\": \\\\\\\"41793026731\\\\\\\"\\\\n            }\\\\n        }\\\\n    ],\\\\n    \\\\\\\"bulkId\\\\\\\":\\\\\\\"Bulk-ID-12xyz\\\\\\\",\\\\n    \\\\\\\"scenarioKey\\\\\\\":\\\\\\\"AD9E01A5DC7BEE2C2B828D208182A611\\\\\\\",\\\\n    \\\\\\\"text\\\\\\\": \\\\\\\"Failover text\\\\\\\",\\\\n    \\\\\\\"mailSubject\\\\\\\": \\\\\\\"Email subject\\\\\\\"\\\\n}\\\"\\n\\nresponse = http.request(request)\\nputs response.read_body\",\n      \"language\": \"ruby\"\n    },\n    {\n      \"code\": \"import http.client\\n\\nconn = http.client.HTTPSConnection(\\\"api.infobip.com\\\")\\n\\npayload = \\\"{ \\\\n    \\\\\\\"destinations\\\\\\\":[ \\\\n        { \\\\n            \\\\\\\"messageId\\\\\\\":\\\\\\\"MESSAGE-ID-123-xyz\\\\\\\",\\\\n            \\\\\\\"to\\\\\\\":{\\\\n              \\\\\\\"phoneNumber\\\\\\\": \\\\\\\"41793026727\\\\\\\",\\\\n              \\\\\\\"emailAddress\\\\\\\": \\\\\\\"email@example.com\\\\\\\"\\\\n            }\\\\n        },\\\\n        { \\\\n            \\\\\\\"to\\\\\\\":{\\\\n              \\\\\\\"phoneNumber\\\\\\\": \\\\\\\"41793026731\\\\\\\"\\\\n            }\\\\n        }\\\\n    ],\\\\n    \\\\\\\"bulkId\\\\\\\":\\\\\\\"Bulk-ID-12xyz\\\\\\\",\\\\n    \\\\\\\"scenarioKey\\\\\\\":\\\\\\\"AD9E01A5DC7BEE2C2B828D208182A611\\\\\\\",\\\\n    \\\\\\\"text\\\\\\\": \\\\\\\"Failover text\\\\\\\",\\\\n    \\\\\\\"mailSubject\\\\\\\": \\\\\\\"Email subject\\\\\\\"\\\\n}\\\"\\n\\nheaders = {\\n    'content-type': \\\"application/json\\\",\\n    'authorization': \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ\\\"\\n    }\\n\\nconn.request(\\\"POST\\\", \\\"/1/omni/1/text\\\", payload, headers)\\n\\nres = conn.getresponse()\\ndata = res.read()\\n\\nprint(data.decode(\\\"utf-8\\\"))\",\n      \"language\": \"python\"\n    },\n    {\n      \"code\": \"HttpResponse<String> response = Unirest.post(\\\"https://api.infobip.com/1/omni/1/text\\\")\\n  .header(\\\"content-type\\\", \\\"application/json\\\")\\n  .header(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ\\\")\\n  .body(\\\"{ \\\\n    \\\\\\\"destinations\\\\\\\":[ \\\\n        { \\\\n            \\\\\\\"messageId\\\\\\\":\\\\\\\"MESSAGE-ID-123-xyz\\\\\\\",\\\\n            \\\\\\\"to\\\\\\\":{\\\\n              \\\\\\\"phoneNumber\\\\\\\": \\\\\\\"41793026727\\\\\\\",\\\\n              \\\\\\\"emailAddress\\\\\\\": \\\\\\\"email@example.com\\\\\\\"\\\\n            }\\\\n        },\\\\n        { \\\\n            \\\\\\\"to\\\\\\\":{\\\\n              \\\\\\\"phoneNumber\\\\\\\": \\\\\\\"41793026731\\\\\\\"\\\\n            }\\\\n        }\\\\n    ],\\\\n    \\\\\\\"bulkId\\\\\\\":\\\\\\\"Bulk-ID-12xyz\\\\\\\",\\\\n    \\\\\\\"scenarioKey\\\\\\\":\\\\\\\"AD9E01A5DC7BEE2C2B828D208182A611\\\\\\\",\\\\n    \\\\\\\"text\\\\\\\": \\\\\\\"Failover text\\\\\\\",\\\\n    \\\\\\\"mailSubject\\\\\\\": \\\\\\\"Email subject\\\\\\\"\\\\n}\\\")\\n  .asString();\",\n      \"language\": \"java\"\n    },\n    {\n      \"code\": \"var client = new RestClient(\\\"https://api.infobip.com/1/omni/1/text\\\");\\nvar request = new RestRequest(Method.POST);\\nrequest.AddHeader(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ\\\");\\nrequest.AddHeader(\\\"content-type\\\", \\\"application/json\\\");\\nrequest.AddParameter(\\\"application/json\\\", \\\"{ \\\\n    \\\\\\\"destinations\\\\\\\":[ \\\\n        { \\\\n            \\\\\\\"messageId\\\\\\\":\\\\\\\"MESSAGE-ID-123-xyz\\\\\\\",\\\\n            \\\\\\\"to\\\\\\\":{\\\\n              \\\\\\\"phoneNumber\\\\\\\": \\\\\\\"41793026727\\\\\\\",\\\\n              \\\\\\\"emailAddress\\\\\\\": \\\\\\\"email@example.com\\\\\\\"\\\\n            }\\\\n        },\\\\n        { \\\\n            \\\\\\\"to\\\\\\\":{\\\\n              \\\\\\\"phoneNumber\\\\\\\": \\\\\\\"41793026731\\\\\\\"\\\\n            }\\\\n        }\\\\n    ],\\\\n    \\\\\\\"bulkId\\\\\\\":\\\\\\\"Bulk-ID-12xyz\\\\\\\",\\\\n    \\\\\\\"scenarioKey\\\\\\\":\\\\\\\"AD9E01A5DC7BEE2C2B828D208182A611\\\\\\\",\\\\n    \\\\\\\"text\\\\\\\": \\\\\\\"Failover text\\\\\\\",\\\\n    \\\\\\\"mailSubject\\\\\\\": \\\\\\\"Email subject\\\\\\\"\\\\n}\\\", ParameterType.RequestBody);\\nIRestResponse response = client.Execute(request);\",\n      \"language\": \"csharp\"\n    },\n    {\n      \"code\": \"var data = JSON.stringify({\\n  \\\"destinations\\\": [\\n    {\\n      \\\"messageId\\\": \\\"MESSAGE-ID-123-xyz\\\",\\n      \\\"to\\\": {\\n        \\\"phoneNumber\\\": \\\"41793026727\\\",\\n        \\\"emailAddress\\\": \\\"email@example.com\\\"\\n      }\\n    },\\n    {\\n      \\\"to\\\": {\\n        \\\"phoneNumber\\\": \\\"41793026731\\\"\\n      }\\n    }\\n  ],\\n  \\\"bulkId\\\": \\\"Bulk-ID-12xyz\\\",\\n  \\\"scenarioKey\\\": \\\"AD9E01A5DC7BEE2C2B828D208182A611\\\",\\n  \\\"text\\\": \\\"Failover text\\\",\\n  \\\"mailSubject\\\": \\\"Email subject\\\"\\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/1/omni/1/text\\\");\\nxhr.setRequestHeader(\\\"content-type\\\", \\\"application/json\\\");\\nxhr.setRequestHeader(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ\\\");\\n\\nxhr.send(data);\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n**Response**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"HTTP/1.1 200 OK\\nContent-Type: application/json\\n\\n{   \\n  \\t\\\"bulkId\\\": \\\"Bulk-ID-12xyz\\\",\\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      \\t{   \\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}\",\n      \"language\": \"json\",\n      \"name\": \"200 OK - JSON\"\n    },\n    {\n      \"code\": \"HTTP/1.1 200 OK\\nContent-Type: application/xml\\n\\n<omniResponse>\\n\\t<bulkId>Bulk-ID-12xyz</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>\",\n      \"language\": \"xml\",\n      \"name\": \"200 OK - XML\"\n    }\n  ]\n}\n[/block]","excerpt":"This method allows you to send a single message to one or more destination addresses over OMNI channel.","slug":"omni-send-simple-message","type":"endpoint","title":"OMNI: Send simple message"}

postOMNI: Send simple message

This method allows you to send a single 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. Phone numbers 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.
text:
string
Text of the message that will be sent.
mailSubject:
string
Email subject

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] # Send multiple messages with specific scenario key **Request** [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 \"messageId\":\"MESSAGE-ID-123-xyz\",\n \"to\":{\n \"phoneNumber\": \"41793026727\",\n \"emailAddress\": \"email@example.com\"\n }\n },\n { \n \"to\":{\n \"phoneNumber\": \"41793026731\"\n }\n }\n ],\n \"bulkId\":\"Bulk-ID-12xyz\",\n \"scenarioKey\":\"AD9E01A5DC7BEE2C2B828D208182A611\",\n \"text\": \"Failover text\",\n \"mailSubject\": \"Email subject\"\n}", "language": "json" }, { "code": "POST /omni/1/text HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/xml\n\n\n<request>\n\t<destinations>\n \t<destination>\n\t\t\t<messageId>MESSAGE-ID-123-xyz</messageId>\n\t\t\t<to>\n <phoneNumber>41793026727</phoneNumber>\n <emailAddress>email@example.com</emailAddress>\n </to>\n\t\t</destination>\n\t\t<destination>\n\t\t\t<to>\n <phoneNumber>41793026731</phoneNumber>\n </to>\n\t\t</destinations>\n </destinations>\n\t<bulkId>Bulk-ID-12xyz</bulkId>\n\t<scenarioKey>AD9E01A5DC7BEE2C2B828D208182A611</scenarioKey>\n\t<text>Failover text</text>\n <mailSubject>Email subject</mailSubject>\n</request>", "language": "xml" }, { "code": "curl -X POST \n-H \"Content-Type: application/json\" \\\n-H \"Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ\" \\\n-d '{ \n \"destinations\":[ \n { \n \"messageId\":\"MESSAGE-ID-123-xyz\",\n \"to\":{\n \"phoneNumber\": \"41793026727\",\n \"emailAddress\": \"email@example.com\"\n }\n },\n { \n \"to\":{\n \"phoneNumber\": \"41793026731\"\n }\n }\n ],\n \"bulkId\":\"Bulk-ID-12xyz\",\n \"scenarioKey\":\"AD9E01A5DC7BEE2C2B828D208182A611\",\n \"text\": \"Failover text\",\n \"mailSubject\": \"Email subject\"\n}' https://api.infobip.com/1/omni/1/text'", "language": "curl" }, { "code": "<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, array(\n CURLOPT_URL => \"http://api.infobip.com/omni/1/text\",\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 => \"{ \\\"destinations\\\":[ { \\\"messageId\\\":\\\"MESSAGE-ID-123-xyz\\\", \\\"to\\\":{ \\\"phoneNumber\\\": \\\"41793026727\\\", \\\"emailAddress\\\": \\\"email@example.com\\\" } }, { \\\"to\\\":{ \\\"phoneNumber\\\": \\\"41793026731\\\" } } ], \\\"bulkId\\\":\\\"Bulk-ID-12xyz\\\", \\\"scenarioKey\\\":\\\"AD9E01A5DC7BEE2C2B828D208182A611\\\", \\\"text\\\": \\\"Failover text\\\", \\\"mailSubject\\\": \\\"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/1/omni/1/text\")\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\"] = '4f2fb75b-3e6a-159e-34e7-78cb8d8e7a9c'\nrequest.body = \"{ \\n \\\"destinations\\\":[ \\n { \\n \\\"messageId\\\":\\\"MESSAGE-ID-123-xyz\\\",\\n \\\"to\\\":{\\n \\\"phoneNumber\\\": \\\"41793026727\\\",\\n \\\"emailAddress\\\": \\\"email@example.com\\\"\\n }\\n },\\n { \\n \\\"to\\\":{\\n \\\"phoneNumber\\\": \\\"41793026731\\\"\\n }\\n }\\n ],\\n \\\"bulkId\\\":\\\"Bulk-ID-12xyz\\\",\\n \\\"scenarioKey\\\":\\\"AD9E01A5DC7BEE2C2B828D208182A611\\\",\\n \\\"text\\\": \\\"Failover text\\\",\\n \\\"mailSubject\\\": \\\"Email subject\\\"\\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 \\\"destinations\\\":[ \\n { \\n \\\"messageId\\\":\\\"MESSAGE-ID-123-xyz\\\",\\n \\\"to\\\":{\\n \\\"phoneNumber\\\": \\\"41793026727\\\",\\n \\\"emailAddress\\\": \\\"email@example.com\\\"\\n }\\n },\\n { \\n \\\"to\\\":{\\n \\\"phoneNumber\\\": \\\"41793026731\\\"\\n }\\n }\\n ],\\n \\\"bulkId\\\":\\\"Bulk-ID-12xyz\\\",\\n \\\"scenarioKey\\\":\\\"AD9E01A5DC7BEE2C2B828D208182A611\\\",\\n \\\"text\\\": \\\"Failover text\\\",\\n \\\"mailSubject\\\": \\\"Email subject\\\"\\n}\"\n\nheaders = {\n 'content-type': \"application/json\",\n 'authorization': \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ\"\n }\n\nconn.request(\"POST\", \"/1/omni/1/text\", 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/1/omni/1/text\")\n .header(\"content-type\", \"application/json\")\n .header(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ\")\n .body(\"{ \\n \\\"destinations\\\":[ \\n { \\n \\\"messageId\\\":\\\"MESSAGE-ID-123-xyz\\\",\\n \\\"to\\\":{\\n \\\"phoneNumber\\\": \\\"41793026727\\\",\\n \\\"emailAddress\\\": \\\"email@example.com\\\"\\n }\\n },\\n { \\n \\\"to\\\":{\\n \\\"phoneNumber\\\": \\\"41793026731\\\"\\n }\\n }\\n ],\\n \\\"bulkId\\\":\\\"Bulk-ID-12xyz\\\",\\n \\\"scenarioKey\\\":\\\"AD9E01A5DC7BEE2C2B828D208182A611\\\",\\n \\\"text\\\": \\\"Failover text\\\",\\n \\\"mailSubject\\\": \\\"Email subject\\\"\\n}\")\n .asString();", "language": "java" }, { "code": "var client = new RestClient(\"https://api.infobip.com/1/omni/1/text\");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ\");\nrequest.AddHeader(\"content-type\", \"application/json\");\nrequest.AddParameter(\"application/json\", \"{ \\n \\\"destinations\\\":[ \\n { \\n \\\"messageId\\\":\\\"MESSAGE-ID-123-xyz\\\",\\n \\\"to\\\":{\\n \\\"phoneNumber\\\": \\\"41793026727\\\",\\n \\\"emailAddress\\\": \\\"email@example.com\\\"\\n }\\n },\\n { \\n \\\"to\\\":{\\n \\\"phoneNumber\\\": \\\"41793026731\\\"\\n }\\n }\\n ],\\n \\\"bulkId\\\":\\\"Bulk-ID-12xyz\\\",\\n \\\"scenarioKey\\\":\\\"AD9E01A5DC7BEE2C2B828D208182A611\\\",\\n \\\"text\\\": \\\"Failover text\\\",\\n \\\"mailSubject\\\": \\\"Email subject\\\"\\n}\", ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);", "language": "csharp" }, { "code": "var data = JSON.stringify({\n \"destinations\": [\n {\n \"messageId\": \"MESSAGE-ID-123-xyz\",\n \"to\": {\n \"phoneNumber\": \"41793026727\",\n \"emailAddress\": \"email@example.com\"\n }\n },\n {\n \"to\": {\n \"phoneNumber\": \"41793026731\"\n }\n }\n ],\n \"bulkId\": \"Bulk-ID-12xyz\",\n \"scenarioKey\": \"AD9E01A5DC7BEE2C2B828D208182A611\",\n \"text\": \"Failover text\",\n \"mailSubject\": \"Email subject\"\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/1/omni/1/text\");\nxhr.setRequestHeader(\"content-type\", \"application/json\");\nxhr.setRequestHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ\");\n\nxhr.send(data);", "language": "javascript" } ] } [/block] **Response** [block:code] { "codes": [ { "code": "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{ \n \t\"bulkId\": \"Bulk-ID-12xyz\",\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 \t{ \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}", "language": "json", "name": "200 OK - JSON" }, { "code": "HTTP/1.1 200 OK\nContent-Type: application/xml\n\n<omniResponse>\n\t<bulkId>Bulk-ID-12xyz</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>", "language": "xml", "name": "200 OK - XML" } ] } [/block]