Initiate Outbound Call
curl --request POST \
--url https://app.adsera.in/api/pub/wa/call/connect/{whatsapp} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-api-secret: <api-key>' \
--data '
{
"phone": "911234567890",
"sdp": "v=0\r\no=- 46117317 2 IN IP4 127.0.0.1\r\n..."
}
'import requests
url = "https://app.adsera.in/api/pub/wa/call/connect/{whatsapp}"
payload = {
"phone": "911234567890",
"sdp": "v=0
o=- 46117317 2 IN IP4 127.0.0.1
..."
}
headers = {
"x-api-key": "<api-key>",
"x-api-secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-key': '<api-key>',
'x-api-secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({phone: '911234567890', sdp: 'v=0\r\no=- 46117317 2 IN IP4 127.0.0.1\r\n...'})
};
fetch('https://app.adsera.in/api/pub/wa/call/connect/{whatsapp}', 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://app.adsera.in/api/pub/wa/call/connect/{whatsapp}",
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([
'phone' => '911234567890',
'sdp' => 'v=0
o=- 46117317 2 IN IP4 127.0.0.1
...'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-api-secret: <api-key>"
],
]);
$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://app.adsera.in/api/pub/wa/call/connect/{whatsapp}"
payload := strings.NewReader("{\n \"phone\": \"911234567890\",\n \"sdp\": \"v=0\\r\\no=- 46117317 2 IN IP4 127.0.0.1\\r\\n...\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-api-secret", "<api-key>")
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://app.adsera.in/api/pub/wa/call/connect/{whatsapp}")
.header("x-api-key", "<api-key>")
.header("x-api-secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"phone\": \"911234567890\",\n \"sdp\": \"v=0\\r\\no=- 46117317 2 IN IP4 127.0.0.1\\r\\n...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.adsera.in/api/pub/wa/call/connect/{whatsapp}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["x-api-secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phone\": \"911234567890\",\n \"sdp\": \"v=0\\r\\no=- 46117317 2 IN IP4 127.0.0.1\\r\\n...\"\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"success": true,
"error": null,
"callId": "64f1a2b3c4d5e6f7a8b9c0d1"
}Call
Initiate Outbound Call
Initiates a new outbound WhatsApp voice call to a contact. Creates a WaCall record and a linked WhatsAppMsg of type call in the conversation thread. The callId returned should be used for all subsequent call operations.
POST
/
api
/
pub
/
wa
/
call
/
connect
/
{whatsapp}
Initiate Outbound Call
curl --request POST \
--url https://app.adsera.in/api/pub/wa/call/connect/{whatsapp} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-api-secret: <api-key>' \
--data '
{
"phone": "911234567890",
"sdp": "v=0\r\no=- 46117317 2 IN IP4 127.0.0.1\r\n..."
}
'import requests
url = "https://app.adsera.in/api/pub/wa/call/connect/{whatsapp}"
payload = {
"phone": "911234567890",
"sdp": "v=0
o=- 46117317 2 IN IP4 127.0.0.1
..."
}
headers = {
"x-api-key": "<api-key>",
"x-api-secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-key': '<api-key>',
'x-api-secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({phone: '911234567890', sdp: 'v=0\r\no=- 46117317 2 IN IP4 127.0.0.1\r\n...'})
};
fetch('https://app.adsera.in/api/pub/wa/call/connect/{whatsapp}', 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://app.adsera.in/api/pub/wa/call/connect/{whatsapp}",
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([
'phone' => '911234567890',
'sdp' => 'v=0
o=- 46117317 2 IN IP4 127.0.0.1
...'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-api-secret: <api-key>"
],
]);
$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://app.adsera.in/api/pub/wa/call/connect/{whatsapp}"
payload := strings.NewReader("{\n \"phone\": \"911234567890\",\n \"sdp\": \"v=0\\r\\no=- 46117317 2 IN IP4 127.0.0.1\\r\\n...\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-api-secret", "<api-key>")
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://app.adsera.in/api/pub/wa/call/connect/{whatsapp}")
.header("x-api-key", "<api-key>")
.header("x-api-secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"phone\": \"911234567890\",\n \"sdp\": \"v=0\\r\\no=- 46117317 2 IN IP4 127.0.0.1\\r\\n...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.adsera.in/api/pub/wa/call/connect/{whatsapp}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["x-api-secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phone\": \"911234567890\",\n \"sdp\": \"v=0\\r\\no=- 46117317 2 IN IP4 127.0.0.1\\r\\n...\"\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"success": true,
"error": null,
"callId": "64f1a2b3c4d5e6f7a8b9c0d1"
}Authorizations
Your application's unique ID.
Your application's secret key.
Path Parameters
The _id of the WhatsApp Business Account (WABA) to call from.
Example:
"60c72b2f9b1d8e001f8a1b2c"
Body
application/json
Outbound call payload
Response
Call initiated successfully. Use the returned callId for accept/end operations.
Was this page helpful?