connect with confidence
Start real-time conversations with crystal clear audio, low latency and deeper insights.
curl --request POST \
--url https://control.msg91.com/api/v5/voice/call/ \
--header 'Authkey: <authkey>' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"template":"yourtemplate","caller_id":"91999999999","client_number":"918888888888","callback_url":"https://status.callback.com","variables":{"var1":{"type":"number","as_digits":true,"value":"1234"},"var2":{"type":"currency","currency_code":"USD","value":"100"}}}'
const http = require("https");
const options = {
"method": "POST",
"hostname": "control.msg91.com",
"port": null,
"path": "/api/v5/voice/call/",
"headers": {
"Authkey": "<authkey>",
"accept": "application/json",
"content-type": "application/json"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
template: 'yourtemplate',
caller_id: '91999999999',
client_number: '918888888888',
callback_url: 'https://status.callback.com',
variables: {
var1: {type: 'number', as_digits: true, value: '1234'},
var2: {type: 'currency', currency_code: 'USD', value: '100'}
}
}));
req.end();
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://control.msg91.com/api/v5/voice/call/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"template\":\"yourtemplate\",\"caller_id\":\"91999999999\",\"client_number\":\"918888888888\",\"callback_url\":\"https://status.callback.com\",\"variables\":{\"var1\":{\"type\":\"number\",\"as_digits\":true,\"value\":\"1234\"},\"var2\":{\"type\":\"currency\",\"currency_code\":\"USD\",\"value\":\"100\"}}}",
CURLOPT_HTTPHEADER => [
"Authkey: <authkey>",
"accept: application/json",
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://control.msg91.com/api/v5/voice/call/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["Authkey"] = '<authkey>'
request["accept"] = 'application/json'
request["content-type"] = 'application/json'
request.body = "{\"template\":\"yourtemplate\",\"caller_id\":\"91999999999\",\"client_number\":\"918888888888\",\"callback_url\":\"https://status.callback.com\",\"variables\":{\"var1\":{\"type\":\"number\",\"as_digits\":true,\"value\":\"1234\"},\"var2\":{\"type\":\"currency\",\"currency_code\":\"USD\",\"value\":\"100\"}}}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("control.msg91.com")
payload = "{\"template\":\"yourtemplate\",\"caller_id\":\"91999999999\",\"client_number\":\"918888888888\",\"callback_url\":\"https://status.callback.com\",\"variables\":{\"var1\":{\"type\":\"number\",\"as_digits\":true,\"value\":\"1234\"},\"var2\":{\"type\":\"currency\",\"currency_code\":\"USD\",\"value\":\"100\"}}}"
headers = {
'Authkey': "<authkey>",
'accept': "application/json",
'content-type': "application/json"
}
conn.request("POST", "/api/v5/voice/call/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))