Estimar custo por lista de telefones
curl --request POST \
--url https://api.ararahq.com/v1/campaigns/estimate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"templateName": "bf_oferta_geral",
"phones": [
"+5511999999999",
"+5511888888888"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({templateName: 'bf_oferta_geral', phones: ['+5511999999999', '+5511888888888']})
};
fetch('https://api.ararahq.com/v1/campaigns/estimate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.ararahq.com/v1/campaigns/estimate"
payload = {
"templateName": "bf_oferta_geral",
"phones": ["+5511999999999", "+5511888888888"]
}
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://api.ararahq.com/v1/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([
'templateName' => 'bf_oferta_geral',
'phones' => [
'+5511999999999',
'+5511888888888'
]
]),
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;
}{
"templateCategory": "MARKETING",
"recipientCount": 2,
"templateCost": 0.59,
"araraFee": 0.177,
"unitPrice": 0.3835,
"totalCost": 0.767,
"markets": [
{
"market": "BR",
"count": 2,
"unitPrice": 0.3835,
"metaCostUnit": 0.295,
"subtotal": 0.767
}
]
}Campanhas
Estimar custo por lista de telefones
Calcula o preço por país de destino e devolve a quebra em markets.
Não cria nada nem debita. Permissão: CAMPAIGNS_SEND.
POST
/
v1
/
campaigns
/
estimate
Estimar custo por lista de telefones
curl --request POST \
--url https://api.ararahq.com/v1/campaigns/estimate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"templateName": "bf_oferta_geral",
"phones": [
"+5511999999999",
"+5511888888888"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({templateName: 'bf_oferta_geral', phones: ['+5511999999999', '+5511888888888']})
};
fetch('https://api.ararahq.com/v1/campaigns/estimate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.ararahq.com/v1/campaigns/estimate"
payload = {
"templateName": "bf_oferta_geral",
"phones": ["+5511999999999", "+5511888888888"]
}
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://api.ararahq.com/v1/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([
'templateName' => 'bf_oferta_geral',
'phones' => [
'+5511999999999',
'+5511888888888'
]
]),
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;
}{
"templateCategory": "MARKETING",
"recipientCount": 2,
"templateCost": 0.59,
"araraFee": 0.177,
"unitPrice": 0.3835,
"totalCost": 0.767,
"markets": [
{
"market": "BR",
"count": 2,
"unitPrice": 0.3835,
"metaCostUnit": 0.295,
"subtotal": 0.767
}
]
}Authorizations
Chave de API da Arara (ara_live_...), enviada no header Authorization: Bearer ara_live_.... Crie e gerencie as chaves no painel: https://app.ararahq.com/dashboard/apikeys. O valor completo aparece uma única vez, na criação.
Body
application/json
Response
Estimativa
Custo Meta total, em reais.
Taxa Arara total, em reais.
Preço médio por mensagem.
Total a debitar, em reais.
Quebra por mercado. Vazio no GET.
Show child attributes
Show child attributes