{"_id":"5655c7c0a66be71700968dd7","project":"54eb50e5615ffc1900305a16","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"},"user":"54eb4fdedf7add210007b29b","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":5,"parentDoc":null,"editedParams2":true,"editedParams":true,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-11-25T14:37:52.303Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"name":"","code":"GET /omni/1/scenarios/CD265875E3A6EA43478D5F37A635BE4A HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/json","language":"json"},{"code":"GET /omni/1/scenarios/CD265875E3A6EA43478D5F37A635BE4A HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/xml","language":"xml","name":"XML"},{"code":"curl -X GET\n-H 'Accept: application/json'  \n-H 'Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='\nhttps://api.infobip.com/omni/1/scenarios/CD265875E3A6EA43478D5F37A635BE4A ","language":"curl","name":"cURL"},{"name":"PHP","code":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, array(\n  CURLOPT_URL => \"http://api.infobip.com/omni/1/scenarios/CD265875E3A6EA43478D5F37A635BE4A\",\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 => \"GET\",\n  CURLOPT_POSTFIELDS => \"\",\n  CURLOPT_HTTPHEADER => array(\n    \"accept: application/json\",\n    \"authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\"\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"},{"language":"ruby","name":"Ruby","code":"require 'uri'\nrequire 'net/http'\n\nurl = URI(\"https://api.infobip.com/omni/1/scenarios/CD265875E3A6EA43478D5F37A635BE4A\")\n\nhttp = Net::HTTP.new(url.host, url.port)\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"authorization\"] = 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='\nrequest[\"accept\"] = 'application/json'\n\nresponse = http.request(request)\nputs response.read_body"},{"code":"import http.client\n\nconn = http.client.HTTPConnection(\"api.infobip.com\")\n\nheaders = {\n    'authorization': \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\",\n    'accept': \"application/json\"\n    }\n\nconn.request(\"GET\", \"/omni/1/scenarios/CD265875E3A6EA43478D5F37A635BE4A\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))","language":"python","name":"Python"},{"code":"HttpResponse<String> response = Unirest.get(\"https://api.infobip.com/omni/1/scenarios/CD265875E3A6EA43478D5F37A635BE4A\")\n  .header(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\")\n  .header(\"accept\", \"application/json\")\n  .asString();","language":"java","name":"Java"},{"code":"var client = new RestClient(\"https://api.infobip.com/omni/1/scenarios/CD265875E3A6EA43478D5F37A635BE4A\");\n\nvar request = new RestRequest(Method.GET);\nrequest.AddHeader(\"accept\", \"application/json\");\nrequest.AddHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\");\n\nIRestResponse response = client.Execute(request);","language":"csharp","name":"C#"},{"name":"JavaScript","code":"var data = null;\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(\"GET\", \"https://api.infobip.com/omni/1/scenarios/CD265875E3A6EA43478D5F37A635BE4A\");\nxhr.setRequestHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\");\nxhr.setRequestHeader(\"accept\", \"application/json\");\n\nxhr.send(data);","language":"javascript"}]},"method":"get","results":{"codes":[{"name":"OK - JSON","code":"{\n  \"key\": \"CD265875E3A6EA43478D5F37A635BE4A\",\n  \"name\":\"Test SMS or Viber\",\n  \"flow\": [\n    {\n      \"from\": \"InfoSMS\",\n      \"channel\": \"SMS\"\n    },\n    {\n      \"from\": \"3045\",\n      \"channel\": \"VIBER\"\n    }\n  ],\n  \"default\": false\n}","language":"json","status":200},{"name":"OK - XML","code":"<scenario>\n    <key>CD265875E3A6EA43478D5F37A635BE4A</key>\n    <name>Test SMS or Viber</name>\n    <flow>\n        <step>\n            <from>InfoSMS</from>\n            <channel>SMS</channel>\n        </step>\n        <step>\n            <from>3045</from>\n            <channel>VIBER</channel>\n        </step>\n    </flow>\n    <default>false</default>\n</scenario>","language":"xml","status":200},{"name":"Invalid argument","status":400,"language":"json","code":"{\n  \"requestError\": {\n    \"serviceException\": {\n      \"messageId\": \"INVALID_ARGUMENT\",\n      \"text\": \"Invalid argument\"\n    }\n  }\n}"},{"language":"json","status":404,"code":"{\n  \"requestError\": {\n    \"serviceException\": {\n      \"messageId\": \"NOT_FOUND\",\n      \"text\": \"Scenario not found.\"\n    }\n  }\n}"}]},"settings":"","auth":"required","params":[{"_id":"5655bcf8dd82540d00278c27","ref":"","in":"path","required":false,"desc":"Key used to uniquely identify OMNI scenario.","default":"","type":"string","name":"key"},{"_id":"56615d9d166da20d00d8c6de","ref":"","in":"query","required":false,"desc":"Get default scenario.","default":"","type":"boolean","name":"default"},{"_id":"5a1442ea729c3f0034442ede","ref":"","in":"query","required":false,"desc":"OMNI scenarios page to return. This parameter is zero-based, so requesting page 0 will return the first page.","default":"0","type":"int","name":"page"},{"_id":"5a1442ea729c3f0034442edd","ref":"","in":"query","required":false,"desc":"Maximal number of OMNI scenarios to return in a single page.","default":"100","type":"int","name":"limit"}],"url":"/omni/:version/scenarios/:key"},"isReference":true,"order":2,"body":"# Response format \n\nIf successful, the response header HTTP status code will be `200 OK` and the requested scenario will be returned.\n\nIf you try to get the scenario without authorization, you will receive an `401 Unauthorized` error.\n\n### Scenario\n\n|Parameter|Type|Description|\n|-|-|-|\n|*key*|String|Key used to uniquely identify OMNI scenario.|\n|*name*|String|OMNI scenario name.|\n|*flow*|[Step](#section-step)|Sender used in OMNI scenario's step for sending message.|\n|*default*|Boolean|Whether scenario is default.\n\n### Step\n\n|Parameter|Type|Description|\n|-|-|-|\n|*from*|String|Sender used in OMNI scenario's step for sending message.|\n|*channel*|String|Channel used in scenario's step for delivering message (\"`SMS`\", `\"VOICE\"`, \"`VIBER`\")|\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Additional example\"\n}\n[/block]\n# Get all scenarios\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"\",\n  \"body\": \"If **all** scenarios are wanted, **key** parameter must be omitted.\"\n}\n[/block]\n**Request**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"GET /omni/1/scenarios HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nContent-Type: application/json\",\n      \"language\": \"json\"\n    },\n    {\n      \"code\": \"GET /omni/1/scenarios HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nContent-Type: application/xml\",\n      \"language\": \"xml\"\n    },\n    {\n      \"code\": \"curl -X GET\\n-H 'Accept: application/json'  \\n-H 'Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='\\nhttps://api.infobip.com/omni/1/scenarios\",\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/scenarios\\\",\\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 => \\\"GET\\\",\\n  CURLOPT_POSTFIELDS => \\\"\\\",\\n  CURLOPT_HTTPHEADER => array(\\n    \\\"accept: application/json\\\",\\n    \\\"authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\"\\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/omni/1/scenarios\\\")\\n\\nhttp = Net::HTTP.new(url.host, url.port)\\n\\nrequest = Net::HTTP::Get.new(url)\\nrequest[\\\"authorization\\\"] = 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='\\nrequest[\\\"accept\\\"] = 'application/json'\\n\\nresponse = http.request(request)\\nputs response.read_body\",\n      \"language\": \"ruby\"\n    },\n    {\n      \"code\": \"import http.client\\n\\nconn = http.client.HTTPConnection(\\\"api.infobip.com\\\")\\n\\nheaders = {\\n    'authorization': \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\",\\n    'accept': \\\"application/json\\\"\\n    }\\n\\nconn.request(\\\"GET\\\", \\\"/omni/1/scenarios\\\", headers=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.get(\\\"https://api.infobip.com/omni/1/scenarios\\\")\\n  .header(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\")\\n  .header(\\\"accept\\\", \\\"application/json\\\")\\n  .asString();\",\n      \"language\": \"java\"\n    },\n    {\n      \"code\": \"var client = new RestClient(\\\"https://api.infobip.com/omni/1/scenarios\\\");\\n\\nvar request = new RestRequest(Method.GET);\\nrequest.AddHeader(\\\"accept\\\", \\\"application/json\\\");\\nrequest.AddHeader(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\");\\n\\nIRestResponse response = client.Execute(request);\",\n      \"language\": \"csharp\"\n    },\n    {\n      \"code\": \"var data = null;\\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(\\\"GET\\\", \\\"https://api.infobip.com/omni/1/scenarios\\\");\\nxhr.setRequestHeader(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\");\\nxhr.setRequestHeader(\\\"accept\\\", \\\"application/json\\\");\\n\\nxhr.send(data);\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n**Response**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"scenarios\\\": [\\n    {\\n      \\\"key\\\": \\\"CD265875E3A6EA43478D5F37A635BE4A\\\",\\n      \\\"name\\\": \\\"Test SMS or Viber\\\",\\n      \\\"flow\\\": [\\n        {\\n          \\\"from\\\": \\\"InfoSMS\\\",\\n          \\\"channel\\\": \\\"SMS\\\"\\n        },\\n        {\\n          \\\"from\\\": \\\"3045\\\",\\n          \\\"channel\\\": \\\"VIBER\\\"\\n        }\\n      ],\\n      \\\"default\\\": false\\n    },\\n    {\\n      \\\"key\\\": \\\"37B93A3C58EAAF4D2B1B35B58526EAAC\\\",\\n      \\\"name\\\": \\\"New scenario\\\",\\n      \\\"flow\\\": [\\n        {\\n          \\\"from\\\": \\\"TestSender\\\",\\n          \\\"channel\\\": \\\"SMS\\\"\\n        },\\n        {\\n          \\\"from\\\": \\\"3045\\\",\\n          \\\"channel\\\": \\\"VIBER\\\"\\n        }\\n      ],\\n      \\\"default\\\": true\\n    }\\n  ]\\n}\",\n      \"language\": \"json\",\n      \"name\": \"200 OK - JSON\"\n    },\n    {\n      \"code\": \"<scenariosResponse>\\n    <scenarios>\\n        <scenario>\\n            <key>CD265875E3A6EA43478D5F37A635BE4A</key>\\n            <name>Test SMS or Viber</name>\\n            <flow>\\n                <step>\\n                    <from>InfoSMS</from>\\n                    <channel>SMS</channel>\\n                </step>\\n                <step>\\n                    <from>3045</from>\\n                    <channel>VIBER</channel>\\n                </step>\\n            </flow>\\n            <default>false</default>\\n        </scenario>\\n        <scenario>\\n            <key>37B93A3C58EAAF4D2B1B35B58526EAAC</key>\\n            <name>New scenario</name>\\n            <flow>\\n                <step>\\n                    <from>TestSender</from>\\n                    <channel>SMS</channel>\\n                </step>\\n                <step>\\n                    <from>3045</from>\\n                    <channel>VIBER</channel>\\n                </step>\\n            </flow>\\n            <default>true</default>\\n        </scenario>\\n    </scenarios>\\n</scenariosResponse>\",\n      \"language\": \"xml\",\n      \"name\": \"200 OK - XML\"\n    },\n    {\n      \"code\": \"{\\n  \\\"requestError\\\": {\\n    \\\"serviceException\\\": {\\n      \\\"messageId\\\": \\\"INVALID_ARGUMENT\\\",\\n      \\\"text\\\": \\\"Invalid argument\\\"\\n    }\\n  }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"400 Invalid argument\"\n    }\n  ]\n}\n[/block]\n## Response format \n\nIf successful, the response header HTTP status code will be `200 OK` and all scenarios will be returned.\n\nIf you try to get the scenarios without authorization, you will receive a `401 Unauthorized` error.\n\n### ScenariosResponse\n|Parameter|Type|Description|\n|-|-|-|\n|*scenarios*|[Scenario](#section-scenario)|Array of OMNI scenarios.|\n\n# Get default scenario\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Caution!\",\n  \"body\": \"Usage of the **default** and **key** parameter is **exclusive**. With the *key* **path** parameter, a specific scenario is returned, but with the *default* **query** parameter, the default scenario is returned.\"\n}\n[/block]\n**Request**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"GET /omni/1/scenarios?default=true HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nContent-Type: application/json\",\n      \"language\": \"json\"\n    },\n    {\n      \"code\": \"GET /omni/1/scenarios?default=true HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nContent-Type: application/xml\",\n      \"language\": \"xml\"\n    },\n    {\n      \"code\": \"curl -X GET\\n-H 'Accept: application/json'  \\n-H 'Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='\\nhttps://api.infobip.com/omni/1/scenarios?default=true\",\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/scenarios?default=true\\\",\\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 => \\\"GET\\\",\\n  CURLOPT_POSTFIELDS => \\\"\\\",\\n  CURLOPT_HTTPHEADER => array(\\n    \\\"accept: application/json\\\",\\n    \\\"authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\"\\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/omni/1/scenarios?default=true\\\")\\n\\nhttp = Net::HTTP.new(url.host, url.port)\\n\\nrequest = Net::HTTP::Get.new(url)\\nrequest[\\\"authorization\\\"] = 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='\\nrequest[\\\"accept\\\"] = 'application/json'\\n\\nresponse = http.request(request)\\nputs response.read_body\",\n      \"language\": \"ruby\"\n    },\n    {\n      \"code\": \"import http.client\\n\\nconn = http.client.HTTPConnection(\\\"api.infobip.com\\\")\\n\\nheaders = {\\n    'authorization': \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\",\\n    'accept': \\\"application/json\\\"\\n    }\\n\\nconn.request(\\\"GET\\\", \\\"/omni/1/scenarios?default=true\\\", headers=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.get(\\\"https://api.infobip.com/omni/1/scenarios?default=true\\\")\\n  .header(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\")\\n  .header(\\\"accept\\\", \\\"application/json\\\")\\n  .asString();\",\n      \"language\": \"java\"\n    },\n    {\n      \"code\": \"var client = new RestClient(\\\"https://api.infobip.com/omni/1/scenarios?default=true\\\");\\n\\nvar request = new RestRequest(Method.GET);\\nrequest.AddHeader(\\\"accept\\\", \\\"application/json\\\");\\nrequest.AddHeader(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\");\\n\\nIRestResponse response = client.Execute(request);\",\n      \"language\": \"csharp\"\n    },\n    {\n      \"code\": \"var data = null;\\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(\\\"GET\\\", \\\"https://api.infobip.com/omni/1/scenarios?default=true\\\");\\nxhr.setRequestHeader(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\");\\nxhr.setRequestHeader(\\\"accept\\\", \\\"application/json\\\");\\n\\nxhr.send(data);\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n**Response**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"scenarios\\\": [\\n    {\\n      \\\"key\\\": \\\"37B93A3C58EAAF4D2B1B35B58526EAAC\\\",\\n      \\\"name\\\": \\\"New scenario\\\",\\n      \\\"flow\\\": [\\n        {\\n          \\\"from\\\": \\\"TestSender\\\",\\n          \\\"channel\\\": \\\"SMS\\\"\\n        },\\n        {\\n          \\\"from\\\": \\\"3045\\\",\\n          \\\"channel\\\": \\\"VIBER\\\"\\n        }\\n      ],\\n      \\\"default\\\": true\\n    }\\n  ]\\n}\",\n      \"language\": \"json\",\n      \"name\": \"200 OK - JSON\"\n    },\n    {\n      \"code\": \"<scenariosResponse>\\n    <scenarios>\\n        <scenario>\\n            <key>37B93A3C58EAAF4D2B1B35B58526EAAC</key>\\n            <name>New scenario</name>\\n            <flow>\\n                <step>\\n                    <from>TestSender</from>\\n                    <channel>SMS</channel>\\n                </step>\\n                <step>\\n                    <from>3045</from>\\n                    <channel>VIBER</channel>\\n                </step>\\n            </flow>\\n            <default>true</default>\\n        </scenario>\\n    </scenarios>\\n</scenariosResponse>\",\n      \"language\": \"xml\",\n      \"name\": \"200 OK - XML\"\n    },\n    {\n      \"code\": \"{\\n  \\\"requestError\\\": {\\n    \\\"serviceException\\\": {\\n      \\\"messageId\\\": \\\"NOT_FOUND\\\",\\n      \\\"text\\\": \\\"Scenario not found.\\\"\\n    }\\n  }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"404 Not Found\"\n    }\n  ]\n}\n[/block]","excerpt":"This method allows you to get OMNI scenarios. Specifically, all of our default scenarios can be caught with this method.","slug":"omni-get-scenario","type":"endpoint","title":"Scenario: Get"}

getScenario: Get

This method allows you to get OMNI scenarios. Specifically, all of our default scenarios can be caught with this method.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

key:
string
Key used to uniquely identify OMNI scenario.

Query Params

default:
boolean
Get default scenario.
page:
integer0
OMNI scenarios page to return. This parameter is zero-based, so requesting page 0 will return the first page.
limit:
integer100
Maximal number of OMNI scenarios to return in a single page.

Examples


Result Format


Documentation

# Response format If successful, the response header HTTP status code will be `200 OK` and the requested scenario will be returned. If you try to get the scenario without authorization, you will receive an `401 Unauthorized` error. ### Scenario |Parameter|Type|Description| |-|-|-| |*key*|String|Key used to uniquely identify OMNI scenario.| |*name*|String|OMNI scenario name.| |*flow*|[Step](#section-step)|Sender used in OMNI scenario's step for sending message.| |*default*|Boolean|Whether scenario is default. ### Step |Parameter|Type|Description| |-|-|-| |*from*|String|Sender used in OMNI scenario's step for sending message.| |*channel*|String|Channel used in scenario's step for delivering message ("`SMS`", `"VOICE"`, "`VIBER`")| [block:api-header] { "type": "basic", "title": "Additional example" } [/block] # Get all scenarios [block:callout] { "type": "info", "title": "", "body": "If **all** scenarios are wanted, **key** parameter must be omitted." } [/block] **Request** [block:code] { "codes": [ { "code": "GET /omni/1/scenarios HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/json", "language": "json" }, { "code": "GET /omni/1/scenarios HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/xml", "language": "xml" }, { "code": "curl -X GET\n-H 'Accept: application/json' \n-H 'Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='\nhttps://api.infobip.com/omni/1/scenarios", "language": "curl" }, { "code": "<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, array(\n CURLOPT_URL => \"http://api.infobip.com/omni/1/scenarios\",\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 => \"GET\",\n CURLOPT_POSTFIELDS => \"\",\n CURLOPT_HTTPHEADER => array(\n \"accept: application/json\",\n \"authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\"\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/scenarios\")\n\nhttp = Net::HTTP.new(url.host, url.port)\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"authorization\"] = 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='\nrequest[\"accept\"] = 'application/json'\n\nresponse = http.request(request)\nputs response.read_body", "language": "ruby" }, { "code": "import http.client\n\nconn = http.client.HTTPConnection(\"api.infobip.com\")\n\nheaders = {\n 'authorization': \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\",\n 'accept': \"application/json\"\n }\n\nconn.request(\"GET\", \"/omni/1/scenarios\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))", "language": "python" }, { "code": "HttpResponse<String> response = Unirest.get(\"https://api.infobip.com/omni/1/scenarios\")\n .header(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\")\n .header(\"accept\", \"application/json\")\n .asString();", "language": "java" }, { "code": "var client = new RestClient(\"https://api.infobip.com/omni/1/scenarios\");\n\nvar request = new RestRequest(Method.GET);\nrequest.AddHeader(\"accept\", \"application/json\");\nrequest.AddHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\");\n\nIRestResponse response = client.Execute(request);", "language": "csharp" }, { "code": "var data = null;\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(\"GET\", \"https://api.infobip.com/omni/1/scenarios\");\nxhr.setRequestHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\");\nxhr.setRequestHeader(\"accept\", \"application/json\");\n\nxhr.send(data);", "language": "javascript" } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"scenarios\": [\n {\n \"key\": \"CD265875E3A6EA43478D5F37A635BE4A\",\n \"name\": \"Test SMS or Viber\",\n \"flow\": [\n {\n \"from\": \"InfoSMS\",\n \"channel\": \"SMS\"\n },\n {\n \"from\": \"3045\",\n \"channel\": \"VIBER\"\n }\n ],\n \"default\": false\n },\n {\n \"key\": \"37B93A3C58EAAF4D2B1B35B58526EAAC\",\n \"name\": \"New scenario\",\n \"flow\": [\n {\n \"from\": \"TestSender\",\n \"channel\": \"SMS\"\n },\n {\n \"from\": \"3045\",\n \"channel\": \"VIBER\"\n }\n ],\n \"default\": true\n }\n ]\n}", "language": "json", "name": "200 OK - JSON" }, { "code": "<scenariosResponse>\n <scenarios>\n <scenario>\n <key>CD265875E3A6EA43478D5F37A635BE4A</key>\n <name>Test SMS or Viber</name>\n <flow>\n <step>\n <from>InfoSMS</from>\n <channel>SMS</channel>\n </step>\n <step>\n <from>3045</from>\n <channel>VIBER</channel>\n </step>\n </flow>\n <default>false</default>\n </scenario>\n <scenario>\n <key>37B93A3C58EAAF4D2B1B35B58526EAAC</key>\n <name>New scenario</name>\n <flow>\n <step>\n <from>TestSender</from>\n <channel>SMS</channel>\n </step>\n <step>\n <from>3045</from>\n <channel>VIBER</channel>\n </step>\n </flow>\n <default>true</default>\n </scenario>\n </scenarios>\n</scenariosResponse>", "language": "xml", "name": "200 OK - XML" }, { "code": "{\n \"requestError\": {\n \"serviceException\": {\n \"messageId\": \"INVALID_ARGUMENT\",\n \"text\": \"Invalid argument\"\n }\n }\n}", "language": "json", "name": "400 Invalid argument" } ] } [/block] ## Response format If successful, the response header HTTP status code will be `200 OK` and all scenarios will be returned. If you try to get the scenarios without authorization, you will receive a `401 Unauthorized` error. ### ScenariosResponse |Parameter|Type|Description| |-|-|-| |*scenarios*|[Scenario](#section-scenario)|Array of OMNI scenarios.| # Get default scenario [block:callout] { "type": "warning", "title": "Caution!", "body": "Usage of the **default** and **key** parameter is **exclusive**. With the *key* **path** parameter, a specific scenario is returned, but with the *default* **query** parameter, the default scenario is returned." } [/block] **Request** [block:code] { "codes": [ { "code": "GET /omni/1/scenarios?default=true HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/json", "language": "json" }, { "code": "GET /omni/1/scenarios?default=true HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/xml", "language": "xml" }, { "code": "curl -X GET\n-H 'Accept: application/json' \n-H 'Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='\nhttps://api.infobip.com/omni/1/scenarios?default=true", "language": "curl" }, { "code": "<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, array(\n CURLOPT_URL => \"http://api.infobip.com/omni/1/scenarios?default=true\",\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 => \"GET\",\n CURLOPT_POSTFIELDS => \"\",\n CURLOPT_HTTPHEADER => array(\n \"accept: application/json\",\n \"authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\"\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/scenarios?default=true\")\n\nhttp = Net::HTTP.new(url.host, url.port)\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"authorization\"] = 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='\nrequest[\"accept\"] = 'application/json'\n\nresponse = http.request(request)\nputs response.read_body", "language": "ruby" }, { "code": "import http.client\n\nconn = http.client.HTTPConnection(\"api.infobip.com\")\n\nheaders = {\n 'authorization': \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\",\n 'accept': \"application/json\"\n }\n\nconn.request(\"GET\", \"/omni/1/scenarios?default=true\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))", "language": "python" }, { "code": "HttpResponse<String> response = Unirest.get(\"https://api.infobip.com/omni/1/scenarios?default=true\")\n .header(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\")\n .header(\"accept\", \"application/json\")\n .asString();", "language": "java" }, { "code": "var client = new RestClient(\"https://api.infobip.com/omni/1/scenarios?default=true\");\n\nvar request = new RestRequest(Method.GET);\nrequest.AddHeader(\"accept\", \"application/json\");\nrequest.AddHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\");\n\nIRestResponse response = client.Execute(request);", "language": "csharp" }, { "code": "var data = null;\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(\"GET\", \"https://api.infobip.com/omni/1/scenarios?default=true\");\nxhr.setRequestHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\");\nxhr.setRequestHeader(\"accept\", \"application/json\");\n\nxhr.send(data);", "language": "javascript" } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"scenarios\": [\n {\n \"key\": \"37B93A3C58EAAF4D2B1B35B58526EAAC\",\n \"name\": \"New scenario\",\n \"flow\": [\n {\n \"from\": \"TestSender\",\n \"channel\": \"SMS\"\n },\n {\n \"from\": \"3045\",\n \"channel\": \"VIBER\"\n }\n ],\n \"default\": true\n }\n ]\n}", "language": "json", "name": "200 OK - JSON" }, { "code": "<scenariosResponse>\n <scenarios>\n <scenario>\n <key>37B93A3C58EAAF4D2B1B35B58526EAAC</key>\n <name>New scenario</name>\n <flow>\n <step>\n <from>TestSender</from>\n <channel>SMS</channel>\n </step>\n <step>\n <from>3045</from>\n <channel>VIBER</channel>\n </step>\n </flow>\n <default>true</default>\n </scenario>\n </scenarios>\n</scenariosResponse>", "language": "xml", "name": "200 OK - XML" }, { "code": "{\n \"requestError\": {\n \"serviceException\": {\n \"messageId\": \"NOT_FOUND\",\n \"text\": \"Scenario not found.\"\n }\n }\n}", "language": "json", "name": "404 Not Found" } ] } [/block]

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}