Estimate WhatsApp campaign
How many people a campaign would reach, what it costs, and whether your wallet covers it. Sends nothing.
Scope: whatsapp:send.
POST
/
whatsapp
/
campaigns
/
estimate
Estimate WhatsApp campaign
curl --request POST \
--url https://app.telaven.com/api/v1/whatsapp/campaigns/estimate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"templateId": "7d2c…",
"contactListIds": [
"9a0b…"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({templateId: '7d2c…', contactListIds: ['9a0b…']})
};
fetch('https://app.telaven.com/api/v1/whatsapp/campaigns/estimate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.telaven.com/api/v1/whatsapp/campaigns/estimate"
payload = {
"templateId": "7d2c…",
"contactListIds": ["9a0b…"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.telaven.com/api/v1/whatsapp/campaigns/estimate",
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([
'templateId' => '7d2c…',
'contactListIds' => [
'9a0b…'
]
]),
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;
}using RestSharp;
var options = new RestClientOptions("https://app.telaven.com/api/v1/whatsapp/campaigns/estimate");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"templateId\": \"7d2c…\",\n \"contactListIds\": [\n \"9a0b…\"\n ]\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
{
"recipients": 1187,
"optedOut": 13,
"invalid": 0,
"category": "marketing",
"rateCents": 150,
"totalCents": 178050,
"balanceCents": 1443750,
"enough": true
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Body
application/json
Response
Success
⌘I
Estimate WhatsApp campaign
curl --request POST \
--url https://app.telaven.com/api/v1/whatsapp/campaigns/estimate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"templateId": "7d2c…",
"contactListIds": [
"9a0b…"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({templateId: '7d2c…', contactListIds: ['9a0b…']})
};
fetch('https://app.telaven.com/api/v1/whatsapp/campaigns/estimate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.telaven.com/api/v1/whatsapp/campaigns/estimate"
payload = {
"templateId": "7d2c…",
"contactListIds": ["9a0b…"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.telaven.com/api/v1/whatsapp/campaigns/estimate",
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([
'templateId' => '7d2c…',
'contactListIds' => [
'9a0b…'
]
]),
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;
}using RestSharp;
var options = new RestClientOptions("https://app.telaven.com/api/v1/whatsapp/campaigns/estimate");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"templateId\": \"7d2c…\",\n \"contactListIds\": [\n \"9a0b…\"\n ]\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
{
"recipients": 1187,
"optedOut": 13,
"invalid": 0,
"category": "marketing",
"rateCents": 150,
"totalCents": 178050,
"balanceCents": 1443750,
"enough": true
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}