curl https://tawked.com/v1/whatsapp/templates/7000 \
-H "Authorization: Bearer tk_live_xxxxxxxxxxxxxxxxxxxx"const res = await fetch("https://tawked.com/v1/whatsapp/templates/7000", {
headers: {
Authorization: "Bearer tk_live_xxxxxxxxxxxxxxxxxxxx",
},
});
const data = await res.json();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://tawked.com/v1/whatsapp/templates/{template_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
res = requests.get(
"https://tawked.com/v1/whatsapp/templates/7000",
headers={"Authorization": "Bearer tk_live_xxxxxxxxxxxxxxxxxxxx"},
)
data = res.json(){
"id": "7000",
"name": "order_received_v1",
"language": "ar",
"category": "UTILITY",
"status": "APPROVED",
"quality": "GREEN",
"rejected_reason": null,
"components": [
{
"type": "HEADER",
"format": "TEXT",
"text": "طلبك {{1}}",
"buttons": []
},
{
"type": "BODY",
"format": null,
"text": "استلمنا طلبك رقم {{1}} بقيمة {{2}} ريال.",
"buttons": []
},
{
"type": "BUTTONS",
"format": null,
"text": null,
"buttons": [
{
"type": "URL",
"text": "تتبع الطلب",
"url": "https://flowers.example/orders/{{1}}",
"phone_number": null
}
]
}
],
"examples": {
"header:1": "1042",
"body:1": "1042",
"body:2": "250",
"button:0": "1042"
},
"placeholders": {
"kind": "positional",
"header": [
"1"
],
"body": [
"1",
"2"
],
"buttons": [
{
"index": 0,
"type": "url"
}
]
},
"managed": false
}{
"error": "unauthorized"
}{
"error": "account_not_active"
}{
"error": "not_found"
}{
"error": "no_whatsapp_number"
}{
"error": "too_many_requests"
}{
"error": "internal_error"
}{
"error": "templates_unavailable"
}Get a template
Reads one template by its Meta id, in full: its status, quality and rejection reason, its components as Meta holds them, the sample values, the placeholders a send must fill, and managed. An id that is not on the number’s WhatsApp Business Account answers 404.
curl https://tawked.com/v1/whatsapp/templates/7000 \
-H "Authorization: Bearer tk_live_xxxxxxxxxxxxxxxxxxxx"const res = await fetch("https://tawked.com/v1/whatsapp/templates/7000", {
headers: {
Authorization: "Bearer tk_live_xxxxxxxxxxxxxxxxxxxx",
},
});
const data = await res.json();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://tawked.com/v1/whatsapp/templates/{template_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
res = requests.get(
"https://tawked.com/v1/whatsapp/templates/7000",
headers={"Authorization": "Bearer tk_live_xxxxxxxxxxxxxxxxxxxx"},
)
data = res.json(){
"id": "7000",
"name": "order_received_v1",
"language": "ar",
"category": "UTILITY",
"status": "APPROVED",
"quality": "GREEN",
"rejected_reason": null,
"components": [
{
"type": "HEADER",
"format": "TEXT",
"text": "طلبك {{1}}",
"buttons": []
},
{
"type": "BODY",
"format": null,
"text": "استلمنا طلبك رقم {{1}} بقيمة {{2}} ريال.",
"buttons": []
},
{
"type": "BUTTONS",
"format": null,
"text": null,
"buttons": [
{
"type": "URL",
"text": "تتبع الطلب",
"url": "https://flowers.example/orders/{{1}}",
"phone_number": null
}
]
}
],
"examples": {
"header:1": "1042",
"body:1": "1042",
"body:2": "250",
"button:0": "1042"
},
"placeholders": {
"kind": "positional",
"header": [
"1"
],
"body": [
"1",
"2"
],
"buttons": [
{
"index": 0,
"type": "url"
}
]
},
"managed": false
}{
"error": "unauthorized"
}{
"error": "account_not_active"
}{
"error": "not_found"
}{
"error": "no_whatsapp_number"
}{
"error": "too_many_requests"
}{
"error": "internal_error"
}{
"error": "templates_unavailable"
}Authorizations
Authorization: Bearer . An application key (tk_live_, tk_test_) has full access, which covers every product and any product added later, or custom access, chosen when the key is created: one or more of the scopes verify:check, verify:send (includes verify:check), notifications:read, notifications:send (includes notifications:read), notifications:templates (includes notifications:read). No key made on the API keys page holds notifications:templates, full access included: the three template writes answer such a key 403 insufficient_scope. A connected app's key holds it. A call outside the key's access answers 403 insufficient_scope and names the scope it needs in the WWW-Authenticate response header. A partner key (tk_partner_) always has full access. Whatever its access, a key is a server-side secret.
Path Parameters
The template's Meta id, as id in GET /v1/whatsapp/templates. One id is one language of a template.