Answer a call
curl --request POST \
--url https://api.wavix.com/v1/calls/{id}/answer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"call_recording": false,
"call_transcription": false,
"stream_url": "wss://examples.com/stream",
"stream_type": "twoway",
"stream_channel": "inbound"
}
'import requests
url = "https://api.wavix.com/v1/calls/{id}/answer"
payload = {
"call_recording": False,
"call_transcription": False,
"stream_url": "wss://examples.com/stream",
"stream_type": "twoway",
"stream_channel": "inbound"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
call_recording: false,
call_transcription: false,
stream_url: 'wss://examples.com/stream',
stream_type: 'twoway',
stream_channel: 'inbound'
})
};
fetch('https://api.wavix.com/v1/calls/{id}/answer', 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.wavix.com/v1/calls/{id}/answer",
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_recording' => false,
'call_transcription' => false,
'stream_url' => 'wss://examples.com/stream',
'stream_type' => 'twoway',
'stream_channel' => 'inbound'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.wavix.com/v1/calls/{id}/answer"
payload := strings.NewReader("{\n \"call_recording\": false,\n \"call_transcription\": false,\n \"stream_url\": \"wss://examples.com/stream\",\n \"stream_type\": \"twoway\",\n \"stream_channel\": \"inbound\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.wavix.com/v1/calls/{id}/answer")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"call_recording\": false,\n \"call_transcription\": false,\n \"stream_url\": \"wss://examples.com/stream\",\n \"stream_type\": \"twoway\",\n \"stream_channel\": \"inbound\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wavix.com/v1/calls/{id}/answer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"call_recording\": false,\n \"call_transcription\": false,\n \"stream_url\": \"wss://examples.com/stream\",\n \"stream_type\": \"twoway\",\n \"stream_channel\": \"inbound\"\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"success": false,
"message": "Validation error",
"errors": {
"to": "required"
}
}{
"success": false,
"error": true,
"message": "Unauthorized"
}{
"success": false,
"message": "Record not found"
}Call control
Answer a call
Answers the inbound call identified by id. Optionally starts media streaming on answer.
POST
/
v1
/
calls
/
{id}
/
answer
Answer a call
curl --request POST \
--url https://api.wavix.com/v1/calls/{id}/answer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"call_recording": false,
"call_transcription": false,
"stream_url": "wss://examples.com/stream",
"stream_type": "twoway",
"stream_channel": "inbound"
}
'import requests
url = "https://api.wavix.com/v1/calls/{id}/answer"
payload = {
"call_recording": False,
"call_transcription": False,
"stream_url": "wss://examples.com/stream",
"stream_type": "twoway",
"stream_channel": "inbound"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
call_recording: false,
call_transcription: false,
stream_url: 'wss://examples.com/stream',
stream_type: 'twoway',
stream_channel: 'inbound'
})
};
fetch('https://api.wavix.com/v1/calls/{id}/answer', 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.wavix.com/v1/calls/{id}/answer",
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_recording' => false,
'call_transcription' => false,
'stream_url' => 'wss://examples.com/stream',
'stream_type' => 'twoway',
'stream_channel' => 'inbound'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.wavix.com/v1/calls/{id}/answer"
payload := strings.NewReader("{\n \"call_recording\": false,\n \"call_transcription\": false,\n \"stream_url\": \"wss://examples.com/stream\",\n \"stream_type\": \"twoway\",\n \"stream_channel\": \"inbound\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.wavix.com/v1/calls/{id}/answer")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"call_recording\": false,\n \"call_transcription\": false,\n \"stream_url\": \"wss://examples.com/stream\",\n \"stream_type\": \"twoway\",\n \"stream_channel\": \"inbound\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wavix.com/v1/calls/{id}/answer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"call_recording\": false,\n \"call_transcription\": false,\n \"stream_url\": \"wss://examples.com/stream\",\n \"stream_type\": \"twoway\",\n \"stream_channel\": \"inbound\"\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"success": false,
"message": "Validation error",
"errors": {
"to": "required"
}
}{
"success": false,
"error": true,
"message": "Unauthorized"
}{
"success": false,
"message": "Record not found"
}Authorizations
Wavix API key. Pass as Authorization: Bearer <api_key>. Keys support per-resource scopes (none / read / write). See Restricted keys and scopes.
Path Parameters
The uuid of the call.
Body
application/json
Options to apply when answering the call.
Indicates whether the call should be recorded.
Indicates whether the call should be transcribed after it ends.
WebSocket URL to stream the call.
Example:
"wss://examples.com/stream"
Direction of audio streamed to stream_url.
Available options:
oneway, twoway Example:
"twoway"
Audio channel streamed to stream_url.
Available options:
inbound, outbound, both Example:
"inbound"
Response
Returns a success confirmation. The call is answered.
Indicates whether the request was successful.
Example:
true
Was this page helpful?
⌘I