Create call (version 3)
curl --request POST \
--url https://api.example.com/v1/Accounts/{account_sid}/Calls \
--header 'Content-Type: application/json' \
--data '
{
"call_hook": "https://public-apps.dev.voxeme.com/hello-world",
"call_status_hook": "https://public-apps.dev.voxeme.com/call-status",
"from": "15083778299",
"speech_recognizer_vendor": "Google",
"speech_synthesis_language": "en-US",
"speech_synthesis_vendor": "google",
"speech_synthesis_voice": "Wavenet-A",
"to": {
"number": "15089084809",
"type": "phone"
}
}
'import requests
url = "https://api.example.com/v1/Accounts/{account_sid}/Calls"
payload = {
"call_hook": "https://public-apps.dev.voxeme.com/hello-world",
"call_status_hook": "https://public-apps.dev.voxeme.com/call-status",
"from": "15083778299",
"speech_recognizer_vendor": "Google",
"speech_synthesis_language": "en-US",
"speech_synthesis_vendor": "google",
"speech_synthesis_voice": "Wavenet-A",
"to": {
"number": "15089084809",
"type": "phone"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
call_hook: 'https://public-apps.dev.voxeme.com/hello-world',
call_status_hook: 'https://public-apps.dev.voxeme.com/call-status',
from: '15083778299',
speech_recognizer_vendor: 'Google',
speech_synthesis_language: 'en-US',
speech_synthesis_vendor: 'google',
speech_synthesis_voice: 'Wavenet-A',
to: {number: '15089084809', type: 'phone'}
})
};
fetch('https://api.example.com/v1/Accounts/{account_sid}/Calls', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/Accounts/{account_sid}/Calls",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'call_hook' => 'https://public-apps.dev.voxeme.com/hello-world',
'call_status_hook' => 'https://public-apps.dev.voxeme.com/call-status',
'from' => '15083778299',
'speech_recognizer_vendor' => 'Google',
'speech_synthesis_language' => 'en-US',
'speech_synthesis_vendor' => 'google',
'speech_synthesis_voice' => 'Wavenet-A',
'to' => [
'number' => '15089084809',
'type' => 'phone'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/Accounts/{account_sid}/Calls"
payload := strings.NewReader("{\n \"call_hook\": \"https://public-apps.dev.voxeme.com/hello-world\",\n \"call_status_hook\": \"https://public-apps.dev.voxeme.com/call-status\",\n \"from\": \"15083778299\",\n \"speech_recognizer_vendor\": \"Google\",\n \"speech_synthesis_language\": \"en-US\",\n \"speech_synthesis_vendor\": \"google\",\n \"speech_synthesis_voice\": \"Wavenet-A\",\n \"to\": {\n \"number\": \"15089084809\",\n \"type\": \"phone\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/Accounts/{account_sid}/Calls")
.header("Content-Type", "application/json")
.body("{\n \"call_hook\": \"https://public-apps.dev.voxeme.com/hello-world\",\n \"call_status_hook\": \"https://public-apps.dev.voxeme.com/call-status\",\n \"from\": \"15083778299\",\n \"speech_recognizer_vendor\": \"Google\",\n \"speech_synthesis_language\": \"en-US\",\n \"speech_synthesis_vendor\": \"google\",\n \"speech_synthesis_voice\": \"Wavenet-A\",\n \"to\": {\n \"number\": \"15089084809\",\n \"type\": \"phone\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/Accounts/{account_sid}/Calls")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"call_hook\": \"https://public-apps.dev.voxeme.com/hello-world\",\n \"call_status_hook\": \"https://public-apps.dev.voxeme.com/call-status\",\n \"from\": \"15083778299\",\n \"speech_recognizer_vendor\": \"Google\",\n \"speech_synthesis_language\": \"en-US\",\n \"speech_synthesis_vendor\": \"google\",\n \"speech_synthesis_voice\": \"Wavenet-A\",\n \"to\": {\n \"number\": \"15089084809\",\n \"type\": \"phone\"\n }\n}"
response = http.request(request)
puts response.read_body{
"callId": "fb1893f3-b547-123c-1c99-0e24c2fb464d",
"sid": "a4941f23-66b8-4b52-b495-94192adee7ec"
}v1
Create call (version 3)
In this alternative version, the a short form of the webhook is explicitly provided in the payload.
Note that when an application_sid is NOT provided, you must explicitly specify the speech vendor properties in the payload (see example below).
POST
/
v1
/
Accounts
/
{account_sid}
/
Calls
Create call (version 3)
curl --request POST \
--url https://api.example.com/v1/Accounts/{account_sid}/Calls \
--header 'Content-Type: application/json' \
--data '
{
"call_hook": "https://public-apps.dev.voxeme.com/hello-world",
"call_status_hook": "https://public-apps.dev.voxeme.com/call-status",
"from": "15083778299",
"speech_recognizer_vendor": "Google",
"speech_synthesis_language": "en-US",
"speech_synthesis_vendor": "google",
"speech_synthesis_voice": "Wavenet-A",
"to": {
"number": "15089084809",
"type": "phone"
}
}
'import requests
url = "https://api.example.com/v1/Accounts/{account_sid}/Calls"
payload = {
"call_hook": "https://public-apps.dev.voxeme.com/hello-world",
"call_status_hook": "https://public-apps.dev.voxeme.com/call-status",
"from": "15083778299",
"speech_recognizer_vendor": "Google",
"speech_synthesis_language": "en-US",
"speech_synthesis_vendor": "google",
"speech_synthesis_voice": "Wavenet-A",
"to": {
"number": "15089084809",
"type": "phone"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
call_hook: 'https://public-apps.dev.voxeme.com/hello-world',
call_status_hook: 'https://public-apps.dev.voxeme.com/call-status',
from: '15083778299',
speech_recognizer_vendor: 'Google',
speech_synthesis_language: 'en-US',
speech_synthesis_vendor: 'google',
speech_synthesis_voice: 'Wavenet-A',
to: {number: '15089084809', type: 'phone'}
})
};
fetch('https://api.example.com/v1/Accounts/{account_sid}/Calls', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/Accounts/{account_sid}/Calls",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'call_hook' => 'https://public-apps.dev.voxeme.com/hello-world',
'call_status_hook' => 'https://public-apps.dev.voxeme.com/call-status',
'from' => '15083778299',
'speech_recognizer_vendor' => 'Google',
'speech_synthesis_language' => 'en-US',
'speech_synthesis_vendor' => 'google',
'speech_synthesis_voice' => 'Wavenet-A',
'to' => [
'number' => '15089084809',
'type' => 'phone'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/Accounts/{account_sid}/Calls"
payload := strings.NewReader("{\n \"call_hook\": \"https://public-apps.dev.voxeme.com/hello-world\",\n \"call_status_hook\": \"https://public-apps.dev.voxeme.com/call-status\",\n \"from\": \"15083778299\",\n \"speech_recognizer_vendor\": \"Google\",\n \"speech_synthesis_language\": \"en-US\",\n \"speech_synthesis_vendor\": \"google\",\n \"speech_synthesis_voice\": \"Wavenet-A\",\n \"to\": {\n \"number\": \"15089084809\",\n \"type\": \"phone\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/Accounts/{account_sid}/Calls")
.header("Content-Type", "application/json")
.body("{\n \"call_hook\": \"https://public-apps.dev.voxeme.com/hello-world\",\n \"call_status_hook\": \"https://public-apps.dev.voxeme.com/call-status\",\n \"from\": \"15083778299\",\n \"speech_recognizer_vendor\": \"Google\",\n \"speech_synthesis_language\": \"en-US\",\n \"speech_synthesis_vendor\": \"google\",\n \"speech_synthesis_voice\": \"Wavenet-A\",\n \"to\": {\n \"number\": \"15089084809\",\n \"type\": \"phone\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/Accounts/{account_sid}/Calls")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"call_hook\": \"https://public-apps.dev.voxeme.com/hello-world\",\n \"call_status_hook\": \"https://public-apps.dev.voxeme.com/call-status\",\n \"from\": \"15083778299\",\n \"speech_recognizer_vendor\": \"Google\",\n \"speech_synthesis_language\": \"en-US\",\n \"speech_synthesis_vendor\": \"google\",\n \"speech_synthesis_voice\": \"Wavenet-A\",\n \"to\": {\n \"number\": \"15089084809\",\n \"type\": \"phone\"\n }\n}"
response = http.request(request)
puts response.read_body{
"callId": "fb1893f3-b547-123c-1c99-0e24c2fb464d",
"sid": "a4941f23-66b8-4b52-b495-94192adee7ec"
}Path Parameters
Example:
"5f8e8f60-4771-44cb-92a6-94ea66df0450"
Body
application/json
Example:
"https://public-apps.dev.voxeme.com/hello-world"
Example:
"https://public-apps.dev.voxeme.com/call-status"
Example:
"15083778299"
Example:
"Google"
Example:
"en-US"
Example:
"google"
Example:
"Wavenet-A"
Show child attributes
Show child attributes
⌘I

