The estimate of a campaign form not saved yet (the same fields as create), nothing written: reach, exclusions, cost, start time and what is missing.
curl --request POST \
--url https://tawked.com/v1/applications/{application}/campaigns/estimate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"audience": {
"any": [
"<string>"
],
"campaign_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"exclude": [
{
"value": [
"<unknown>"
]
}
],
"groups": [
{
"conditions": [
{
"value": [
"<unknown>"
]
}
]
}
],
"none": [
"<string>"
],
"params": {
"category": "<string>",
"city": "<string>",
"days": 1825,
"product": "<string>"
},
"segment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "<string>"
},
"campaign": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"coupon": {
"amount": 2,
"code": "<string>",
"expiry_hours": 360,
"min_order_minor": 1,
"prefix": "<string>"
},
"date": "2023-11-07T05:31:56Z",
"header_image_path": "<string>",
"mapping": {
"body": [
{
"fallback": "<string>",
"value": "<string>"
}
],
"buttons": [
{
"fallback": "<string>",
"value": "<string>"
}
],
"cards": {
"product_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"slots": {
"body": [
{
"value": "<string>"
}
],
"buttons": [
{
"value": "<string>"
}
]
},
"source": "products"
},
"header": {
"fallback": "<string>",
"value": "<string>"
}
},
"name": "<string>",
"settings": {
"ab": {
"enabled": true,
"slice_pct": 30,
"wait_hours": 13
},
"attribution_days": 4,
"count_reads": true,
"engaged_first": true,
"fatigue_max": 4,
"followup": {
"after_hours": 36,
"enabled": true,
"mapping": {
"body": [
{
"fallback": "<string>",
"value": "<string>"
}
],
"buttons": [
{
"fallback": "<string>",
"value": "<string>"
}
],
"cards": {
"product_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"slots": {
"body": [
{
"value": "<string>"
}
],
"buttons": [
{
"value": "<string>"
}
]
},
"source": "products"
},
"header": {
"fallback": "<string>",
"value": "<string>"
}
},
"template_language": "<string>",
"template_name": "<string>"
},
"holdout_pct": 10,
"link_tracking": true,
"offer_ends_at": "2023-11-07T05:31:56Z",
"offer_hours": 360,
"retry_131049": true,
"retry_after_hours": 36,
"spread_hours": 12,
"utm_campaign": "<string>"
},
"template_language": "<string>",
"template_name": "<string>",
"time": "2023-11-07T05:31:56Z",
"variants": [
{
"coupon_amount": 2,
"header_image_path": "<string>",
"mapping": {
"body": [
{
"fallback": "<string>",
"value": "<string>"
}
],
"buttons": [
{
"fallback": "<string>",
"value": "<string>"
}
],
"cards": {
"product_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"slots": {
"body": [
{
"value": "<string>"
}
],
"buttons": [
{
"value": "<string>"
}
]
},
"source": "products"
},
"header": {
"fallback": "<string>",
"value": "<string>"
}
},
"template_language": "<string>",
"template_name": "<string>"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
audience: {
any: ['<string>'],
campaign_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
exclude: [{value: ['<unknown>']}],
groups: [{conditions: [{value: ['<unknown>']}]}],
none: ['<string>'],
params: {category: '<string>', city: '<string>', days: 1825, product: '<string>'},
segment_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
value: '<string>'
},
campaign: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
coupon: {
amount: 2,
code: '<string>',
expiry_hours: 360,
min_order_minor: 1,
prefix: '<string>'
},
date: '2023-11-07T05:31:56Z',
header_image_path: '<string>',
mapping: {
body: JSON.stringify([{fallback: '<string>', value: '<string>'}]),
buttons: [{fallback: '<string>', value: '<string>'}],
cards: {
product_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
slots: {body: JSON.stringify([{value: '<string>'}]), buttons: [{value: '<string>'}]},
source: 'products'
},
header: {fallback: '<string>', value: '<string>'}
},
name: '<string>',
settings: {
ab: {enabled: true, slice_pct: 30, wait_hours: 13},
attribution_days: 4,
count_reads: true,
engaged_first: true,
fatigue_max: 4,
followup: {
after_hours: 36,
enabled: true,
mapping: {
body: JSON.stringify([{fallback: '<string>', value: '<string>'}]),
buttons: [{fallback: '<string>', value: '<string>'}],
cards: {
product_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
slots: {body: JSON.stringify([{value: '<string>'}]), buttons: [{value: '<string>'}]},
source: 'products'
},
header: {fallback: '<string>', value: '<string>'}
},
template_language: '<string>',
template_name: '<string>'
},
holdout_pct: 10,
link_tracking: true,
offer_ends_at: '2023-11-07T05:31:56Z',
offer_hours: 360,
retry_131049: true,
retry_after_hours: 36,
spread_hours: 12,
utm_campaign: '<string>'
},
template_language: '<string>',
template_name: '<string>',
time: '2023-11-07T05:31:56Z',
variants: [
{
coupon_amount: 2,
header_image_path: '<string>',
mapping: {
body: JSON.stringify([{fallback: '<string>', value: '<string>'}]),
buttons: [{fallback: '<string>', value: '<string>'}],
cards: {
product_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
slots: {body: JSON.stringify([{value: '<string>'}]), buttons: [{value: '<string>'}]},
source: 'products'
},
header: {fallback: '<string>', value: '<string>'}
},
template_language: '<string>',
template_name: '<string>'
}
]
})
};
fetch('https://tawked.com/v1/applications/{application}/campaigns/estimate', 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://tawked.com/v1/applications/{application}/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([
'audience' => [
'any' => [
'<string>'
],
'campaign_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'exclude' => [
[
'value' => [
'<unknown>'
]
]
],
'groups' => [
[
'conditions' => [
[
'value' => [
'<unknown>'
]
]
]
]
],
'none' => [
'<string>'
],
'params' => [
'category' => '<string>',
'city' => '<string>',
'days' => 1825,
'product' => '<string>'
],
'segment_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'value' => '<string>'
],
'campaign' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'coupon' => [
'amount' => 2,
'code' => '<string>',
'expiry_hours' => 360,
'min_order_minor' => 1,
'prefix' => '<string>'
],
'date' => '2023-11-07T05:31:56Z',
'header_image_path' => '<string>',
'mapping' => [
'body' => [
[
'fallback' => '<string>',
'value' => '<string>'
]
],
'buttons' => [
[
'fallback' => '<string>',
'value' => '<string>'
]
],
'cards' => [
'product_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'slots' => [
'body' => [
[
'value' => '<string>'
]
],
'buttons' => [
[
'value' => '<string>'
]
]
],
'source' => 'products'
],
'header' => [
'fallback' => '<string>',
'value' => '<string>'
]
],
'name' => '<string>',
'settings' => [
'ab' => [
'enabled' => true,
'slice_pct' => 30,
'wait_hours' => 13
],
'attribution_days' => 4,
'count_reads' => true,
'engaged_first' => true,
'fatigue_max' => 4,
'followup' => [
'after_hours' => 36,
'enabled' => true,
'mapping' => [
'body' => [
[
'fallback' => '<string>',
'value' => '<string>'
]
],
'buttons' => [
[
'fallback' => '<string>',
'value' => '<string>'
]
],
'cards' => [
'product_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'slots' => [
'body' => [
[
'value' => '<string>'
]
],
'buttons' => [
[
'value' => '<string>'
]
]
],
'source' => 'products'
],
'header' => [
'fallback' => '<string>',
'value' => '<string>'
]
],
'template_language' => '<string>',
'template_name' => '<string>'
],
'holdout_pct' => 10,
'link_tracking' => true,
'offer_ends_at' => '2023-11-07T05:31:56Z',
'offer_hours' => 360,
'retry_131049' => true,
'retry_after_hours' => 36,
'spread_hours' => 12,
'utm_campaign' => '<string>'
],
'template_language' => '<string>',
'template_name' => '<string>',
'time' => '2023-11-07T05:31:56Z',
'variants' => [
[
'coupon_amount' => 2,
'header_image_path' => '<string>',
'mapping' => [
'body' => [
[
'fallback' => '<string>',
'value' => '<string>'
]
],
'buttons' => [
[
'fallback' => '<string>',
'value' => '<string>'
]
],
'cards' => [
'product_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'slots' => [
'body' => [
[
'value' => '<string>'
]
],
'buttons' => [
[
'value' => '<string>'
]
]
],
'source' => 'products'
],
'header' => [
'fallback' => '<string>',
'value' => '<string>'
]
],
'template_language' => '<string>',
'template_name' => '<string>'
]
]
]),
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;
}import requests
url = "https://tawked.com/v1/applications/{application}/campaigns/estimate"
payload = {
"audience": {
"any": ["<string>"],
"campaign_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"exclude": [{ "value": ["<unknown>"] }],
"groups": [{ "conditions": [{ "value": ["<unknown>"] }] }],
"none": ["<string>"],
"params": {
"category": "<string>",
"city": "<string>",
"days": 1825,
"product": "<string>"
},
"segment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "<string>"
},
"campaign": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"coupon": {
"amount": 2,
"code": "<string>",
"expiry_hours": 360,
"min_order_minor": 1,
"prefix": "<string>"
},
"date": "2023-11-07T05:31:56Z",
"header_image_path": "<string>",
"mapping": {
"body": [
{
"fallback": "<string>",
"value": "<string>"
}
],
"buttons": [
{
"fallback": "<string>",
"value": "<string>"
}
],
"cards": {
"product_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"slots": {
"body": [{ "value": "<string>" }],
"buttons": [{ "value": "<string>" }]
},
"source": "products"
},
"header": {
"fallback": "<string>",
"value": "<string>"
}
},
"name": "<string>",
"settings": {
"ab": {
"enabled": True,
"slice_pct": 30,
"wait_hours": 13
},
"attribution_days": 4,
"count_reads": True,
"engaged_first": True,
"fatigue_max": 4,
"followup": {
"after_hours": 36,
"enabled": True,
"mapping": {
"body": [
{
"fallback": "<string>",
"value": "<string>"
}
],
"buttons": [
{
"fallback": "<string>",
"value": "<string>"
}
],
"cards": {
"product_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"slots": {
"body": [{ "value": "<string>" }],
"buttons": [{ "value": "<string>" }]
},
"source": "products"
},
"header": {
"fallback": "<string>",
"value": "<string>"
}
},
"template_language": "<string>",
"template_name": "<string>"
},
"holdout_pct": 10,
"link_tracking": True,
"offer_ends_at": "2023-11-07T05:31:56Z",
"offer_hours": 360,
"retry_131049": True,
"retry_after_hours": 36,
"spread_hours": 12,
"utm_campaign": "<string>"
},
"template_language": "<string>",
"template_name": "<string>",
"time": "2023-11-07T05:31:56Z",
"variants": [
{
"coupon_amount": 2,
"header_image_path": "<string>",
"mapping": {
"body": [
{
"fallback": "<string>",
"value": "<string>"
}
],
"buttons": [
{
"fallback": "<string>",
"value": "<string>"
}
],
"cards": {
"product_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"slots": {
"body": [{ "value": "<string>" }],
"buttons": [{ "value": "<string>" }]
},
"source": "products"
},
"header": {
"fallback": "<string>",
"value": "<string>"
}
},
"template_language": "<string>",
"template_name": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {}
}{
"error": "<string>",
"message": "<string>",
"fields": {},
"needs": "<string>",
"next": "<string>",
"did_you_mean": [
{}
],
"human_action": {
"reason": "connect_whatsapp",
"url": "<string>",
"say": "<string>",
"then": "<string>"
},
"approval": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"operation": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"message": "<string>",
"fields": {},
"needs": "<string>",
"next": "<string>",
"did_you_mean": [
{}
],
"human_action": {
"reason": "connect_whatsapp",
"url": "<string>",
"say": "<string>",
"then": "<string>"
},
"approval": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"operation": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"message": "<string>",
"fields": {},
"needs": "<string>",
"next": "<string>",
"did_you_mean": [
{}
],
"human_action": {
"reason": "connect_whatsapp",
"url": "<string>",
"say": "<string>",
"then": "<string>"
},
"approval": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"operation": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"message": "<string>",
"fields": {},
"needs": "<string>",
"next": "<string>",
"did_you_mean": [
{}
],
"human_action": {
"reason": "connect_whatsapp",
"url": "<string>",
"say": "<string>",
"then": "<string>"
},
"approval": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"operation": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"message": "<string>",
"fields": {},
"needs": "<string>",
"next": "<string>",
"did_you_mean": [
{}
],
"human_action": {
"reason": "connect_whatsapp",
"url": "<string>",
"say": "<string>",
"then": "<string>"
},
"approval": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"operation": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"message": "<string>",
"fields": {},
"needs": "<string>",
"next": "<string>",
"did_you_mean": [
{}
],
"human_action": {
"reason": "connect_whatsapp",
"url": "<string>",
"say": "<string>",
"then": "<string>"
},
"approval": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"operation": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
}campaigns
campaigns.campaigns.preview_estimate
POST
/
v1
/
applications
/
{application}
/
campaigns
/
estimate
The estimate of a campaign form not saved yet (the same fields as create), nothing written: reach, exclusions, cost, start time and what is missing.
curl --request POST \
--url https://tawked.com/v1/applications/{application}/campaigns/estimate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"audience": {
"any": [
"<string>"
],
"campaign_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"exclude": [
{
"value": [
"<unknown>"
]
}
],
"groups": [
{
"conditions": [
{
"value": [
"<unknown>"
]
}
]
}
],
"none": [
"<string>"
],
"params": {
"category": "<string>",
"city": "<string>",
"days": 1825,
"product": "<string>"
},
"segment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "<string>"
},
"campaign": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"coupon": {
"amount": 2,
"code": "<string>",
"expiry_hours": 360,
"min_order_minor": 1,
"prefix": "<string>"
},
"date": "2023-11-07T05:31:56Z",
"header_image_path": "<string>",
"mapping": {
"body": [
{
"fallback": "<string>",
"value": "<string>"
}
],
"buttons": [
{
"fallback": "<string>",
"value": "<string>"
}
],
"cards": {
"product_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"slots": {
"body": [
{
"value": "<string>"
}
],
"buttons": [
{
"value": "<string>"
}
]
},
"source": "products"
},
"header": {
"fallback": "<string>",
"value": "<string>"
}
},
"name": "<string>",
"settings": {
"ab": {
"enabled": true,
"slice_pct": 30,
"wait_hours": 13
},
"attribution_days": 4,
"count_reads": true,
"engaged_first": true,
"fatigue_max": 4,
"followup": {
"after_hours": 36,
"enabled": true,
"mapping": {
"body": [
{
"fallback": "<string>",
"value": "<string>"
}
],
"buttons": [
{
"fallback": "<string>",
"value": "<string>"
}
],
"cards": {
"product_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"slots": {
"body": [
{
"value": "<string>"
}
],
"buttons": [
{
"value": "<string>"
}
]
},
"source": "products"
},
"header": {
"fallback": "<string>",
"value": "<string>"
}
},
"template_language": "<string>",
"template_name": "<string>"
},
"holdout_pct": 10,
"link_tracking": true,
"offer_ends_at": "2023-11-07T05:31:56Z",
"offer_hours": 360,
"retry_131049": true,
"retry_after_hours": 36,
"spread_hours": 12,
"utm_campaign": "<string>"
},
"template_language": "<string>",
"template_name": "<string>",
"time": "2023-11-07T05:31:56Z",
"variants": [
{
"coupon_amount": 2,
"header_image_path": "<string>",
"mapping": {
"body": [
{
"fallback": "<string>",
"value": "<string>"
}
],
"buttons": [
{
"fallback": "<string>",
"value": "<string>"
}
],
"cards": {
"product_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"slots": {
"body": [
{
"value": "<string>"
}
],
"buttons": [
{
"value": "<string>"
}
]
},
"source": "products"
},
"header": {
"fallback": "<string>",
"value": "<string>"
}
},
"template_language": "<string>",
"template_name": "<string>"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
audience: {
any: ['<string>'],
campaign_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
exclude: [{value: ['<unknown>']}],
groups: [{conditions: [{value: ['<unknown>']}]}],
none: ['<string>'],
params: {category: '<string>', city: '<string>', days: 1825, product: '<string>'},
segment_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
value: '<string>'
},
campaign: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
coupon: {
amount: 2,
code: '<string>',
expiry_hours: 360,
min_order_minor: 1,
prefix: '<string>'
},
date: '2023-11-07T05:31:56Z',
header_image_path: '<string>',
mapping: {
body: JSON.stringify([{fallback: '<string>', value: '<string>'}]),
buttons: [{fallback: '<string>', value: '<string>'}],
cards: {
product_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
slots: {body: JSON.stringify([{value: '<string>'}]), buttons: [{value: '<string>'}]},
source: 'products'
},
header: {fallback: '<string>', value: '<string>'}
},
name: '<string>',
settings: {
ab: {enabled: true, slice_pct: 30, wait_hours: 13},
attribution_days: 4,
count_reads: true,
engaged_first: true,
fatigue_max: 4,
followup: {
after_hours: 36,
enabled: true,
mapping: {
body: JSON.stringify([{fallback: '<string>', value: '<string>'}]),
buttons: [{fallback: '<string>', value: '<string>'}],
cards: {
product_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
slots: {body: JSON.stringify([{value: '<string>'}]), buttons: [{value: '<string>'}]},
source: 'products'
},
header: {fallback: '<string>', value: '<string>'}
},
template_language: '<string>',
template_name: '<string>'
},
holdout_pct: 10,
link_tracking: true,
offer_ends_at: '2023-11-07T05:31:56Z',
offer_hours: 360,
retry_131049: true,
retry_after_hours: 36,
spread_hours: 12,
utm_campaign: '<string>'
},
template_language: '<string>',
template_name: '<string>',
time: '2023-11-07T05:31:56Z',
variants: [
{
coupon_amount: 2,
header_image_path: '<string>',
mapping: {
body: JSON.stringify([{fallback: '<string>', value: '<string>'}]),
buttons: [{fallback: '<string>', value: '<string>'}],
cards: {
product_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
slots: {body: JSON.stringify([{value: '<string>'}]), buttons: [{value: '<string>'}]},
source: 'products'
},
header: {fallback: '<string>', value: '<string>'}
},
template_language: '<string>',
template_name: '<string>'
}
]
})
};
fetch('https://tawked.com/v1/applications/{application}/campaigns/estimate', 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://tawked.com/v1/applications/{application}/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([
'audience' => [
'any' => [
'<string>'
],
'campaign_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'exclude' => [
[
'value' => [
'<unknown>'
]
]
],
'groups' => [
[
'conditions' => [
[
'value' => [
'<unknown>'
]
]
]
]
],
'none' => [
'<string>'
],
'params' => [
'category' => '<string>',
'city' => '<string>',
'days' => 1825,
'product' => '<string>'
],
'segment_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'value' => '<string>'
],
'campaign' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'coupon' => [
'amount' => 2,
'code' => '<string>',
'expiry_hours' => 360,
'min_order_minor' => 1,
'prefix' => '<string>'
],
'date' => '2023-11-07T05:31:56Z',
'header_image_path' => '<string>',
'mapping' => [
'body' => [
[
'fallback' => '<string>',
'value' => '<string>'
]
],
'buttons' => [
[
'fallback' => '<string>',
'value' => '<string>'
]
],
'cards' => [
'product_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'slots' => [
'body' => [
[
'value' => '<string>'
]
],
'buttons' => [
[
'value' => '<string>'
]
]
],
'source' => 'products'
],
'header' => [
'fallback' => '<string>',
'value' => '<string>'
]
],
'name' => '<string>',
'settings' => [
'ab' => [
'enabled' => true,
'slice_pct' => 30,
'wait_hours' => 13
],
'attribution_days' => 4,
'count_reads' => true,
'engaged_first' => true,
'fatigue_max' => 4,
'followup' => [
'after_hours' => 36,
'enabled' => true,
'mapping' => [
'body' => [
[
'fallback' => '<string>',
'value' => '<string>'
]
],
'buttons' => [
[
'fallback' => '<string>',
'value' => '<string>'
]
],
'cards' => [
'product_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'slots' => [
'body' => [
[
'value' => '<string>'
]
],
'buttons' => [
[
'value' => '<string>'
]
]
],
'source' => 'products'
],
'header' => [
'fallback' => '<string>',
'value' => '<string>'
]
],
'template_language' => '<string>',
'template_name' => '<string>'
],
'holdout_pct' => 10,
'link_tracking' => true,
'offer_ends_at' => '2023-11-07T05:31:56Z',
'offer_hours' => 360,
'retry_131049' => true,
'retry_after_hours' => 36,
'spread_hours' => 12,
'utm_campaign' => '<string>'
],
'template_language' => '<string>',
'template_name' => '<string>',
'time' => '2023-11-07T05:31:56Z',
'variants' => [
[
'coupon_amount' => 2,
'header_image_path' => '<string>',
'mapping' => [
'body' => [
[
'fallback' => '<string>',
'value' => '<string>'
]
],
'buttons' => [
[
'fallback' => '<string>',
'value' => '<string>'
]
],
'cards' => [
'product_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'slots' => [
'body' => [
[
'value' => '<string>'
]
],
'buttons' => [
[
'value' => '<string>'
]
]
],
'source' => 'products'
],
'header' => [
'fallback' => '<string>',
'value' => '<string>'
]
],
'template_language' => '<string>',
'template_name' => '<string>'
]
]
]),
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;
}import requests
url = "https://tawked.com/v1/applications/{application}/campaigns/estimate"
payload = {
"audience": {
"any": ["<string>"],
"campaign_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"exclude": [{ "value": ["<unknown>"] }],
"groups": [{ "conditions": [{ "value": ["<unknown>"] }] }],
"none": ["<string>"],
"params": {
"category": "<string>",
"city": "<string>",
"days": 1825,
"product": "<string>"
},
"segment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "<string>"
},
"campaign": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"coupon": {
"amount": 2,
"code": "<string>",
"expiry_hours": 360,
"min_order_minor": 1,
"prefix": "<string>"
},
"date": "2023-11-07T05:31:56Z",
"header_image_path": "<string>",
"mapping": {
"body": [
{
"fallback": "<string>",
"value": "<string>"
}
],
"buttons": [
{
"fallback": "<string>",
"value": "<string>"
}
],
"cards": {
"product_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"slots": {
"body": [{ "value": "<string>" }],
"buttons": [{ "value": "<string>" }]
},
"source": "products"
},
"header": {
"fallback": "<string>",
"value": "<string>"
}
},
"name": "<string>",
"settings": {
"ab": {
"enabled": True,
"slice_pct": 30,
"wait_hours": 13
},
"attribution_days": 4,
"count_reads": True,
"engaged_first": True,
"fatigue_max": 4,
"followup": {
"after_hours": 36,
"enabled": True,
"mapping": {
"body": [
{
"fallback": "<string>",
"value": "<string>"
}
],
"buttons": [
{
"fallback": "<string>",
"value": "<string>"
}
],
"cards": {
"product_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"slots": {
"body": [{ "value": "<string>" }],
"buttons": [{ "value": "<string>" }]
},
"source": "products"
},
"header": {
"fallback": "<string>",
"value": "<string>"
}
},
"template_language": "<string>",
"template_name": "<string>"
},
"holdout_pct": 10,
"link_tracking": True,
"offer_ends_at": "2023-11-07T05:31:56Z",
"offer_hours": 360,
"retry_131049": True,
"retry_after_hours": 36,
"spread_hours": 12,
"utm_campaign": "<string>"
},
"template_language": "<string>",
"template_name": "<string>",
"time": "2023-11-07T05:31:56Z",
"variants": [
{
"coupon_amount": 2,
"header_image_path": "<string>",
"mapping": {
"body": [
{
"fallback": "<string>",
"value": "<string>"
}
],
"buttons": [
{
"fallback": "<string>",
"value": "<string>"
}
],
"cards": {
"product_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"slots": {
"body": [{ "value": "<string>" }],
"buttons": [{ "value": "<string>" }]
},
"source": "products"
},
"header": {
"fallback": "<string>",
"value": "<string>"
}
},
"template_language": "<string>",
"template_name": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {}
}{
"error": "<string>",
"message": "<string>",
"fields": {},
"needs": "<string>",
"next": "<string>",
"did_you_mean": [
{}
],
"human_action": {
"reason": "connect_whatsapp",
"url": "<string>",
"say": "<string>",
"then": "<string>"
},
"approval": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"operation": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"message": "<string>",
"fields": {},
"needs": "<string>",
"next": "<string>",
"did_you_mean": [
{}
],
"human_action": {
"reason": "connect_whatsapp",
"url": "<string>",
"say": "<string>",
"then": "<string>"
},
"approval": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"operation": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"message": "<string>",
"fields": {},
"needs": "<string>",
"next": "<string>",
"did_you_mean": [
{}
],
"human_action": {
"reason": "connect_whatsapp",
"url": "<string>",
"say": "<string>",
"then": "<string>"
},
"approval": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"operation": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"message": "<string>",
"fields": {},
"needs": "<string>",
"next": "<string>",
"did_you_mean": [
{}
],
"human_action": {
"reason": "connect_whatsapp",
"url": "<string>",
"say": "<string>",
"then": "<string>"
},
"approval": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"operation": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"message": "<string>",
"fields": {},
"needs": "<string>",
"next": "<string>",
"did_you_mean": [
{}
],
"human_action": {
"reason": "connect_whatsapp",
"url": "<string>",
"say": "<string>",
"then": "<string>"
},
"approval": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"operation": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"message": "<string>",
"fields": {},
"needs": "<string>",
"next": "<string>",
"did_you_mean": [
{}
],
"human_action": {
"reason": "connect_whatsapp",
"url": "<string>",
"say": "<string>",
"then": "<string>"
},
"approval": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"operation": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
}Authorizations
Headers
One per intended change (1 to 128 printable ASCII characters): a retry with the same key and the same request answers the stored 2xx with Idempotent-Replayed: true, for 24 hours. A 428 approval_required is never stored: send the approved request again with the same key or none. An answer that carried a secret shown once is never kept: its replay answers 409 idempotency_secret_not_replayable with the id of what it made.
Required string length:
1 - 128Path Parameters
Body
application/json