Send Truecaller Template
curl --request POST \
--url https://api-ai.zixflow.com/api/ingest/truecaller/v1/template/send \
--header 'Content-Type: <content-type>' \
--header 'x-api-key: <x-api-key>' \
--header 'x-workspace-id: <x-workspace-id>' \
--data '
{
"recipient": "<string>",
"bot_id": "<string>",
"ttl_seconds": 123,
"post_back_url": "<string>",
"post_back_data": "<string>",
"template_name": "<string>",
"variables": {}
}
'import requests
url = "https://api-ai.zixflow.com/api/ingest/truecaller/v1/template/send"
payload = {
"recipient": "<string>",
"bot_id": "<string>",
"ttl_seconds": 123,
"post_back_url": "<string>",
"post_back_data": "<string>",
"template_name": "<string>",
"variables": {}
}
headers = {
"x-api-key": "<x-api-key>",
"x-workspace-id": "<x-workspace-id>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-key': '<x-api-key>',
'x-workspace-id': '<x-workspace-id>',
'Content-Type': '<content-type>'
},
body: JSON.stringify({
recipient: '<string>',
bot_id: '<string>',
ttl_seconds: 123,
post_back_url: '<string>',
post_back_data: '<string>',
template_name: '<string>',
variables: {}
})
};
fetch('https://api-ai.zixflow.com/api/ingest/truecaller/v1/template/send', 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-ai.zixflow.com/api/ingest/truecaller/v1/template/send",
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([
'recipient' => '<string>',
'bot_id' => '<string>',
'ttl_seconds' => 123,
'post_back_url' => '<string>',
'post_back_data' => '<string>',
'template_name' => '<string>',
'variables' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: <content-type>",
"x-api-key: <x-api-key>",
"x-workspace-id: <x-workspace-id>"
],
]);
$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-ai.zixflow.com/api/ingest/truecaller/v1/template/send"
payload := strings.NewReader("{\n \"recipient\": \"<string>\",\n \"bot_id\": \"<string>\",\n \"ttl_seconds\": 123,\n \"post_back_url\": \"<string>\",\n \"post_back_data\": \"<string>\",\n \"template_name\": \"<string>\",\n \"variables\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("x-workspace-id", "<x-workspace-id>")
req.Header.Add("Content-Type", "<content-type>")
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-ai.zixflow.com/api/ingest/truecaller/v1/template/send")
.header("x-api-key", "<x-api-key>")
.header("x-workspace-id", "<x-workspace-id>")
.header("Content-Type", "<content-type>")
.body("{\n \"recipient\": \"<string>\",\n \"bot_id\": \"<string>\",\n \"ttl_seconds\": 123,\n \"post_back_url\": \"<string>\",\n \"post_back_data\": \"<string>\",\n \"template_name\": \"<string>\",\n \"variables\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-ai.zixflow.com/api/ingest/truecaller/v1/template/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["x-workspace-id"] = '<x-workspace-id>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"recipient\": \"<string>\",\n \"bot_id\": \"<string>\",\n \"ttl_seconds\": 123,\n \"post_back_url\": \"<string>\",\n \"post_back_data\": \"<string>\",\n \"template_name\": \"<string>\",\n \"variables\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Truecaller request queued successfully",
"request_id": "3f1c0a2e-7b64-4d1a-9c2e-1a0b8e6d4f21"
}
{
"success": false,
"message": "template_name is required"
}
{
"success": false,
"message": "variables must be provided (can be empty map)"
}
{
"error": true,
"message": "Unauthorized"
}
{
"error": true,
"message": "Insufficient wallet balance"
}
{
"success": false,
"message": "Failed to process Truecaller request"
}
Truecaller
Send Truecaller Template
Send a saved Truecaller template by name
POST
/
api
/
ingest
/
truecaller
/
v1
/
template
/
send
Send Truecaller Template
curl --request POST \
--url https://api-ai.zixflow.com/api/ingest/truecaller/v1/template/send \
--header 'Content-Type: <content-type>' \
--header 'x-api-key: <x-api-key>' \
--header 'x-workspace-id: <x-workspace-id>' \
--data '
{
"recipient": "<string>",
"bot_id": "<string>",
"ttl_seconds": 123,
"post_back_url": "<string>",
"post_back_data": "<string>",
"template_name": "<string>",
"variables": {}
}
'import requests
url = "https://api-ai.zixflow.com/api/ingest/truecaller/v1/template/send"
payload = {
"recipient": "<string>",
"bot_id": "<string>",
"ttl_seconds": 123,
"post_back_url": "<string>",
"post_back_data": "<string>",
"template_name": "<string>",
"variables": {}
}
headers = {
"x-api-key": "<x-api-key>",
"x-workspace-id": "<x-workspace-id>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-key': '<x-api-key>',
'x-workspace-id': '<x-workspace-id>',
'Content-Type': '<content-type>'
},
body: JSON.stringify({
recipient: '<string>',
bot_id: '<string>',
ttl_seconds: 123,
post_back_url: '<string>',
post_back_data: '<string>',
template_name: '<string>',
variables: {}
})
};
fetch('https://api-ai.zixflow.com/api/ingest/truecaller/v1/template/send', 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-ai.zixflow.com/api/ingest/truecaller/v1/template/send",
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([
'recipient' => '<string>',
'bot_id' => '<string>',
'ttl_seconds' => 123,
'post_back_url' => '<string>',
'post_back_data' => '<string>',
'template_name' => '<string>',
'variables' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: <content-type>",
"x-api-key: <x-api-key>",
"x-workspace-id: <x-workspace-id>"
],
]);
$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-ai.zixflow.com/api/ingest/truecaller/v1/template/send"
payload := strings.NewReader("{\n \"recipient\": \"<string>\",\n \"bot_id\": \"<string>\",\n \"ttl_seconds\": 123,\n \"post_back_url\": \"<string>\",\n \"post_back_data\": \"<string>\",\n \"template_name\": \"<string>\",\n \"variables\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("x-workspace-id", "<x-workspace-id>")
req.Header.Add("Content-Type", "<content-type>")
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-ai.zixflow.com/api/ingest/truecaller/v1/template/send")
.header("x-api-key", "<x-api-key>")
.header("x-workspace-id", "<x-workspace-id>")
.header("Content-Type", "<content-type>")
.body("{\n \"recipient\": \"<string>\",\n \"bot_id\": \"<string>\",\n \"ttl_seconds\": 123,\n \"post_back_url\": \"<string>\",\n \"post_back_data\": \"<string>\",\n \"template_name\": \"<string>\",\n \"variables\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-ai.zixflow.com/api/ingest/truecaller/v1/template/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["x-workspace-id"] = '<x-workspace-id>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"recipient\": \"<string>\",\n \"bot_id\": \"<string>\",\n \"ttl_seconds\": 123,\n \"post_back_url\": \"<string>\",\n \"post_back_data\": \"<string>\",\n \"template_name\": \"<string>\",\n \"variables\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Truecaller request queued successfully",
"request_id": "3f1c0a2e-7b64-4d1a-9c2e-1a0b8e6d4f21"
}
{
"success": false,
"message": "template_name is required"
}
{
"success": false,
"message": "variables must be provided (can be empty map)"
}
{
"error": true,
"message": "Unauthorized"
}
{
"error": true,
"message": "Insufficient wallet balance"
}
{
"success": false,
"message": "Failed to process Truecaller request"
}
Description
Sends a saved template by name. The template must belong tobot_id. Variables replace placeholders in the template text, media URL, and links.
A template send has no buttons field. Buttons are part of the saved template.
variables must be present. {} is valid when the template has no caller variables. Keys are the names from Template variable keys, without braces. Placeholders that start with brand. are filled by Zixflow and are left out of that list.
A 200 means the message was queued. See Introduction for auth errors, wallet checks, processing codes, and billing.
Headers
Body
Phone number. An empty value is rejected immediately. After the message is queued, the number is normalized with the workspace country, so a local number is accepted. A number that cannot be normalized fails with code
90103 (INVALID_RECIPIENT_NUMBER).Truecaller bot id from Settings → Channels → Truecaller. 24-character hex. An unknown bot fails after queueing with
91401 (INVALID_TRUECALLER_BOT_ID). A paused bot fails with 91402 (TRUECALLER_BOT_PAUSED).How long Truecaller keeps trying to deliver the message. Integer from
1 to 2419200 (28 days). Omit it to use the bot’s default TTL. When that default is 0, processing uses 86400 (24 hours). No delivery report by then marks the message failed. A value outside the range fails after queueing with 91406 (INVALID_TRUECALLER_TTL).Stored on the delivery log with the send. There is no format check. The HTTP body posted to this URL is not defined by this API.
Name of the template on that bot. An unknown name, or a template that belongs to another bot, fails after queueing with
91403 (INVALID_TRUECALLER_TEMPLATE_NAME).Object of string to string. Must be present.
{} is valid when the template has no caller variables. Keys are the names from the variable-keys API, without braces.Request Example
{
"recipient": "+14155552671",
"bot_id": "665f1c2a8e4b9a0012ab34cd",
"template_name": "order_shipped",
"ttl_seconds": 86400,
"variables": {
"order_id": "10492",
"name": "Ada"
},
"post_back_url": "https://example.com/hooks/truecaller",
"post_back_data": "order-10492"
}
Response
Truecaller request queued successfully on success. On validation failure, field errors joined with ; .Present when
success is true. UUID. Use it on the delivery-report API. It is also the campaign id of the log.{
"success": true,
"message": "Truecaller request queued successfully",
"request_id": "3f1c0a2e-7b64-4d1a-9c2e-1a0b8e6d4f21"
}
{
"success": false,
"message": "template_name is required"
}
{
"success": false,
"message": "variables must be provided (can be empty map)"
}
{
"error": true,
"message": "Unauthorized"
}
{
"error": true,
"message": "Insufficient wallet balance"
}
{
"success": false,
"message": "Failed to process Truecaller request"
}