{"_id":"596f79cd14c3a5002e748efd","project":"54eb50e5615ffc1900305a16","version":{"_id":"54eb63b859b1172100334fae","project":"54eb50e5615ffc1900305a16","forked_from":"54eb63a1867e1917009b711d","__v":27,"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"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1"},"category":{"_id":"56a632277ef6620d00e2f18a","pages":[],"project":"54eb50e5615ffc1900305a16","version":"54eb63b859b1172100334fae","__v":0,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-01-25T14:33:11.835Z","from_sync":false,"order":12,"slug":"text2speech-voice-messaging","title":"Voice Messaging"},"user":"583ee4a14828d50f00126d0f","__v":1,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-07-19T15:25:01.806Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":true,"api":{"method":"post","examples":{"codes":[{"name":"","code":"POST /tts/3/advanced HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/json\nAccept: application/json\n\n{\n   \"bulkId\": \"BULK-ID-123-xyz\",\n   \"messages\": [\n      {\n         \"from\": \"41793026700\",\n         \"destinations\": [\n            {\n               \"to\": \"41793026727\",\n               \"messageId\": \"MESSAGE-ID-123-xyz\"\n            },\n            {\n               \"to\": \"41793026731\"\n            }\n         ],\n         \"text\": \"Test Voice message.\",\n         \"language\": \"en\",\n         \"speechRate\": 1,\n         \"notifyUrl\": \"http://www.example.com/voice/advanced\",\n         \"notifyContentType\": \"application/json\",\n         \"callbackData\":\"DLR callback data\",\n         \"validityPeriod\": 720,\n         \"sendAt\": \"2016-07-07T17:00:00.000+01:00\",\n         \"record\": false,\n         \"repeatDtmf\": \"123#\",\n         \"ringTimeout\": 45,\n         \"dtmfTimeout\": 10,\n         \"callTimeout\": 130,\n         \"machineDetection\": \"DISABLE\"         \n      },\n      {\n         \"from\": \"41793026700\",\n         \"destinations\": [\n            {\n               \"to\": \"41793026785\"\n            }\n         ],\n         \"text\": \"A long time ago, in a galaxy far.\",\n         \"sendAt\": \"2016-07-07T18:00:00.000+01:00\"\n      }\n   ],\n   \"tracking\":{\n         \"track\": \"VOICE\",\n         \"type\": \"MY_CAMPAIGN\"\n   }\n}","language":"json"},{"code":"curl -X POST \\\n-H \"Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\" \\\n-H \"Content-Type: application/json\" \\\n-H \"Accept: application/json\" \\\n-d '{\n   \"bulkId\":\"BULK-ID-123-xyz\",\n   \"messages\":[\n      {\n         \"from\":\"41793026700\",\n         \"destinations\":[\n            {\n               \"to\":\"41793026727\",\n               \"messageId\":\"MESSAGE-ID-123-xyz\"\n            },\n            {\n               \"to\":\"41793026731\"\n            }\n         ],\n         \"text\": \"Test Voice message.\",\n         \"language\": \"en\",\n         \"speechRate\":1,\n         \"notifyUrl\":\"http://www.example.com/voice/advanced\",\n         \"notifyContentType\":\"application/json\",\n         \"validityPeriod\": 720,\n         \"sendAt\":\"2016-07-07T17:00:00.000+01:00\",\n         \"record\": false,\n         \"repeatDtmf\": \"123#\",\n         \"ringTimeout\": 45,\n         \"dtmfTimeout\": 10,\n         \"callTimeout\": 130,\n         \"machineDetection\": \"DISABLE\"\n      },\n      {\n         \"from\":\"41793026700\",\n         \"destinations\":[\n            {\n               \"to\":\"41793026785\"\n            }\n         ],\n         \"text\":\"A long time ago, in a galaxy far.\",\n         \"sendAt\":\"2016-07-07T18:00:00.000+01:00\"\n      }\n   ]\n}' \"http://api.infobip.com/tts/3/advanced\"","language":"curl"},{"code":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, array(\n  CURLOPT_URL => \"http://api.infobip.com/tts/3/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 => \"{ \n                          \\\"bulkId\\\": \\\"BULK-ID-123-xyz\\\",\n                          \\\"messages\\\": [\n                            {\n                              \\\"from\\\": \\\"41793026700\\\",\n                              \\\"destinations\\\": [\n                                {\n                                  \\\"to\\\": \\\"41793026727\\\",\n                                  \\\"messageId\\\": \\\"MESSAGE-ID-123-xyz\\\"\n                                },\n                                {\n                                  \\\"to\\\": \\\"41793026731\\\"\n                                }\n                              ],\n                              \\\"text\\\": \\\"Test Voice message.\\\",\n                              \\\"language\\\": \\\"en\\\",\n                              \\\"speechRate\\\": 1,\n                              \\\"notifyUrl\\\": \\\"http://www.example.com/voice/advanced\\\",\n                              \\\"notifyContentType\\\": \\\"application/json\\\",\n                              \\\"validityPeriod\\\": 720,\n                              \\\"sendAt\\\": \\\"2016-07-07T17:00:00.000+01:00\\\",\n                              \\\"record\\\": false,\n                              \\\"repeatDtmf\\\": \\\"123#\\\",\n                              \\\"ringTimeout\\\": 45,\n                              \\\"dtmfTimeout\\\": 10,\n                              \\\"callTimeout\\\": 130,\n                              \\\"machineDetection\\\": \\\"DISABLE\\\"\n                            },\n                            {\n                              \\\"from\\\": \\\"41793026700\\\",\n                              \\\"destinations\\\": [\n                                {\n                                  \\\"to\\\": \\\"41793026785\\\"\n                                }\n                              ],\n                              \\\"text\\\": \\\"A long time ago, in a galaxy far.\\\",\n                              \\\"sendAt\\\": \\\"2016-07-07T18:00:00.000+01:00\\\"\n                            }\n                          ]\n                        }\",\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(\"http://api.infobip.com/tts/3/advanced\")\n\nhttp = Net::HTTP.new(url.host, url.port)\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"authorization\"] = 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='\nrequest[\"content-type\"] = 'application/json'\nrequest[\"accept\"] = 'application/json'\nrequest.body = \"{ \n                \\\"bulkId\\\": \\\"BULK-ID-123-xyz\\\",\n                \\\"messages\\\": [\n                  {\n                    \\\"from\\\": \\\"41793026700\\\",\n                    \\\"destinations\\\": [\n                      {\n                        \\\"to\\\": \\\"41793026727\\\",\n                        \\\"messageId\\\": \\\"MESSAGE-ID-123-xyz\\\"\n                      },\n                      {\n                        \\\"to\\\": \\\"41793026731\\\"\n                      }\n                    ],\n                    \\\"text\\\": \\\"Test Voice message.\\\",\n                    \\\"language\\\": \\\"en\\\",\n                    \\\"speechRate\\\": 1,\n                    \\\"notifyUrl\\\": \\\"http://www.example.com/voice/advanced\\\",\n                    \\\"notifyContentType\\\": \\\"application/json\\\",\n                    \\\"validityPeriod\\\": 720,\n                    \\\"sendAt\\\": \\\"2016-07-07T17:00:00.000+01:00\\\",\n                    \\\"record\\\": false,\n                    \\\"repeatDtmf\\\": \\\"123#\\\",\n                    \\\"ringTimeout\\\": 45,\n                    \\\"dtmfTimeout\\\": 10,\n                    \\\"callTimeout\\\": 130,\n                    \\\"machineDetection\\\": \\\"DISABLE\\\"\n                  },\n                  {\n                    \\\"from\\\": \\\"41793026700\\\",\n                    \\\"destinations\\\": [\n                      {\n                        \\\"to\\\": \\\"41793026785\\\"\n                      }\n                    ],\n                    \\\"text\\\": \\\"A long time ago, in a galaxy far.\\\",\n                    \\\"sendAt\\\": \\\"2016-07-07T18:00:00.000+01:00\\\"\n                  }\n                ]\n              }\",\n\nresponse = http.request(request)\nputs response.read_body","language":"ruby"},{"code":"import http.client\n\nconn = http.client.HTTPConnection(\"api.infobip.com\")\n\npayload = \"{ \n            \\\"bulkId\\\": \\\"BULK-ID-123-xyz\\\",\n            \\\"messages\\\": [\n              {\n                \\\"from\\\": \\\"41793026700\\\",\n                \\\"destinations\\\": [\n                  {\n                    \\\"to\\\": \\\"41793026727\\\",\n                    \\\"messageId\\\": \\\"MESSAGE-ID-123-xyz\\\"\n                  },\n                  {\n                    \\\"to\\\": \\\"41793026731\\\"\n                  }\n                ],\n                \\\"text\\\": \\\"Test Voice message.\\\",\n                \\\"language\\\": \\\"en\\\",\n                \\\"speechRate\\\": 1,\n                \\\"notifyUrl\\\": \\\"http://www.example.com/voice/advanced\\\",\n                \\\"notifyContentType\\\": \\\"application/json\\\",\n                \\\"validityPeriod\\\": 720,\n                \\\"sendAt\\\": \\\"2016-07-07T17:00:00.000+01:00\\\",\n                \\\"record\\\": false,\n                \\\"repeatDtmf\\\": \\\"123#\\\",\n                \\\"ringTimeout\\\": 45,\n                \\\"dtmfTimeout\\\": 10,\n                \\\"callTimeout\\\": 130,\n                \\\"machineDetection\\\": \\\"DISABLE\\\"\n              },\n              {\n                \\\"from\\\": \\\"41793026700\\\",\n                \\\"destinations\\\": [\n                  {\n                    \\\"to\\\": \\\"41793026785\\\"\n                  }\n                ],\n                \\\"text\\\": \\\"A long time ago, in a galaxy far.\\\",\n                \\\"sendAt\\\": \\\"2016-07-07T18:00:00.000+01:00\\\"\n              }\n            ]\n          }\"\n\nheaders = {\n    'authorization': \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\",\n    'content-type': \"application/json\",\n    'accept': \"application/json\"\n    }\n\nconn.request(\"POST\", \"/tts/3/advanced\", payload, headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))","language":"python"},{"code":"HttpResponse<String> response = Unirest.post(\"http://api.infobip.com/tts/3/advanced\")\n  .header(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\")\n  .header(\"content-type\", \"application/json\")\n  .header(\"accept\", \"application/json\")\n  .body(\"{ \n          \\\"bulkId\\\": \\\"BULK-ID-123-xyz\\\",\n          \\\"messages\\\": [\n            {\n              \\\"from\\\": \\\"41793026700\\\",\n              \\\"destinations\\\": [\n                {\n                  \\\"to\\\": \\\"41793026727\\\",\n                  \\\"messageId\\\": \\\"MESSAGE-ID-123-xyz\\\"\n                },\n                {\n                  \\\"to\\\": \\\"41793026731\\\"\n                }\n              ],\n              \\\"text\\\": \\\"Test Voice message.\\\",\n              \\\"language\\\": \\\"en\\\",\n              \\\"speechRate\\\": 1,\n              \\\"notifyUrl\\\": \\\"http://www.example.com/voice/advanced\\\",\n              \\\"notifyContentType\\\": \\\"application/json\\\",\n              \\\"validityPeriod\\\": 720,\n              \\\"sendAt\\\": \\\"2016-07-07T17:00:00.000+01:00\\\",\n              \\\"record\\\": false,\n              \\\"repeatDtmf\\\": \\\"123#\\\",\n              \\\"ringTimeout\\\": 45,\n              \\\"dtmfTimeout\\\": 10,\n              \\\"callTimeout\\\": 130,\n              \\\"machineDetection\\\": \\\"DISABLE\\\"\n            },\n            {\n              \\\"from\\\": \\\"41793026700\\\",\n              \\\"destinations\\\": [\n                {\n                  \\\"to\\\": \\\"41793026785\\\"\n                }\n              ],\n              \\\"text\\\": \\\"A long time ago, in a galaxy far.\\\",\n              \\\"sendAt\\\": \\\"2016-07-07T18:00:00.000+01:00\\\"\n            }\n          ]\n        }\")\n  .asString();","language":"java"},{"code":"var client = new RestClient(\"http://api.infobip.com/tts/3/advanced\");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"accept\", \"application/json\");\nrequest.AddHeader(\"content-type\", \"application/json\");\nrequest.AddHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\");\nrequest.AddParameter(\"application/json\", \n                     \"{ \n                       \\\"bulkId\\\": \\\"BULK-ID-123-xyz\\\",\n                       \\\"messages\\\": [\n                       {\n                         \\\"from\\\": \\\"41793026700\\\",\n                           \\\"destinations\\\": [\n                         {\n                           \\\"to\\\": \\\"41793026727\\\",\n                             \\\"messageId\\\": \\\"MESSAGE-ID-123-xyz\\\"\n                         },\n                         {\n                           \\\"to\\\": \\\"41793026731\\\"\n                         }\n                         ],\n                         \\\"text\\\": \\\"Test Voice message.\\\",\n                           \\\"language\\\": \\\"en\\\",\n                           \\\"speechRate\\\": 1,\n                           \\\"notifyUrl\\\": \\\"http://www.example.com/voice/advanced\\\",\n                           \\\"notifyContentType\\\": \\\"application/json\\\",\n                           \\\"validityPeriod\\\": 720,\n                           \\\"sendAt\\\": \\\"2016-07-07T17:00:00.000+01:00\\\",\n                           \\\"record\\\": false,\n                           \\\"repeatDtmf\\\": \\\"123#\\\",\n                           \\\"ringTimeout\\\": 45,\n                           \\\"dtmfTimeout\\\": 10,\n                           \\\"callTimeout\\\": 130,\n                           \\\"machineDetection\\\": \\\"DISABLE\\\"\n                       },\n                       {\n                         \\\"from\\\": \\\"41793026700\\\",\n                           \\\"destinations\\\": [\n                         {\n                           \\\"to\\\": \\\"41793026785\\\"\n                         }\n                         ],\n                         \\\"text\\\": \\\"A long time ago, in a galaxy far.\\\",\n                           \\\"sendAt\\\": \\\"2016-07-07T18:00:00.000+01:00\\\"\n                       }\n                       ]\n                       }\", \n                     ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);","language":"csharp"},{"code":"var data = JSON.stringify({\n  \"bulkId\": \"BULK-ID-123-xyz\",\n  \"messages\": [\n    {\n      \"from\": \"41793026700\",\n      \"destinations\": [\n        { \n          \"to\": \"41793026727\",\n          \"messageId\": \"MESSAGE-ID-123-xyz\"\n        },\n        {\n          \"to\": \"41793026731\"\n        }\n      ],\n      \"text\": \"Test Voice message.\",\n      \"language\": \"en\",\n      \"speechRate\": 1,\n      \"notifyUrl\": \"http://www.example.com/voice/advanced\",\n      \"notifyContentType\": \"application/json\",\n      \"validityPeriod\": 720,\n      \"sendAt\": \"2016-07-07T17:00:00.000+01:00\",\n      \"record\": false,\n      \"repeatDtmf\": \"123#\",\n      \"ringTimeout\": 45,\n      \"dtmfTimeout\": 10,\n      \"callTimeout\": 130,\n      \"machineDetection\": \"DISABLE\"      \n    },\n    {\n      \"from\": \"41793026700\",\n      \"destinations\": [\n        {\n          \"to\": \"41793026785\"\n        }\n      ],\n      \"text\": \"A long time ago, in a galaxy far.\",\n      \"sendAt\": \"2016-07-07T18:00:00.000+01:00\"\n    }\n  ]\n});\n\nvar xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n  if (this.readyState === 4) {\n    console.log(this.responseText);\n  }\n});\n\nxhr.open(\"POST\", \"http://api.infobip.com/tts/3/advanced\");\nxhr.setRequestHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\");\nxhr.setRequestHeader(\"content-type\", \"application/json\");\nxhr.setRequestHeader(\"accept\", \"application/json\");\n\nxhr.send(data);\n","language":"javascript"}]},"settings":"554860d6d2c8410d006c215e","results":{"codes":[{"name":"OK - JSON","code":"{\n  \"bulkId\": \"BULK-ID-123-xyz\",\n  \"messages\": [\n    {\n      \"to\": \"41793026727\",\n      \"status\": {\n        \"groupId\": 1,\n        \"groupName\": \"PENDING\",\n        \"id\": 26,\n        \"name\": \"PENDING_ACCEPTED\",\n        \"description\": \"Message accepted, pending for delivery.\"\n      },\n      \"messageId\": \"MESSAGE-ID-123-xyz\"\n    },\n    {\n      \"to\": \"41793026731\",\n      \"status\": {\n        \"groupId\": 1,\n        \"groupName\": \"PENDING\",\n        \"id\": 26,\n        \"name\": \"PENDING_ACCEPTED\",\n        \"description\": \"Message accepted, pending for delivery.\"\n      },\n      \"messageId\":\"9304a5a3ab19-1ca1-be74-76ad87651ed25f35\"\n    },\n    {\n      \"to\": \"41793026785\",\n      \"status\": {\n        \"groupId\": 1,\n        \"groupName\": \"PENDING\",\n        \"id\": 26,\n        \"name\": \"PENDING_ACCEPTED\",\n        \"description\": \"Message accepted, pending for delivery.\"\n      },\n      \"messageId\":\"5f35f87a2f19-a141-43a4-91cd81b85f8c689\"\n    }\n  ]\n}","language":"json","status":200}]},"auth":"required","params":[{"_id":"57c9fd0b35d18d0e00242a0d","ref":"","in":"body","required":false,"desc":"The ID which uniquely identifies the request.","default":"","type":"string","name":"bulkId"},{"_id":"566abc7b74d574170070b711","ref":"","in":"body","required":false,"desc":"Numeric sender ID length should be between 3 and 14 characters.","default":"12345","type":"string","name":"from"},{"_id":"566abc7b74d574170070b710","ref":"","in":"body","required":true,"desc":"Array of message destination addresses. Destination address must be in the international format (Example: 41793026727).","default":"","type":"array_string","name":"to"},{"_id":"57c9fd0b35d18d0e00242a0c","ref":"","in":"body","required":false,"desc":"The ID that uniquely identifies the message sent.","default":"","type":"string","name":"messageId"},{"_id":"566abc7b74d574170070b70f","ref":"","in":"body","required":false,"desc":"Text of the message that will be sent. [Pause](#section-pause-between-words) between words is possible.","default":"","type":"string","name":"text"},{"_id":"566abc7b74d574170070b70d","ref":"","in":"body","required":false,"desc":"If the message is in text format, language in which the message is written must be defined for correct pronunciation. Below, in the 'Languages' section, you can find the list of languages that we support.","default":"en","type":"string","name":"language"},{"_id":"566abc7b74d574170070b70e","ref":"","in":"body","required":false,"desc":"Besides the text format of the message, audio recording (in waw or mp3 format) can also be delivered as a voice message to the recipient. Audio file must be uploaded online so the existing URL can be available for the file download. Size of the audio file must be below 4 MB.","default":"","type":"string","name":"audioFileUrl"},{"_id":"57da7ea713ca3b0e0015b005","ref":"","in":"body","required":false,"desc":"The reproduction speed of speech in the resulting message. Effective only when using text. Supported range is from 0.5 (slow down speech) to 2 (speed up speech). Values less than 0.5 will be replaced with 0.5, and values higher than 2 will be replaced with 2.","default":"1","type":"double","name":"speechRate"},{"_id":"57c9fd0b35d18d0e00242a0a","ref":"","in":"body","required":false,"desc":"The URL on your callback server on which the [Delivery report](http://dev.infobip.com/v1/docs/delivery-reports) will be sent.","default":"","type":"string","name":"notifyUrl"},{"_id":"57c9fd0b35d18d0e00242a09","ref":"","in":"body","required":false,"desc":"Preferred Delivery report content type. Can be `application/json` or `application/xml`.","default":"","type":"string","name":"notifyContentType"},{"_id":"566abc7b74d574170070b702","ref":"","in":"body","required":false,"desc":"The message validity period shown in minutes. When the period expires, it will not be allowed for the message to be sent. A validity period longer than 48h is not supported (in this case, it will be automatically set to 48h).","default":"","type":"int","name":"validityPeriod"},{"_id":"566abc7b74d574170070b704","ref":"","in":"body","required":false,"desc":"Used for scheduled Voice messages (message not to be sent immediately, but at scheduled time).","default":"","type":"datetime","name":"sendAt"},{"_id":"566abc7b74d574170070b70c","ref":"","in":"body","required":false,"desc":"Record the call and expose it to client as URL inside the delivery report. Can be `true` or `false`.","default":"false","type":"boolean","name":"record"},{"_id":"566abc7b74d574170070b70b","ref":"","in":"body","required":false,"desc":"Response (DTMF) code which enables repeating message if a subscriber enters it.","default":"","type":"string","name":"repeatDtmf"},{"_id":"566abc7b74d574170070b708","ref":"","in":"body","required":false,"desc":"The duration of the call prior to answer shown in seconds, unless there are no [operator limitations](#section-ring-timeout-limitations).","default":"45","type":"int","name":"ringTimeout"},{"_id":"566abc7b74d574170070b707","ref":"","in":"body","required":false,"desc":"The waiting period for end user to enter dtmf digits.","default":"10","type":"int","name":"dtmfTimeout"},{"_id":"566abc7b74d574170070b706","ref":"","in":"body","required":false,"desc":"Total call period shown in seconds.","default":"","type":"int","name":"callTimeout"},{"_id":"566abc7b74d574170070b705","ref":"","in":"body","required":false,"desc":"This action attempts to detect answering machines at the beginning of the call. Possible values: ['disable'](#section-disable-default-value-),  ['hangup'](#section-hangup).","default":"disable","type":"string","name":"machineDetection"},{"_id":"56fbe35b0023171700b9610e","ref":"","in":"body","required":false,"desc":"Possible call transfer scenario defined as JSON object. See <a href=\"#call-transfers\">example below</a>","default":"","type":"array_object","name":"callTransfers"},{"_id":"589c1e8d29523b23003ba0c3","ref":"","in":"body","required":false,"desc":"Indicates if the message has to be tracked for Conversion rates. Possible values: `VOICE`.","default":"","type":"string","name":"track"},{"_id":"589c1e8d29523b23003ba0c2","ref":"","in":"body","required":false,"desc":"Key that uniquely identifies Conversion tracking process.","default":"","type":"string","name":"processKey"},{"_id":"589c1e8d29523b23003ba0c1","ref":"","in":"body","required":false,"desc":"User defined type of the Conversion tracking process or flow type or message type, etc. Example: `ONE_TIME_PIN` or `SOCIAL_INVITES`.","default":"","type":"string","name":"type"},{"_id":"58cfb4266868a21900dab908","ref":"","in":"body","required":false,"desc":"Additional client's data that will be sent on the notifyUrl. The maximum value is 200 characters.","default":"","type":"string","name":"callbackData"}],"url":"/tts/3/advanced"},"isReference":true,"order":13,"body":"# 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## VoiceResponse\n\n|Parameter|Type|Description|\n|-|-|-|\n|*bulkId*|String|The ID that uniquely identifies the request. Bulk ID will be received when a message is sent to more than one destination address.|\n|*messages*|[VoiceResponseDetails[]](#section-voiceresponsedetails)|Array of sent message objects, one object per every message.|\n\n### VoiceResponseDetails\n\n|Parameter|Type|Description|\n|-|-|-|\n|*to*|String|The message destination address.|\n|*status*|[Status](#section-status)|Indicates whether the message has been  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#### 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\n# Pause between words\nAdding pauses between the words and extending the duration of the voice message is possible by using comma character \",\".\n\nFor example if you want to have a 3 second pause after each word, then text parameter should look like this \"one,,,,,,two,,,,,,three,,,,,,\". Each coma will create pause of 0,5 seconds.\n\n# Ring timeout limitations\nThere are no limitations on voice platform regarding this value, however most of the operators have their own ring timeout limitations and it is advisable to keep ringTimeout value up to 45s. \n\n# What is Answering Machine Detection (AMD)?\nThis is just attempt (without guarantee) of answering machine detection based upon patterns in audio stream after receiving an answer signal from the operator. Activities can be defined by setting one of two possible values: disable, hangup.\n\n## Disable (default value)\nThis is default value in case parameter machineDetection is not set in API request. This value represent no usage of AMD option, and during the call there wont be any attempts in detecting answering machine.\n\n## Hangup\nIf parameter machineDetection is set to 'hangup', voice platform will try to detect answering machine, and in case it detects answering machine, call will hang up immediately.\n[block:api-header]\n{\n  \"title\": \"Call Transfers\"\n}\n[/block]\nUsing call transfer, you can send interactive message to your subscriber, providing them the opportunity to respond by pressing their phone keys. When your subscriber choose number, call transfer will redirect call to set number. The Field is JSON formatted.\n\nCall transfer for any DTMF\n```\n[\n  {\n  \t\"if\": \"anydtmf\",\n  \t\"transferTo\": \"79029555525\"\n  }\n]\n```\n\nCall transfer for specific DTMF\n```JSON\n[\n\t{ \n\t\t\"if\": \"dtmf\",\n\t\t\"equals\": \"1\",\n\t\t\"transferTo\": \"79029555525\"\n\t},\n\t{ \n\t\t\"if\": \"dtmf\",\n\t\t\"equals\": \"2\",\n\t\t\"transferTo\": \"79029555551\"\n\t}\n]\n```\n\n###Request example\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"POST /tts/3/advanced HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nContent-Type: application/json\\nAccept: application/json\\n\\n{\\n   \\\"bulkId\\\":\\\"BULK-ID-123-xyz\\\",\\n   \\\"messages\\\":[\\n      {\\n         \\\"from\\\":\\\"41793026700\\\",\\n         \\\"destinations\\\":[\\n            {\\n               \\\"to\\\":\\\"41793026727\\\",\\n               \\\"messageId\\\":\\\"MESSAGE-ID-123-xyz\\\"\\n            },\\n            {\\n               \\\"to\\\":\\\"41793026731\\\"\\n            }\\n         ],\\n         \\\"text\\\": \\\"Test Voice message.\\\",\\n         \\\"language\\\": \\\"en\\\",\\n         \\\"speechRate\\\":1,\\n         \\\"notifyUrl\\\":\\\"http://www.example.com/voice/advanced\\\",\\n         \\\"notifyContentType\\\":\\\"application/json\\\",\\n         \\\"validityPeriod\\\": 720,\\n         \\\"sendAt\\\":\\\"2016-07-07T17:00:00.000+01:00\\\",\\n         \\\"record\\\": false,\\n         \\\"repeatDtmf\\\": \\\"123#\\\",\\n         \\\"ringTimeout\\\": 45,\\n         \\\"dtmfTimeout\\\": 10,\\n         \\\"callTimeout\\\": 130,\\n         \\\"machineDetection\\\": \\\"DISABLE\\\",\\n         \\\"callTransfers\\\": [\\n          {\\n            \\\"if\\\": \\\"dtmf\\\",\\n            \\\"equals\\\": \\\"1\\\",\\n            \\\"transferTo\\\": \\\"79029555525\\\"\\n          },\\n          {\\n            \\\"if\\\": \\\"dtmf\\\",\\n            \\\"equals\\\": \\\"2\\\",\\n            \\\"transferTo\\\": \\\"79029555551\\\"\\n          }\\n         ]\\n         \\n      },\\n      {\\n         \\\"from\\\":\\\"41793026700\\\",\\n         \\\"destinations\\\":[\\n            {\\n               \\\"to\\\":\\\"41793026785\\\"\\n            }\\n         ],\\n         \\\"text\\\":\\\"A long time ago, in a galaxy far.\\\",\\n         \\\"sendAt\\\":\\\"2016-07-07T18:00:00.000+01:00\\\"\\n      }\\n   ]\\n}\",\n      \"language\": \"json\"\n    },\n    {\n      \"code\": \"curl -X POST \\\\\\n-H \\\"Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\" \\\\\\n-H \\\"Content-Type: application/json\\\" \\\\\\n-H \\\"Accept: application/json\\\" \\\\\\n-d '{\\n   \\\"bulkId\\\":\\\"BULK-ID-123-xyz\\\",\\n   \\\"messages\\\":[\\n      {\\n         \\\"from\\\":\\\"41793026700\\\",\\n         \\\"destinations\\\":[\\n            {\\n               \\\"to\\\":\\\"41793026727\\\",\\n               \\\"messageId\\\":\\\"MESSAGE-ID-123-xyz\\\"\\n            },\\n            {\\n               \\\"to\\\":\\\"41793026731\\\"\\n            }\\n         ],\\n         \\\"text\\\": \\\"Test Voice message.\\\",\\n         \\\"language\\\": \\\"en\\\",\\n         \\\"speechRate\\\":1,\\n         \\\"notifyUrl\\\":\\\"http://www.example.com/voice/advanced\\\",\\n         \\\"notifyContentType\\\":\\\"application/json\\\",\\n         \\\"validityPeriod\\\": 720,\\n         \\\"sendAt\\\":\\\"2016-07-07T17:00:00.000+01:00\\\",\\n         \\\"record\\\": false,\\n         \\\"repeatDtmf\\\": \\\"123#\\\",\\n         \\\"ringTimeout\\\": 45,\\n         \\\"dtmfTimeout\\\": 10,\\n         \\\"callTimeout\\\": 130,\\n         \\\"machineDetection\\\": \\\"DISABLE\\\",\\n         \\\"callTransfers\\\": [\\n            {\\n               \\\"if\\\": \\\"dtmf\\\",\\n               \\\"equals\\\": \\\"1\\\",\\n               \\\"transferTo\\\": \\\"79029555525\\\"\\n            },\\n            {\\n               \\\"if\\\": \\\"dtmf\\\",\\n               \\\"equals\\\": \\\"2\\\",\\n               \\\"transferTo\\\": \\\"79029555551\\\"\\n            }\\n         ]\\n      },\\n      {\\n         \\\"from\\\":\\\"41793026700\\\",\\n         \\\"destinations\\\":[\\n            {\\n               \\\"to\\\":\\\"41793026785\\\"\\n            }\\n         ],\\n         \\\"text\\\":\\\"A long time ago, in a galaxy far.\\\",\\n         \\\"sendAt\\\":\\\"2016-07-07T18:00:00.000+01:00\\\"\\n      }\\n   ]\\n}' \\\"http://api.infobip.com/tts/3/advanced\\\"\",\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/tts/3/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 => \\\"{ \\n                          \\\\\\\"bulkId\\\\\\\": \\\\\\\"BULK-ID-123-xyz\\\\\\\",\\n                          \\\\\\\"messages\\\\\\\": [\\n                            {\\n                              \\\\\\\"from\\\\\\\": \\\\\\\"41793026700\\\\\\\",\\n                              \\\\\\\"destinations\\\\\\\": [\\n                                {\\n                                  \\\\\\\"to\\\\\\\": \\\\\\\"41793026727\\\\\\\",\\n                                  \\\\\\\"messageId\\\\\\\": \\\\\\\"MESSAGE-ID-123-xyz\\\\\\\"\\n                                },\\n                                {\\n                                  \\\\\\\"to\\\\\\\": \\\\\\\"41793026731\\\\\\\"\\n                                }\\n                              ],\\n                              \\\\\\\"text\\\\\\\": \\\\\\\"Test Voice message.\\\\\\\",\\n                              \\\\\\\"language\\\\\\\": \\\\\\\"en\\\\\\\",\\n                              \\\\\\\"speechRate\\\\\\\": 1,\\n                              \\\\\\\"notifyUrl\\\\\\\": \\\\\\\"http://www.example.com/voice/advanced\\\\\\\",\\n                              \\\\\\\"notifyContentType\\\\\\\": \\\\\\\"application/json\\\\\\\",\\n                              \\\\\\\"validityPeriod\\\\\\\": 720,\\n                              \\\\\\\"sendAt\\\\\\\": \\\\\\\"2016-07-07T17:00:00.000+01:00\\\\\\\",\\n                              \\\\\\\"record\\\\\\\": false,\\n                              \\\\\\\"repeatDtmf\\\\\\\": \\\\\\\"123#\\\\\\\",\\n                              \\\\\\\"ringTimeout\\\\\\\": 45,\\n                              \\\\\\\"dtmfTimeout\\\\\\\": 10,\\n                              \\\\\\\"callTimeout\\\\\\\": 130,\\n                              \\\\\\\"machineDetection\\\\\\\": \\\\\\\"DISABLE\\\\\\\",\\n                              \\\\\\\"callTransfers\\\\\\\": [\\n                                {\\n                                  \\\\\\\"if\\\\\\\": \\\\\\\"dtmf\\\\\\\",\\n                                  \\\\\\\"equals\\\\\\\": \\\\\\\"1\\\\\\\",\\n                                  \\\\\\\"transferTo\\\\\\\": \\\\\\\"79029555525\\\\\\\"\\n                                },\\n                                {\\n                                  \\\\\\\"if\\\\\\\": \\\\\\\"dtmf\\\\\\\",\\n                                  \\\\\\\"equals\\\\\\\": \\\\\\\"2\\\\\\\",\\n                                  \\\\\\\"transferTo\\\\\\\": \\\\\\\"79029555551\\\\\\\"\\n                                }\\n                              ]\\n                            },\\n                            {\\n                              \\\\\\\"from\\\\\\\": \\\\\\\"41793026700\\\\\\\",\\n                              \\\\\\\"destinations\\\\\\\": [\\n                                {\\n                                  \\\\\\\"to\\\\\\\": \\\\\\\"41793026785\\\\\\\"\\n                                }\\n                              ],\\n                              \\\\\\\"text\\\\\\\": \\\\\\\"A long time ago, in a galaxy far.\\\\\\\",\\n                              \\\\\\\"sendAt\\\\\\\": \\\\\\\"2016-07-07T18:00:00.000+01:00\\\\\\\"\\n                            }\\n                          ]\\n                        }\\\",\\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(\\\"http://api.infobip.com/tts/3/advanced\\\")\\n\\nhttp = Net::HTTP.new(url.host, url.port)\\n\\nrequest = Net::HTTP::Post.new(url)\\nrequest[\\\"authorization\\\"] = 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='\\nrequest[\\\"content-type\\\"] = 'application/json'\\nrequest[\\\"accept\\\"] = 'application/json'\\nrequest.body = \\\"{ \\n                \\\\\\\"bulkId\\\\\\\": \\\\\\\"BULK-ID-123-xyz\\\\\\\",\\n                \\\\\\\"messages\\\\\\\": [\\n                  {\\n                    \\\\\\\"from\\\\\\\": \\\\\\\"41793026700\\\\\\\",\\n                    \\\\\\\"destinations\\\\\\\": [\\n                      {\\n                        \\\\\\\"to\\\\\\\": \\\\\\\"41793026727\\\\\\\",\\n                        \\\\\\\"messageId\\\\\\\": \\\\\\\"MESSAGE-ID-123-xyz\\\\\\\"\\n                      },\\n                      {\\n                        \\\\\\\"to\\\\\\\": \\\\\\\"41793026731\\\\\\\"\\n                      }\\n                    ],\\n                    \\\\\\\"text\\\\\\\": \\\\\\\"Test Voice message.\\\\\\\",\\n                    \\\\\\\"language\\\\\\\": \\\\\\\"en\\\\\\\",\\n                    \\\\\\\"speechRate\\\\\\\": 1,\\n                    \\\\\\\"notifyUrl\\\\\\\": \\\\\\\"http://www.example.com/voice/advanced\\\\\\\",\\n                    \\\\\\\"notifyContentType\\\\\\\": \\\\\\\"application/json\\\\\\\",\\n                    \\\\\\\"validityPeriod\\\\\\\": 720,\\n                    \\\\\\\"sendAt\\\\\\\": \\\\\\\"2016-07-07T17:00:00.000+01:00\\\\\\\",\\n                    \\\\\\\"record\\\\\\\": false,\\n                    \\\\\\\"repeatDtmf\\\\\\\": \\\\\\\"123#\\\\\\\",\\n                    \\\\\\\"ringTimeout\\\\\\\": 45,\\n                    \\\\\\\"dtmfTimeout\\\\\\\": 10,\\n                    \\\\\\\"callTimeout\\\\\\\": 130,\\n                    \\\\\\\"machineDetection\\\\\\\": \\\\\\\"DISABLE\\\\\\\",\\n                    \\\\\\\"callTransfers\\\\\\\": [\\n                                {\\n                                  \\\\\\\"if\\\\\\\": \\\\\\\"dtmf\\\\\\\",\\n                                  \\\\\\\"equals\\\\\\\": \\\\\\\"1\\\\\\\",\\n                                  \\\\\\\"transferTo\\\\\\\": \\\\\\\"79029555525\\\\\\\"\\n                                },\\n                                {\\n                                  \\\\\\\"if\\\\\\\": \\\\\\\"dtmf\\\\\\\",\\n                                  \\\\\\\"equals\\\\\\\": \\\\\\\"2\\\\\\\",\\n                                  \\\\\\\"transferTo\\\\\\\": \\\\\\\"79029555551\\\\\\\"\\n                                }\\n                              ]\\n                  },\\n                  {\\n                    \\\\\\\"from\\\\\\\": \\\\\\\"41793026700\\\\\\\",\\n                    \\\\\\\"destinations\\\\\\\": [\\n                      {\\n                        \\\\\\\"to\\\\\\\": \\\\\\\"41793026785\\\\\\\"\\n                      }\\n                    ],\\n                    \\\\\\\"text\\\\\\\": \\\\\\\"A long time ago, in a galaxy far.\\\\\\\",\\n                    \\\\\\\"sendAt\\\\\\\": \\\\\\\"2016-07-07T18:00:00.000+01:00\\\\\\\"\\n                  }\\n                ]\\n              }\\\"\\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\\npayload = \\\"{ \\n            \\\\\\\"bulkId\\\\\\\": \\\\\\\"BULK-ID-123-xyz\\\\\\\",\\n            \\\\\\\"messages\\\\\\\": [\\n              {\\n                \\\\\\\"from\\\\\\\": \\\\\\\"41793026700\\\\\\\",\\n                \\\\\\\"destinations\\\\\\\": [\\n                  {\\n                    \\\\\\\"to\\\\\\\": \\\\\\\"41793026727\\\\\\\",\\n                    \\\\\\\"messageId\\\\\\\": \\\\\\\"MESSAGE-ID-123-xyz\\\\\\\"\\n                  },\\n                  {\\n                    \\\\\\\"to\\\\\\\": \\\\\\\"41793026731\\\\\\\"\\n                  }\\n                ],\\n                \\\\\\\"text\\\\\\\": \\\\\\\"Test Voice message.\\\\\\\",\\n                \\\\\\\"language\\\\\\\": \\\\\\\"en\\\\\\\",\\n                \\\\\\\"speechRate\\\\\\\": 1,\\n                \\\\\\\"notifyUrl\\\\\\\": \\\\\\\"http://www.example.com/voice/advanced\\\\\\\",\\n                \\\\\\\"notifyContentType\\\\\\\": \\\\\\\"application/json\\\\\\\",\\n                \\\\\\\"validityPeriod\\\\\\\": 720,\\n                \\\\\\\"sendAt\\\\\\\": \\\\\\\"2016-07-07T17:00:00.000+01:00\\\\\\\",\\n                \\\\\\\"record\\\\\\\": false,\\n                \\\\\\\"repeatDtmf\\\\\\\": \\\\\\\"123#\\\\\\\",\\n                \\\\\\\"ringTimeout\\\\\\\": 45,\\n                \\\\\\\"dtmfTimeout\\\\\\\": 10,\\n                \\\\\\\"callTimeout\\\\\\\": 130,\\n                \\\\\\\"machineDetection\\\\\\\": \\\\\\\"DISABLE\\\\\\\",\\n                \\\\\\\"callTransfers\\\\\\\": [\\n                                {\\n                                  \\\\\\\"if\\\\\\\": \\\\\\\"dtmf\\\\\\\",\\n                                  \\\\\\\"equals\\\\\\\": \\\\\\\"1\\\\\\\",\\n                                  \\\\\\\"transferTo\\\\\\\": \\\\\\\"79029555525\\\\\\\"\\n                                },\\n                                {\\n                                  \\\\\\\"if\\\\\\\": \\\\\\\"dtmf\\\\\\\",\\n                                  \\\\\\\"equals\\\\\\\": \\\\\\\"2\\\\\\\",\\n                                  \\\\\\\"transferTo\\\\\\\": \\\\\\\"79029555551\\\\\\\"\\n                                }\\n                              ]\\n              },\\n              {\\n                \\\\\\\"from\\\\\\\": \\\\\\\"41793026700\\\\\\\",\\n                \\\\\\\"destinations\\\\\\\": [\\n                  {\\n                    \\\\\\\"to\\\\\\\": \\\\\\\"41793026785\\\\\\\"\\n                  }\\n                ],\\n                \\\\\\\"text\\\\\\\": \\\\\\\"A long time ago, in a galaxy far.\\\\\\\",\\n                \\\\\\\"sendAt\\\\\\\": \\\\\\\"2016-07-07T18:00:00.000+01:00\\\\\\\"\\n              }\\n            ]\\n          }\\\"\\n\\nheaders = {\\n    'authorization': \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\",\\n    'content-type': \\\"application/json\\\",\\n    'accept': \\\"application/json\\\"\\n    }\\n\\nconn.request(\\\"POST\\\", \\\"/tts/3/advanced\\\", 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(\\\"http://api.infobip.com/tts/3/advanced\\\")\\n  .header(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\")\\n  .header(\\\"content-type\\\", \\\"application/json\\\")\\n  .header(\\\"accept\\\", \\\"application/json\\\")\\n  .body(\\\"{ \\n          \\\\\\\"bulkId\\\\\\\": \\\\\\\"BULK-ID-123-xyz\\\\\\\",\\n          \\\\\\\"messages\\\\\\\": [\\n            {\\n              \\\\\\\"from\\\\\\\": \\\\\\\"41793026700\\\\\\\",\\n              \\\\\\\"destinations\\\\\\\": [\\n                {\\n                  \\\\\\\"to\\\\\\\": \\\\\\\"41793026727\\\\\\\",\\n                  \\\\\\\"messageId\\\\\\\": \\\\\\\"MESSAGE-ID-123-xyz\\\\\\\"\\n                },\\n                {\\n                  \\\\\\\"to\\\\\\\": \\\\\\\"41793026731\\\\\\\"\\n                }\\n              ],\\n              \\\\\\\"text\\\\\\\": \\\\\\\"Test Voice message.\\\\\\\",\\n              \\\\\\\"language\\\\\\\": \\\\\\\"en\\\\\\\",\\n              \\\\\\\"speechRate\\\\\\\": 1,\\n              \\\\\\\"notifyUrl\\\\\\\": \\\\\\\"http://www.example.com/voice/advanced\\\\\\\",\\n              \\\\\\\"notifyContentType\\\\\\\": \\\\\\\"application/json\\\\\\\",\\n              \\\\\\\"validityPeriod\\\\\\\": 720,\\n              \\\\\\\"sendAt\\\\\\\": \\\\\\\"2016-07-07T17:00:00.000+01:00\\\\\\\",\\n              \\\\\\\"record\\\\\\\": false,\\n              \\\\\\\"repeatDtmf\\\\\\\": \\\\\\\"123#\\\\\\\",\\n              \\\\\\\"ringTimeout\\\\\\\": 45,\\n              \\\\\\\"dtmfTimeout\\\\\\\": 10,\\n              \\\\\\\"callTimeout\\\\\\\": 130,\\n              \\\\\\\"machineDetection\\\\\\\": \\\\\\\"DISABLE\\\\\\\",\\n              \\\\\\\"callTransfers\\\\\\\": [\\n                                {\\n                                  \\\\\\\"if\\\\\\\": \\\\\\\"dtmf\\\\\\\",\\n                                  \\\\\\\"equals\\\\\\\": \\\\\\\"1\\\\\\\",\\n                                  \\\\\\\"transferTo\\\\\\\": \\\\\\\"79029555525\\\\\\\"\\n                                },\\n                                {\\n                                  \\\\\\\"if\\\\\\\": \\\\\\\"dtmf\\\\\\\",\\n                                  \\\\\\\"equals\\\\\\\": \\\\\\\"2\\\\\\\",\\n                                  \\\\\\\"transferTo\\\\\\\": \\\\\\\"79029555551\\\\\\\"\\n                                }\\n                              ]\\n            },\\n            {\\n              \\\\\\\"from\\\\\\\": \\\\\\\"41793026700\\\\\\\",\\n              \\\\\\\"destinations\\\\\\\": [\\n                {\\n                  \\\\\\\"to\\\\\\\": \\\\\\\"41793026785\\\\\\\"\\n                }\\n              ],\\n              \\\\\\\"text\\\\\\\": \\\\\\\"A long time ago, in a galaxy far.\\\\\\\",\\n              \\\\\\\"sendAt\\\\\\\": \\\\\\\"2016-07-07T18:00:00.000+01:00\\\\\\\"\\n            }\\n          ]\\n        }\\\")\\n  .asString();\",\n      \"language\": \"java\"\n    },\n    {\n      \"code\": \"var client = new RestClient(\\\"http://api.infobip.com/tts/3/advanced\\\");\\nvar request = new RestRequest(Method.POST);\\nrequest.AddHeader(\\\"accept\\\", \\\"application/json\\\");\\nrequest.AddHeader(\\\"content-type\\\", \\\"application/json\\\");\\nrequest.AddHeader(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\");\\nrequest.AddParameter(\\\"application/json\\\", \\n                    \\\"{ \\n                      \\\\\\\"bulkId\\\\\\\": \\\\\\\"BULK-ID-123-xyz\\\\\\\",\\n                      \\\\\\\"messages\\\\\\\": [\\n                        {\\n                          \\\\\\\"from\\\\\\\": \\\\\\\"41793026700\\\\\\\",\\n                          \\\\\\\"destinations\\\\\\\": [\\n                            {\\n                              \\\\\\\"to\\\\\\\": \\\\\\\"41793026727\\\\\\\",\\n                              \\\\\\\"messageId\\\\\\\": \\\\\\\"MESSAGE-ID-123-xyz\\\\\\\"\\n                            },\\n                            {\\n                              \\\\\\\"to\\\\\\\": \\\\\\\"41793026731\\\\\\\"\\n                            }\\n                          ],\\n                          \\\\\\\"text\\\\\\\": \\\\\\\"Test Voice message.\\\\\\\",\\n                          \\\\\\\"language\\\\\\\": \\\\\\\"en\\\\\\\",\\n                          \\\\\\\"speechRate\\\\\\\": 1,\\n                          \\\\\\\"notifyUrl\\\\\\\": \\\\\\\"http://www.example.com/voice/advanced\\\\\\\",\\n                          \\\\\\\"notifyContentType\\\\\\\": \\\\\\\"application/json\\\\\\\",\\n                          \\\\\\\"validityPeriod\\\\\\\": 720,\\n                          \\\\\\\"sendAt\\\\\\\": \\\\\\\"2016-07-07T17:00:00.000+01:00\\\\\\\",\\n                          \\\\\\\"record\\\\\\\": false,\\n                          \\\\\\\"repeatDtmf\\\\\\\": \\\\\\\"123#\\\\\\\",\\n                          \\\\\\\"ringTimeout\\\\\\\": 45,\\n                          \\\\\\\"dtmfTimeout\\\\\\\": 10,\\n                          \\\\\\\"callTimeout\\\\\\\": 130,\\n                          \\\\\\\"machineDetection\\\\\\\": \\\\\\\"DISABLE\\\\\\\",\\n                          \\\\\\\"callTransfers\\\\\\\": [\\n                                {\\n                                  \\\\\\\"if\\\\\\\": \\\\\\\"dtmf\\\\\\\",\\n                                  \\\\\\\"equals\\\\\\\": \\\\\\\"1\\\\\\\",\\n                                  \\\\\\\"transferTo\\\\\\\": \\\\\\\"79029555525\\\\\\\"\\n                                },\\n                                {\\n                                  \\\\\\\"if\\\\\\\": \\\\\\\"dtmf\\\\\\\",\\n                                  \\\\\\\"equals\\\\\\\": \\\\\\\"2\\\\\\\",\\n                                  \\\\\\\"transferTo\\\\\\\": \\\\\\\"79029555551\\\\\\\"\\n                                }\\n                              ]\\n                        },\\n                        {\\n                          \\\\\\\"from\\\\\\\": \\\\\\\"41793026700\\\\\\\",\\n                          \\\\\\\"destinations\\\\\\\": [\\n                            {\\n                              \\\\\\\"to\\\\\\\": \\\\\\\"41793026785\\\\\\\"\\n                            }\\n                          ],\\n                          \\\\\\\"text\\\\\\\": \\\\\\\"A long time ago, in a galaxy far.\\\\\\\",\\n                          \\\\\\\"sendAt\\\\\\\": \\\\\\\"2016-07-07T18:00:00.000+01:00\\\\\\\"\\n                        }\\n                      ]\\n                    }\\\", \\n                    ParameterType.RequestBody);\\nIRestResponse response = client.Execute(request);\",\n      \"language\": \"csharp\"\n    },\n    {\n      \"code\": \"var data = JSON.stringify({\\n  \\\"bulkId\\\": \\\"BULK-ID-123-xyz\\\",\\n  \\\"messages\\\": [\\n    {\\n      \\\"from\\\": \\\"41793026700\\\",\\n      \\\"destinations\\\": [\\n        { \\n          \\\"to\\\": \\\"41793026727\\\",\\n          \\\"messageId\\\": \\\"MESSAGE-ID-123-xyz\\\"\\n        },\\n        {\\n          \\\"to\\\": \\\"41793026731\\\"\\n        }\\n      ],\\n      \\\"text\\\": \\\"Test Voice message.\\\",\\n      \\\"language\\\": \\\"en\\\",\\n      \\\"speechRate\\\": 1,\\n      \\\"notifyUrl\\\": \\\"http://www.example.com/voice/advanced\\\",\\n      \\\"notifyContentType\\\": \\\"application/json\\\",\\n      \\\"validityPeriod\\\": 720,\\n      \\\"sendAt\\\": \\\"2016-07-07T17:00:00.000+01:00\\\",\\n      \\\"record\\\": false,\\n      \\\"repeatDtmf\\\": \\\"123#\\\",\\n      \\\"ringTimeout\\\": 45,\\n      \\\"dtmfTimeout\\\": 10,\\n      \\\"callTimeout\\\": 130,\\n      \\\"machineDetection\\\": \\\"DISABLE\\\",\\n      \\\"callTransfers\\\": [\\n          {\\n            \\\"if\\\": \\\"dtmf\\\",\\n            \\\"equals\\\": \\\"1\\\",\\n            \\\"transferTo\\\": \\\"79029555525\\\"\\n          },\\n          {\\n            \\\"if\\\": \\\"dtmf\\\",\\n            \\\"equals\\\": \\\"2\\\",\\n            \\\"transferTo\\\": \\\"79029555551\\\"\\n          }\\n         ]\\n      \\n    },\\n    {\\n      \\\"from\\\": \\\"41793026700\\\",\\n      \\\"destinations\\\": [\\n        {\\n          \\\"to\\\": \\\"41793026785\\\"\\n        }\\n      ],\\n      \\\"text\\\": \\\"A long time ago, in a galaxy far.\\\",\\n      \\\"sendAt\\\": \\\"2016-07-07T18:00:00.000+01:00\\\"\\n    }\\n  ]\\n});\\n\\nvar xhr = new XMLHttpRequest();\\nxhr.withCredentials = true;\\n\\nxhr.addEventListener(\\\"readystatechange\\\", function () {\\n  if (this.readyState === 4) {\\n    console.log(this.responseText);\\n  }\\n});\\n\\nxhr.open(\\\"POST\\\", \\\"http://api.infobip.com/tts/3/advanced\\\");\\nxhr.setRequestHeader(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\");\\nxhr.setRequestHeader(\\\"content-type\\\", \\\"application/json\\\");\\nxhr.setRequestHeader(\\\"accept\\\", \\\"application/json\\\");\\n\\nxhr.send(data);\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n## API response\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"bulkId\\\": \\\"BULK-ID-123-xyz\\\",\\n  \\\"messages\\\": [\\n    {\\n      \\\"to\\\": \\\"41793026727\\\",\\n      \\\"status\\\": {\\n        \\\"groupId\\\": 1,\\n        \\\"groupName\\\": \\\"PENDING\\\",\\n        \\\"id\\\": 26,\\n        \\\"name\\\": \\\"PENDING_ACCEPTED\\\",\\n        \\\"description\\\": \\\"Message accepted, pending for delivery.\\\"\\n      },\\n      \\\"messageId\\\": \\\"MESSAGE-ID-123-xyz\\\"\\n    },\\n    {\\n      \\\"to\\\": \\\"41793026731\\\",\\n      \\\"status\\\": {\\n        \\\"groupId\\\": 1,\\n        \\\"groupName\\\": \\\"PENDING\\\",\\n        \\\"id\\\": 26,\\n        \\\"name\\\": \\\"PENDING_ACCEPTED\\\",\\n        \\\"description\\\": \\\"Message accepted, pending for delivery.\\\"\\n      },\\n      \\\"messageId\\\":\\\"9304a5a3ab19-1ca1-be74-76ad87651ed25f35\\\"\\n    },\\n    {\\n      \\\"to\\\": \\\"79029555525\\\",\\n      \\\"status\\\": {\\n        \\\"groupId\\\": 1,\\n        \\\"groupName\\\": \\\"PENDING\\\",\\n        \\\"id\\\": 26,\\n        \\\"name\\\": \\\"PENDING_ACCEPTED\\\",\\n        \\\"description\\\": \\\"Message accepted, pending for delivery.\\\"\\n      },\\n      \\\"messageId\\\":\\\"f0401b7b-5c44-4a62-8a1b-61ec26101ff0\\\"\\n    }\\n  ]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","excerpt":"This method allows you to send advanced voice messages with the all available features and parameters.","slug":"fully-featured-voice-messages","type":"endpoint","title":"OLD - Fully featured voice messages"}

postOLD - Fully featured voice messages

This method allows you to send advanced voice messages with the all available features and parameters.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

bulkId:
string
The ID which uniquely identifies the request.
from:
string12345
Numeric sender ID length should be between 3 and 14 characters.
to:
required
array of strings
Array of message destination addresses. Destination address must be in the international format (Example: 41793026727).
messageId:
string
The ID that uniquely identifies the message sent.
text:
string
Text of the message that will be sent. [Pause](#section-pause-between-words) between words is possible.
language:
stringen
If the message is in text format, language in which the message is written must be defined for correct pronunciation. Below, in the 'Languages' section, you can find the list of languages that we support.
audioFileUrl:
string
Besides the text format of the message, audio recording (in waw or mp3 format) can also be delivered as a voice message to the recipient. Audio file must be uploaded online so the existing URL can be available for the file download. Size of the audio file must be below 4 MB.
speechRate:
double1
The reproduction speed of speech in the resulting message. Effective only when using text. Supported range is from 0.5 (slow down speech) to 2 (speed up speech). Values less than 0.5 will be replaced with 0.5, and values higher than 2 will be replaced with 2.
notifyUrl:
string
The URL on your callback server on which the [Delivery report](http://dev.infobip.com/v1/docs/delivery-reports) will be sent.
notifyContentType:
string
Preferred Delivery report content type. Can be `application/json` or `application/xml`.
validityPeriod:
integer
The message validity period shown in minutes. When the period expires, it will not be allowed for the message to be sent. A validity period longer than 48h is not supported (in this case, it will be automatically set to 48h).
sendAt:
datetime
Used for scheduled Voice messages (message not to be sent immediately, but at scheduled time).
record:
booleanfalse
Record the call and expose it to client as URL inside the delivery report. Can be `true` or `false`.
repeatDtmf:
string
Response (DTMF) code which enables repeating message if a subscriber enters it.
ringTimeout:
integer45
The duration of the call prior to answer shown in seconds, unless there are no [operator limitations](#section-ring-timeout-limitations).
dtmfTimeout:
integer10
The waiting period for end user to enter dtmf digits.
callTimeout:
integer
Total call period shown in seconds.
machineDetection:
stringdisable
This action attempts to detect answering machines at the beginning of the call. Possible values: ['disable'](#section-disable-default-value-), ['hangup'](#section-hangup).
callTransfers:
array of objects
Possible call transfer scenario defined as JSON object. See <a href="#call-transfers">example below</a>
track:
string
Indicates if the message has to be tracked for Conversion rates. Possible values: `VOICE`.
processKey:
string
Key that uniquely identifies Conversion tracking process.
type:
string
User defined type of the Conversion tracking process or flow type or message type, etc. Example: `ONE_TIME_PIN` or `SOCIAL_INVITES`.
callbackData:
string
Additional client's data that will be sent on the notifyUrl. The maximum value is 200 characters.

Examples


Result Format


Documentation

# 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. ## VoiceResponse |Parameter|Type|Description| |-|-|-| |*bulkId*|String|The ID that uniquely identifies the request. Bulk ID will be received when a message is sent to more than one destination address.| |*messages*|[VoiceResponseDetails[]](#section-voiceresponsedetails)|Array of sent message objects, one object per every message.| ### VoiceResponseDetails |Parameter|Type|Description| |-|-|-| |*to*|String|The message destination address.| |*status*|[Status](#section-status)|Indicates whether the message has been 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.| #### 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.| # Pause between words Adding pauses between the words and extending the duration of the voice message is possible by using comma character ",". For example if you want to have a 3 second pause after each word, then text parameter should look like this "one,,,,,,two,,,,,,three,,,,,,". Each coma will create pause of 0,5 seconds. # Ring timeout limitations There are no limitations on voice platform regarding this value, however most of the operators have their own ring timeout limitations and it is advisable to keep ringTimeout value up to 45s. # What is Answering Machine Detection (AMD)? This is just attempt (without guarantee) of answering machine detection based upon patterns in audio stream after receiving an answer signal from the operator. Activities can be defined by setting one of two possible values: disable, hangup. ## Disable (default value) This is default value in case parameter machineDetection is not set in API request. This value represent no usage of AMD option, and during the call there wont be any attempts in detecting answering machine. ## Hangup If parameter machineDetection is set to 'hangup', voice platform will try to detect answering machine, and in case it detects answering machine, call will hang up immediately. [block:api-header] { "title": "Call Transfers" } [/block] Using call transfer, you can send interactive message to your subscriber, providing them the opportunity to respond by pressing their phone keys. When your subscriber choose number, call transfer will redirect call to set number. The Field is JSON formatted. Call transfer for any DTMF ``` [ { "if": "anydtmf", "transferTo": "79029555525" } ] ``` Call transfer for specific DTMF ```JSON [ { "if": "dtmf", "equals": "1", "transferTo": "79029555525" }, { "if": "dtmf", "equals": "2", "transferTo": "79029555551" } ] ``` ###Request example [block:code] { "codes": [ { "code": "POST /tts/3/advanced HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/json\nAccept: application/json\n\n{\n \"bulkId\":\"BULK-ID-123-xyz\",\n \"messages\":[\n {\n \"from\":\"41793026700\",\n \"destinations\":[\n {\n \"to\":\"41793026727\",\n \"messageId\":\"MESSAGE-ID-123-xyz\"\n },\n {\n \"to\":\"41793026731\"\n }\n ],\n \"text\": \"Test Voice message.\",\n \"language\": \"en\",\n \"speechRate\":1,\n \"notifyUrl\":\"http://www.example.com/voice/advanced\",\n \"notifyContentType\":\"application/json\",\n \"validityPeriod\": 720,\n \"sendAt\":\"2016-07-07T17:00:00.000+01:00\",\n \"record\": false,\n \"repeatDtmf\": \"123#\",\n \"ringTimeout\": 45,\n \"dtmfTimeout\": 10,\n \"callTimeout\": 130,\n \"machineDetection\": \"DISABLE\",\n \"callTransfers\": [\n {\n \"if\": \"dtmf\",\n \"equals\": \"1\",\n \"transferTo\": \"79029555525\"\n },\n {\n \"if\": \"dtmf\",\n \"equals\": \"2\",\n \"transferTo\": \"79029555551\"\n }\n ]\n \n },\n {\n \"from\":\"41793026700\",\n \"destinations\":[\n {\n \"to\":\"41793026785\"\n }\n ],\n \"text\":\"A long time ago, in a galaxy far.\",\n \"sendAt\":\"2016-07-07T18:00:00.000+01:00\"\n }\n ]\n}", "language": "json" }, { "code": "curl -X POST \\\n-H \"Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\" \\\n-H \"Content-Type: application/json\" \\\n-H \"Accept: application/json\" \\\n-d '{\n \"bulkId\":\"BULK-ID-123-xyz\",\n \"messages\":[\n {\n \"from\":\"41793026700\",\n \"destinations\":[\n {\n \"to\":\"41793026727\",\n \"messageId\":\"MESSAGE-ID-123-xyz\"\n },\n {\n \"to\":\"41793026731\"\n }\n ],\n \"text\": \"Test Voice message.\",\n \"language\": \"en\",\n \"speechRate\":1,\n \"notifyUrl\":\"http://www.example.com/voice/advanced\",\n \"notifyContentType\":\"application/json\",\n \"validityPeriod\": 720,\n \"sendAt\":\"2016-07-07T17:00:00.000+01:00\",\n \"record\": false,\n \"repeatDtmf\": \"123#\",\n \"ringTimeout\": 45,\n \"dtmfTimeout\": 10,\n \"callTimeout\": 130,\n \"machineDetection\": \"DISABLE\",\n \"callTransfers\": [\n {\n \"if\": \"dtmf\",\n \"equals\": \"1\",\n \"transferTo\": \"79029555525\"\n },\n {\n \"if\": \"dtmf\",\n \"equals\": \"2\",\n \"transferTo\": \"79029555551\"\n }\n ]\n },\n {\n \"from\":\"41793026700\",\n \"destinations\":[\n {\n \"to\":\"41793026785\"\n }\n ],\n \"text\":\"A long time ago, in a galaxy far.\",\n \"sendAt\":\"2016-07-07T18:00:00.000+01:00\"\n }\n ]\n}' \"http://api.infobip.com/tts/3/advanced\"", "language": "curl" }, { "code": "<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, array(\n CURLOPT_URL => \"http://api.infobip.com/tts/3/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 => \"{ \n \\\"bulkId\\\": \\\"BULK-ID-123-xyz\\\",\n \\\"messages\\\": [\n {\n \\\"from\\\": \\\"41793026700\\\",\n \\\"destinations\\\": [\n {\n \\\"to\\\": \\\"41793026727\\\",\n \\\"messageId\\\": \\\"MESSAGE-ID-123-xyz\\\"\n },\n {\n \\\"to\\\": \\\"41793026731\\\"\n }\n ],\n \\\"text\\\": \\\"Test Voice message.\\\",\n \\\"language\\\": \\\"en\\\",\n \\\"speechRate\\\": 1,\n \\\"notifyUrl\\\": \\\"http://www.example.com/voice/advanced\\\",\n \\\"notifyContentType\\\": \\\"application/json\\\",\n \\\"validityPeriod\\\": 720,\n \\\"sendAt\\\": \\\"2016-07-07T17:00:00.000+01:00\\\",\n \\\"record\\\": false,\n \\\"repeatDtmf\\\": \\\"123#\\\",\n \\\"ringTimeout\\\": 45,\n \\\"dtmfTimeout\\\": 10,\n \\\"callTimeout\\\": 130,\n \\\"machineDetection\\\": \\\"DISABLE\\\",\n \\\"callTransfers\\\": [\n {\n \\\"if\\\": \\\"dtmf\\\",\n \\\"equals\\\": \\\"1\\\",\n \\\"transferTo\\\": \\\"79029555525\\\"\n },\n {\n \\\"if\\\": \\\"dtmf\\\",\n \\\"equals\\\": \\\"2\\\",\n \\\"transferTo\\\": \\\"79029555551\\\"\n }\n ]\n },\n {\n \\\"from\\\": \\\"41793026700\\\",\n \\\"destinations\\\": [\n {\n \\\"to\\\": \\\"41793026785\\\"\n }\n ],\n \\\"text\\\": \\\"A long time ago, in a galaxy far.\\\",\n \\\"sendAt\\\": \\\"2016-07-07T18:00:00.000+01:00\\\"\n }\n ]\n }\",\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(\"http://api.infobip.com/tts/3/advanced\")\n\nhttp = Net::HTTP.new(url.host, url.port)\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"authorization\"] = 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='\nrequest[\"content-type\"] = 'application/json'\nrequest[\"accept\"] = 'application/json'\nrequest.body = \"{ \n \\\"bulkId\\\": \\\"BULK-ID-123-xyz\\\",\n \\\"messages\\\": [\n {\n \\\"from\\\": \\\"41793026700\\\",\n \\\"destinations\\\": [\n {\n \\\"to\\\": \\\"41793026727\\\",\n \\\"messageId\\\": \\\"MESSAGE-ID-123-xyz\\\"\n },\n {\n \\\"to\\\": \\\"41793026731\\\"\n }\n ],\n \\\"text\\\": \\\"Test Voice message.\\\",\n \\\"language\\\": \\\"en\\\",\n \\\"speechRate\\\": 1,\n \\\"notifyUrl\\\": \\\"http://www.example.com/voice/advanced\\\",\n \\\"notifyContentType\\\": \\\"application/json\\\",\n \\\"validityPeriod\\\": 720,\n \\\"sendAt\\\": \\\"2016-07-07T17:00:00.000+01:00\\\",\n \\\"record\\\": false,\n \\\"repeatDtmf\\\": \\\"123#\\\",\n \\\"ringTimeout\\\": 45,\n \\\"dtmfTimeout\\\": 10,\n \\\"callTimeout\\\": 130,\n \\\"machineDetection\\\": \\\"DISABLE\\\",\n \\\"callTransfers\\\": [\n {\n \\\"if\\\": \\\"dtmf\\\",\n \\\"equals\\\": \\\"1\\\",\n \\\"transferTo\\\": \\\"79029555525\\\"\n },\n {\n \\\"if\\\": \\\"dtmf\\\",\n \\\"equals\\\": \\\"2\\\",\n \\\"transferTo\\\": \\\"79029555551\\\"\n }\n ]\n },\n {\n \\\"from\\\": \\\"41793026700\\\",\n \\\"destinations\\\": [\n {\n \\\"to\\\": \\\"41793026785\\\"\n }\n ],\n \\\"text\\\": \\\"A long time ago, in a galaxy far.\\\",\n \\\"sendAt\\\": \\\"2016-07-07T18:00:00.000+01:00\\\"\n }\n ]\n }\"\n\nresponse = http.request(request)\nputs response.read_body", "language": "ruby" }, { "code": "import http.client\n\nconn = http.client.HTTPConnection(\"api.infobip.com\")\n\npayload = \"{ \n \\\"bulkId\\\": \\\"BULK-ID-123-xyz\\\",\n \\\"messages\\\": [\n {\n \\\"from\\\": \\\"41793026700\\\",\n \\\"destinations\\\": [\n {\n \\\"to\\\": \\\"41793026727\\\",\n \\\"messageId\\\": \\\"MESSAGE-ID-123-xyz\\\"\n },\n {\n \\\"to\\\": \\\"41793026731\\\"\n }\n ],\n \\\"text\\\": \\\"Test Voice message.\\\",\n \\\"language\\\": \\\"en\\\",\n \\\"speechRate\\\": 1,\n \\\"notifyUrl\\\": \\\"http://www.example.com/voice/advanced\\\",\n \\\"notifyContentType\\\": \\\"application/json\\\",\n \\\"validityPeriod\\\": 720,\n \\\"sendAt\\\": \\\"2016-07-07T17:00:00.000+01:00\\\",\n \\\"record\\\": false,\n \\\"repeatDtmf\\\": \\\"123#\\\",\n \\\"ringTimeout\\\": 45,\n \\\"dtmfTimeout\\\": 10,\n \\\"callTimeout\\\": 130,\n \\\"machineDetection\\\": \\\"DISABLE\\\",\n \\\"callTransfers\\\": [\n {\n \\\"if\\\": \\\"dtmf\\\",\n \\\"equals\\\": \\\"1\\\",\n \\\"transferTo\\\": \\\"79029555525\\\"\n },\n {\n \\\"if\\\": \\\"dtmf\\\",\n \\\"equals\\\": \\\"2\\\",\n \\\"transferTo\\\": \\\"79029555551\\\"\n }\n ]\n },\n {\n \\\"from\\\": \\\"41793026700\\\",\n \\\"destinations\\\": [\n {\n \\\"to\\\": \\\"41793026785\\\"\n }\n ],\n \\\"text\\\": \\\"A long time ago, in a galaxy far.\\\",\n \\\"sendAt\\\": \\\"2016-07-07T18:00:00.000+01:00\\\"\n }\n ]\n }\"\n\nheaders = {\n 'authorization': \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\",\n 'content-type': \"application/json\",\n 'accept': \"application/json\"\n }\n\nconn.request(\"POST\", \"/tts/3/advanced\", payload, headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))", "language": "python" }, { "code": "HttpResponse<String> response = Unirest.post(\"http://api.infobip.com/tts/3/advanced\")\n .header(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\")\n .header(\"content-type\", \"application/json\")\n .header(\"accept\", \"application/json\")\n .body(\"{ \n \\\"bulkId\\\": \\\"BULK-ID-123-xyz\\\",\n \\\"messages\\\": [\n {\n \\\"from\\\": \\\"41793026700\\\",\n \\\"destinations\\\": [\n {\n \\\"to\\\": \\\"41793026727\\\",\n \\\"messageId\\\": \\\"MESSAGE-ID-123-xyz\\\"\n },\n {\n \\\"to\\\": \\\"41793026731\\\"\n }\n ],\n \\\"text\\\": \\\"Test Voice message.\\\",\n \\\"language\\\": \\\"en\\\",\n \\\"speechRate\\\": 1,\n \\\"notifyUrl\\\": \\\"http://www.example.com/voice/advanced\\\",\n \\\"notifyContentType\\\": \\\"application/json\\\",\n \\\"validityPeriod\\\": 720,\n \\\"sendAt\\\": \\\"2016-07-07T17:00:00.000+01:00\\\",\n \\\"record\\\": false,\n \\\"repeatDtmf\\\": \\\"123#\\\",\n \\\"ringTimeout\\\": 45,\n \\\"dtmfTimeout\\\": 10,\n \\\"callTimeout\\\": 130,\n \\\"machineDetection\\\": \\\"DISABLE\\\",\n \\\"callTransfers\\\": [\n {\n \\\"if\\\": \\\"dtmf\\\",\n \\\"equals\\\": \\\"1\\\",\n \\\"transferTo\\\": \\\"79029555525\\\"\n },\n {\n \\\"if\\\": \\\"dtmf\\\",\n \\\"equals\\\": \\\"2\\\",\n \\\"transferTo\\\": \\\"79029555551\\\"\n }\n ]\n },\n {\n \\\"from\\\": \\\"41793026700\\\",\n \\\"destinations\\\": [\n {\n \\\"to\\\": \\\"41793026785\\\"\n }\n ],\n \\\"text\\\": \\\"A long time ago, in a galaxy far.\\\",\n \\\"sendAt\\\": \\\"2016-07-07T18:00:00.000+01:00\\\"\n }\n ]\n }\")\n .asString();", "language": "java" }, { "code": "var client = new RestClient(\"http://api.infobip.com/tts/3/advanced\");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"accept\", \"application/json\");\nrequest.AddHeader(\"content-type\", \"application/json\");\nrequest.AddHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\");\nrequest.AddParameter(\"application/json\", \n \"{ \n \\\"bulkId\\\": \\\"BULK-ID-123-xyz\\\",\n \\\"messages\\\": [\n {\n \\\"from\\\": \\\"41793026700\\\",\n \\\"destinations\\\": [\n {\n \\\"to\\\": \\\"41793026727\\\",\n \\\"messageId\\\": \\\"MESSAGE-ID-123-xyz\\\"\n },\n {\n \\\"to\\\": \\\"41793026731\\\"\n }\n ],\n \\\"text\\\": \\\"Test Voice message.\\\",\n \\\"language\\\": \\\"en\\\",\n \\\"speechRate\\\": 1,\n \\\"notifyUrl\\\": \\\"http://www.example.com/voice/advanced\\\",\n \\\"notifyContentType\\\": \\\"application/json\\\",\n \\\"validityPeriod\\\": 720,\n \\\"sendAt\\\": \\\"2016-07-07T17:00:00.000+01:00\\\",\n \\\"record\\\": false,\n \\\"repeatDtmf\\\": \\\"123#\\\",\n \\\"ringTimeout\\\": 45,\n \\\"dtmfTimeout\\\": 10,\n \\\"callTimeout\\\": 130,\n \\\"machineDetection\\\": \\\"DISABLE\\\",\n \\\"callTransfers\\\": [\n {\n \\\"if\\\": \\\"dtmf\\\",\n \\\"equals\\\": \\\"1\\\",\n \\\"transferTo\\\": \\\"79029555525\\\"\n },\n {\n \\\"if\\\": \\\"dtmf\\\",\n \\\"equals\\\": \\\"2\\\",\n \\\"transferTo\\\": \\\"79029555551\\\"\n }\n ]\n },\n {\n \\\"from\\\": \\\"41793026700\\\",\n \\\"destinations\\\": [\n {\n \\\"to\\\": \\\"41793026785\\\"\n }\n ],\n \\\"text\\\": \\\"A long time ago, in a galaxy far.\\\",\n \\\"sendAt\\\": \\\"2016-07-07T18:00:00.000+01:00\\\"\n }\n ]\n }\", \n ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);", "language": "csharp" }, { "code": "var data = JSON.stringify({\n \"bulkId\": \"BULK-ID-123-xyz\",\n \"messages\": [\n {\n \"from\": \"41793026700\",\n \"destinations\": [\n { \n \"to\": \"41793026727\",\n \"messageId\": \"MESSAGE-ID-123-xyz\"\n },\n {\n \"to\": \"41793026731\"\n }\n ],\n \"text\": \"Test Voice message.\",\n \"language\": \"en\",\n \"speechRate\": 1,\n \"notifyUrl\": \"http://www.example.com/voice/advanced\",\n \"notifyContentType\": \"application/json\",\n \"validityPeriod\": 720,\n \"sendAt\": \"2016-07-07T17:00:00.000+01:00\",\n \"record\": false,\n \"repeatDtmf\": \"123#\",\n \"ringTimeout\": 45,\n \"dtmfTimeout\": 10,\n \"callTimeout\": 130,\n \"machineDetection\": \"DISABLE\",\n \"callTransfers\": [\n {\n \"if\": \"dtmf\",\n \"equals\": \"1\",\n \"transferTo\": \"79029555525\"\n },\n {\n \"if\": \"dtmf\",\n \"equals\": \"2\",\n \"transferTo\": \"79029555551\"\n }\n ]\n \n },\n {\n \"from\": \"41793026700\",\n \"destinations\": [\n {\n \"to\": \"41793026785\"\n }\n ],\n \"text\": \"A long time ago, in a galaxy far.\",\n \"sendAt\": \"2016-07-07T18:00:00.000+01:00\"\n }\n ]\n});\n\nvar xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === 4) {\n console.log(this.responseText);\n }\n});\n\nxhr.open(\"POST\", \"http://api.infobip.com/tts/3/advanced\");\nxhr.setRequestHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\");\nxhr.setRequestHeader(\"content-type\", \"application/json\");\nxhr.setRequestHeader(\"accept\", \"application/json\");\n\nxhr.send(data);", "language": "javascript" } ] } [/block] ## API response [block:code] { "codes": [ { "code": "{\n \"bulkId\": \"BULK-ID-123-xyz\",\n \"messages\": [\n {\n \"to\": \"41793026727\",\n \"status\": {\n \"groupId\": 1,\n \"groupName\": \"PENDING\",\n \"id\": 26,\n \"name\": \"PENDING_ACCEPTED\",\n \"description\": \"Message accepted, pending for delivery.\"\n },\n \"messageId\": \"MESSAGE-ID-123-xyz\"\n },\n {\n \"to\": \"41793026731\",\n \"status\": {\n \"groupId\": 1,\n \"groupName\": \"PENDING\",\n \"id\": 26,\n \"name\": \"PENDING_ACCEPTED\",\n \"description\": \"Message accepted, pending for delivery.\"\n },\n \"messageId\":\"9304a5a3ab19-1ca1-be74-76ad87651ed25f35\"\n },\n {\n \"to\": \"79029555525\",\n \"status\": {\n \"groupId\": 1,\n \"groupName\": \"PENDING\",\n \"id\": 26,\n \"name\": \"PENDING_ACCEPTED\",\n \"description\": \"Message accepted, pending for delivery.\"\n },\n \"messageId\":\"f0401b7b-5c44-4a62-8a1b-61ec26101ff0\"\n }\n ]\n}", "language": "json" } ] } [/block]