{"__v":3,"_id":"5655bcf8dd82540d00278c26","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":18,"_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"],"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-25T13:51:52.654Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"name":"","code":"PUT /omni/1/scenarios/CD265875E3A6EA43478D5F37A635BE4A HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/json\n\n{\n  \"name\":\"Test update: SMS or VIBER\",\n  \"flow\": [\n    {\n      \"from\": \"InfoSMS\",\n      \"channel\": \"SMS\"\n    },\n    {\n      \"from\": \"0492DF1379D122771652385E4C6743E3\",\n      \"channel\": \"VIBER\"\n    }\n  ],\n  \"default\": true\n}","language":"json"},{"language":"xml","code":"PUT /omni/1/scenarios/CD265875E3A6EA43478D5F37A635BE4A HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/xml\n\n<scenario>\n    <name>Test update: SMS or VIBER</name>\n    <flow>\n        <step>\n            <from>InfoSMS</from>\n            <channel>SMS</channel>\n        </step>\n        <step>\n            <from>0492DF1379D122771652385E4C6743E3</from>\n            <channel>VIBER</channel>\n        </step>\n    </flow>\n    <default>true</default>\n</scenario>"},{"language":"curl","code":"curl -X PUT \\\n -H 'Content-Type: application/json' \\\n -H 'Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==' \\\n -d '{\n  \"name\":\"Test update: SMS or VIBER\",\n  \"flow\": [\n    {\n      \"from\": \"InfoSMS\",\n      \"channel\": \"SMS\"\n    },\n    {\n    \t\"from\": \"0492DF1379D122771652385E4C6743E3\",\n      \"channel\": \"VIBER\"\n    }\n  ],\n  \"default\": true\n}' https://api.infobip.com/sms/1/omni/1/scenarios/CD265875E3A6EA43478D5F37A635BE4A"},{"language":"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 => \"PUT\",\n  CURLOPT_POSTFIELDS => \"{ \\\"name\\\":\\\"Test update: SMS or VIBER\\\", \\\"flow\\\": [ { \\\"from\\\": \\\"InfoSMS\\\", \\\"channel\\\": \\\"SMS\\\" }, { \\\"from\\\": \\\"0492DF1379D122771652385E4C6743E3\\\", \\\"channel\\\": \\\"VIBER\\\" } ], \\\"default\\\": true }\",\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":"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)\nhttp.use_ssl = true\nhttp.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\nrequest = Net::HTTP::Put.new(url)\nrequest[\"content-type\"] = 'application/json'\nrequest[\"authorization\"] = 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='\nrequest[\"accept\"] = 'application/json'\n\nrequest.body = \"{\\n  \\\"name\\\":\\\"Test update: SMS or VIBER\\\",\\n  \\\"flow\\\": [\\n    {\\n      \\\"from\\\": \\\"InfoSMS\\\",\\n      \\\"channel\\\": \\\"SMS\\\"\\n    },\\n    {\\n      \\\"from\\\": \\\"0492DF1379D122771652385E4C6743E3\\\",\\n      \\\"channel\\\": \\\"VIBER\\\"\\n    }\\n  ],\\n  \\\"default\\\": true\\n}\"\n\nresponse = http.request(request)\nputs response.read_body"},{"language":"python","code":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.infobip.com\")\n\npayload = \"{\\n  \\\"name\\\":\\\"Test update: SMS or VIBER\\\",\\n  \\\"flow\\\": [\\n    {\\n      \\\"from\\\": \\\"InfoSMS\\\",\\n      \\\"channel\\\": \\\"SMS\\\"\\n    },\\n    {\\n      \\\"from\\\": \\\"0492DF1379D122771652385E4C6743E3\\\",\\n      \\\"channel\\\": \\\"VIBER\\\"\\n    }\\n  ],\\n  \\\"default\\\": true\\n}\"\n\nheaders = {\n    'content-type': \"application/json\",\n    'authorization': \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\",\n    'accept': \"application/json\"\n    }\n\nconn.request(\"PUT\", \"/omni/1/scenarios/CD265875E3A6EA43478D5F37A635BE4A\", payload, headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"language":"java","code":"HttpResponse<String> response = Unirest.put(\"https://api.infobip.com/omni/1/scenarios/CD265875E3A6EA43478D5F37A635BE4A\")\n  .header(\"content-type\", \"application/json\")\n  .header(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\")\n  .header(\"accept\", \"application/json\")\n  .body(\"{\\n  \\\"name\\\":\\\"Test update: SMS or VIBER\\\",\\n  \\\"flow\\\": [\\n    {\\n      \\\"from\\\": \\\"InfoSMS\\\",\\n      \\\"channel\\\": \\\"SMS\\\"\\n    },\\n    {\\n      \\\"from\\\": \\\"0492DF1379D122771652385E4C6743E3\\\",\\n      \\\"channel\\\": \\\"VIBER\\\"\\n    }\\n  ],\\n  \\\"default\\\": true\\n}\")\n  .asString();"},{"language":"csharp","code":"var client = new RestClient(\"https://api.infobip.com/omni/1/scenarios/CD265875E3A6EA43478D5F37A635BE4A\");\nvar request = new RestRequest(Method.PUT);\nrequest.AddHeader(\"accept\", \"application/json\");\nrequest.AddHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\");\nrequest.AddHeader(\"content-type\", \"application/json\");\nrequest.AddParameter(\"application/json\", \"{\\n  \\\"name\\\":\\\"Test update: SMS or VIBER\\\",\\n  \\\"flow\\\": [\\n    {\\n      \\\"from\\\": \\\"InfoSMS\\\",\\n      \\\"channel\\\": \\\"SMS\\\"\\n    },\\n    {\\n      \\\"from\\\": \\\"0492DF1379D122771652385E4C6743E3\\\",\\n      \\\"channel\\\": \\\"VIBER\\\"\\n    }\\n  ],\\n  \\\"default\\\": true\\n}\", ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);"},{"language":"javascript","code":"var data = JSON.stringify({\n  \"name\":\"Test update: SMS or VIBER\",\n  \"flow\": [\n    {\n      \"from\": \"InfoSMS\",\n      \"channel\": \"SMS\"\n    },\n    {\n      \"from\": \"0492DF1379D122771652385E4C6743E3\",\n      \"channel\": \"VIBER\"\n    }\n  ],\n  \"default\": true\n});\n\nxhr.open(\"PUT\", \"https://api.infobip.com/omni/1/scenarios/CD265875E3A6EA43478D5F37A635BE4A\");\nxhr.setRequestHeader(\"content-type\", \"application/json\");\nxhr.setRequestHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\");\nxhr.setRequestHeader(\"accept\", \"application/json\");\n\nxhr.send(data);"}]},"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"key\": \"CD265875E3A6EA43478D5F37A635BE4A\",\n  \"name\":\"Test update: SMS or VIBER\",\n  \"flow\": [\n    {\n      \"from\": \"InfoSMS\",\n      \"channel\": \"SMS\"\n    },\n    {\n      \"from\": \"0492DF1379D122771652385E4C6743E3\",\n      \"channel\": \"VIBER\"\n    }\n  ],\n  \"default\": true\n}","name":"OK - JSON"},{"status":200,"language":"xml","code":"<scenario>\n    <key>CD265875E3A6EA43478D5F37A635BE4A</key>\n    <name>Test update: SMS or VIBER</name>\n    <flow>\n        <step>\n            <from>InfoSMS</from>\n            <channel>SMS</channel>\n        </step>\n        <step>\n            <from>0492DF1379D122771652385E4C6743E3</from>\n            <channel>VIBER</channel>\n        </step>\n    </flow>\n    <default>true</default>\n</scenario>","name":"OK - XML"},{"name":"Invalid argument","status":400,"language":"json","code":"{\n  \"requestError\": {\n    \"serviceException\": {\n      \"messageId\": \"INVALID_ARGUMENT\",\n      \"text\": \"Invalid argument\"\n    }\n  }\n}"}]},"settings":"554860d6d2c8410d006c215e","auth":"required","params":[{"_id":"5655bcf8dd82540d00278c27","ref":"","in":"path","required":true,"desc":"Key used to uniquely identify OMNI scenario.","default":"","type":"string","name":"key"},{"_id":"562106bc7c515c0d008eee67","ref":"","in":"body","required":false,"desc":"OMNI scenario name.","default":"","type":"string","name":"name"},{"_id":"562107eeb244890d00186907","ref":"","in":"body","required":false,"desc":"Sender used in OMNI scenario's step for sending message.","default":"","type":"string","name":"from"},{"_id":"562107eeb244890d00186906","ref":"","in":"body","required":false,"desc":"Channel used in scenario's step for delivering message (`\"SMS\"`, `\"PARSECO\"`, `\"VOICE\"`,`\"VIBER\"`,`\"FACEBOOK\"`,`\"EMAIL\"`,`\"PUSH\"`)","default":"","type":"string","name":"channel"}],"url":"/omni/:version/scenarios/:key"},"isReference":true,"order":3,"body":"# Response format \n\nIf successful, response header HTTP status code will be `200 OK` and the updated scenario will be returned.\n\nIf you try to update 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\"`, `\"PARSECO\"`, `\"VOICE\"`,`\"VIBER\"`,`\"FACEBOOK\"`,`\"EMAIL\"`,`\"PUSH\"`)|\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Default scenario\",\n  \"body\": \"If you update some scenario with *default* parameter set to true, that scenario will become default for your account, replacing previously default scenario.\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Additional example\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"When you try update default scenario with parameter *default* set to false you will get an error because there has to be exactly one default scenario.\",\n  \"title\": \"Caution!\"\n}\n[/block]\n**Request**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"PUT /omni/1/scenarios/CD265875E3A6EA43478D5F37A635BE4A HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nContent-Type: application/json\\n\\n{\\n  \\\"default\\\": false\\n}\",\n      \"language\": \"json\"\n    },\n    {\n      \"code\": \"PUT /omni/1/scenarios/CD265875E3A6EA43478D5F37A635BE4A HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nContent-Type: application/xml\\n\\n<scenario>\\n    <default>false</default>\\n</scenario>\",\n      \"language\": \"xml\"\n    },\n    {\n      \"code\": \"curl -X PUT \\\\\\n -H 'Content-Type: application/json' \\\\\\n -H 'Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==' \\\\\\n -d '{\\n  \\\"default\\\": false\\n}' https://api.infobip.com/sms/1/omni/1/scenarios/CD265875E3A6EA43478D5F37A635BE4A\",\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/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 => \\\"PUT\\\",\\n  CURLOPT_POSTFIELDS => \\\"{ \\\\\\\"default\\\\\\\": false }\\\",\\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/omni/1/scenarios/CD265875E3A6EA43478D5F37A635BE4A\\\")\\n\\nhttp = Net::HTTP.new(url.host, url.port)\\nhttp.use_ssl = true\\nhttp.verify_mode = OpenSSL::SSL::VERIFY_NONE\\n\\nrequest = Net::HTTP::Put.new(url)\\nrequest[\\\"content-type\\\"] = 'application/json'\\nrequest[\\\"authorization\\\"] = 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='\\nrequest[\\\"accept\\\"] = 'application/json'\\n\\nrequest.body = \\\"{\\\\n    \\\\\\\"default\\\\\\\": false\\\\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    \\\\\\\"default\\\\\\\": false\\\\n}\\\"\\n\\nheaders = {\\n    'content-type': \\\"application/json\\\",\\n    'authorization': \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\",\\n    'accept': \\\"application/json\\\"\\n    }\\n\\nconn.request(\\\"PUT\\\", \\\"/omni/1/scenarios/CD265875E3A6EA43478D5F37A635BE4A\\\", 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.put(\\\"https://api.infobip.com/omni/1/scenarios/CD265875E3A6EA43478D5F37A635BE4A\\\")\\n  .header(\\\"content-type\\\", \\\"application/json\\\")\\n  .header(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\")\\n  .header(\\\"accept\\\", \\\"application/json\\\")\\n  .body(\\\"{\\\\n    \\\\\\\"default\\\\\\\": false\\\\n}\\\")\\n  .asString();\",\n      \"language\": \"java\"\n    },\n    {\n      \"code\": \"var client = new RestClient(\\\"https://api.infobip.com/omni/1/scenarios/CD265875E3A6EA43478D5F37A635BE4A\\\");\\nvar request = new RestRequest(Method.PUT);\\nrequest.AddHeader(\\\"accept\\\", \\\"application/json\\\");\\nrequest.AddHeader(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\");\\nrequest.AddHeader(\\\"content-type\\\", \\\"application/json\\\");\\nrequest.AddParameter(\\\"application/json\\\", \\\"{\\\\n    \\\\\\\"default\\\\\\\": false\\\\n}\\\", ParameterType.RequestBody);\\nIRestResponse response = client.Execute(request);\",\n      \"language\": \"csharp\"\n    },\n    {\n      \"code\": \"var data = JSON.stringify({\\n  \\\"default\\\": false\\n});\\n\\nxhr.open(\\\"PUT\\\", \\\"https://api.infobip.com/omni/1/scenarios/CD265875E3A6EA43478D5F37A635BE4A\\\");\\nxhr.setRequestHeader(\\\"content-type\\\", \\\"application/json\\\");\\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  \\\"requestError\\\": {\\n    \\\"serviceException\\\": {\\n      \\\"messageId\\\": \\\"INVALID_ARGUMENT\\\",\\n      \\\"text\\\": \\\"Exactly one scenario must be default.\\\"\\n    }\\n  }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"400 Invalid argument\"\n    }\n  ]\n}\n[/block]","excerpt":"This method allows you to update OMNI scenario.","slug":"omni-update-scenario","type":"put","title":"Scenario: Update"}

putScenario: Update

This method allows you to update OMNI scenario.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

key:
required
string
Key used to uniquely identify OMNI scenario.

Body Params

name:
string
OMNI scenario name.
from:
string
Sender used in OMNI scenario's step for sending message.
channel:
string
Channel used in scenario's step for delivering message (`"SMS"`, `"PARSECO"`, `"VOICE"`,`"VIBER"`,`"FACEBOOK"`,`"EMAIL"`,`"PUSH"`)

Examples


Result Format


Documentation

# Response format If successful, response header HTTP status code will be `200 OK` and the updated scenario will be returned. If you try to update 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"`, `"PARSECO"`, `"VOICE"`,`"VIBER"`,`"FACEBOOK"`,`"EMAIL"`,`"PUSH"`)| [block:callout] { "type": "info", "title": "Default scenario", "body": "If you update some scenario with *default* parameter set to true, that scenario will become default for your account, replacing previously default scenario." } [/block] [block:api-header] { "type": "basic", "title": "Additional example" } [/block] [block:callout] { "type": "warning", "body": "When you try update default scenario with parameter *default* set to false you will get an error because there has to be exactly one default scenario.", "title": "Caution!" } [/block] **Request** [block:code] { "codes": [ { "code": "PUT /omni/1/scenarios/CD265875E3A6EA43478D5F37A635BE4A HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/json\n\n{\n \"default\": false\n}", "language": "json" }, { "code": "PUT /omni/1/scenarios/CD265875E3A6EA43478D5F37A635BE4A HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/xml\n\n<scenario>\n <default>false</default>\n</scenario>", "language": "xml" }, { "code": "curl -X PUT \\\n -H 'Content-Type: application/json' \\\n -H 'Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==' \\\n -d '{\n \"default\": false\n}' https://api.infobip.com/sms/1/omni/1/scenarios/CD265875E3A6EA43478D5F37A635BE4A", "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/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 => \"PUT\",\n CURLOPT_POSTFIELDS => \"{ \\\"default\\\": false }\",\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/scenarios/CD265875E3A6EA43478D5F37A635BE4A\")\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\nhttp.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\nrequest = Net::HTTP::Put.new(url)\nrequest[\"content-type\"] = 'application/json'\nrequest[\"authorization\"] = 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='\nrequest[\"accept\"] = 'application/json'\n\nrequest.body = \"{\\n \\\"default\\\": false\\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 \\\"default\\\": false\\n}\"\n\nheaders = {\n 'content-type': \"application/json\",\n 'authorization': \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\",\n 'accept': \"application/json\"\n }\n\nconn.request(\"PUT\", \"/omni/1/scenarios/CD265875E3A6EA43478D5F37A635BE4A\", payload, headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))", "language": "python" }, { "code": "HttpResponse<String> response = Unirest.put(\"https://api.infobip.com/omni/1/scenarios/CD265875E3A6EA43478D5F37A635BE4A\")\n .header(\"content-type\", \"application/json\")\n .header(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\")\n .header(\"accept\", \"application/json\")\n .body(\"{\\n \\\"default\\\": false\\n}\")\n .asString();", "language": "java" }, { "code": "var client = new RestClient(\"https://api.infobip.com/omni/1/scenarios/CD265875E3A6EA43478D5F37A635BE4A\");\nvar request = new RestRequest(Method.PUT);\nrequest.AddHeader(\"accept\", \"application/json\");\nrequest.AddHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\");\nrequest.AddHeader(\"content-type\", \"application/json\");\nrequest.AddParameter(\"application/json\", \"{\\n \\\"default\\\": false\\n}\", ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);", "language": "csharp" }, { "code": "var data = JSON.stringify({\n \"default\": false\n});\n\nxhr.open(\"PUT\", \"https://api.infobip.com/omni/1/scenarios/CD265875E3A6EA43478D5F37A635BE4A\");\nxhr.setRequestHeader(\"content-type\", \"application/json\");\nxhr.setRequestHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\");\nxhr.setRequestHeader(\"accept\", \"application/json\");\n\nxhr.send(data);", "language": "javascript" } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"requestError\": {\n \"serviceException\": {\n \"messageId\": \"INVALID_ARGUMENT\",\n \"text\": \"Exactly one scenario must be default.\"\n }\n }\n}", "language": "json", "name": "400 Invalid argument" } ] } [/block]