Submit a new WhatsApp template for Meta approval
curl --request POST \
--url http://localhost:8080/whatsapp/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"language": "<string>",
"body_text": "<string>",
"body_variable_examples": [],
"header_text": "<string>",
"footer_text": "<string>",
"buttons": [],
"message_send_ttl_seconds": 0,
"waba_id": "<string>"
}
'import requests
url = "http://localhost:8080/whatsapp/templates"
payload = {
"name": "<string>",
"language": "<string>",
"body_text": "<string>",
"body_variable_examples": [],
"header_text": "<string>",
"footer_text": "<string>",
"buttons": [],
"message_send_ttl_seconds": 0,
"waba_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
language: '<string>',
body_text: '<string>',
body_variable_examples: [],
header_text: '<string>',
footer_text: '<string>',
buttons: [],
message_send_ttl_seconds: 0,
waba_id: '<string>'
})
};
fetch('http://localhost:8080/whatsapp/templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/whatsapp/templates",
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([
'name' => '<string>',
'language' => '<string>',
'body_text' => '<string>',
'body_variable_examples' => [
],
'header_text' => '<string>',
'footer_text' => '<string>',
'buttons' => [
],
'message_send_ttl_seconds' => 0,
'waba_id' => '<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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:8080/whatsapp/templates"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"language\": \"<string>\",\n \"body_text\": \"<string>\",\n \"body_variable_examples\": [],\n \"header_text\": \"<string>\",\n \"footer_text\": \"<string>\",\n \"buttons\": [],\n \"message_send_ttl_seconds\": 0,\n \"waba_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:8080/whatsapp/templates")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"language\": \"<string>\",\n \"body_text\": \"<string>\",\n \"body_variable_examples\": [],\n \"header_text\": \"<string>\",\n \"footer_text\": \"<string>\",\n \"buttons\": [],\n \"message_send_ttl_seconds\": 0,\n \"waba_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/whatsapp/templates")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"language\": \"<string>\",\n \"body_text\": \"<string>\",\n \"body_variable_examples\": [],\n \"header_text\": \"<string>\",\n \"footer_text\": \"<string>\",\n \"buttons\": [],\n \"message_send_ttl_seconds\": 0,\n \"waba_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"language": "<string>",
"status": "APPROVED",
"category": "UTILITY",
"variables": [
"<string>"
],
"buttons": [
{
"index": 0,
"type": "QUICK_REPLY",
"text": "<string>",
"needs_value": true
}
],
"sendable": true
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}AI WhatsApp
Submit a new WhatsApp template for Meta approval
Submit a new WhatsApp template for Meta approval — For when nothing in the org fits.
POST
/
whatsapp
/
templates
Submit a new WhatsApp template for Meta approval
curl --request POST \
--url http://localhost:8080/whatsapp/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"language": "<string>",
"body_text": "<string>",
"body_variable_examples": [],
"header_text": "<string>",
"footer_text": "<string>",
"buttons": [],
"message_send_ttl_seconds": 0,
"waba_id": "<string>"
}
'import requests
url = "http://localhost:8080/whatsapp/templates"
payload = {
"name": "<string>",
"language": "<string>",
"body_text": "<string>",
"body_variable_examples": [],
"header_text": "<string>",
"footer_text": "<string>",
"buttons": [],
"message_send_ttl_seconds": 0,
"waba_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
language: '<string>',
body_text: '<string>',
body_variable_examples: [],
header_text: '<string>',
footer_text: '<string>',
buttons: [],
message_send_ttl_seconds: 0,
waba_id: '<string>'
})
};
fetch('http://localhost:8080/whatsapp/templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/whatsapp/templates",
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([
'name' => '<string>',
'language' => '<string>',
'body_text' => '<string>',
'body_variable_examples' => [
],
'header_text' => '<string>',
'footer_text' => '<string>',
'buttons' => [
],
'message_send_ttl_seconds' => 0,
'waba_id' => '<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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:8080/whatsapp/templates"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"language\": \"<string>\",\n \"body_text\": \"<string>\",\n \"body_variable_examples\": [],\n \"header_text\": \"<string>\",\n \"footer_text\": \"<string>\",\n \"buttons\": [],\n \"message_send_ttl_seconds\": 0,\n \"waba_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:8080/whatsapp/templates")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"language\": \"<string>\",\n \"body_text\": \"<string>\",\n \"body_variable_examples\": [],\n \"header_text\": \"<string>\",\n \"footer_text\": \"<string>\",\n \"buttons\": [],\n \"message_send_ttl_seconds\": 0,\n \"waba_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/whatsapp/templates")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"language\": \"<string>\",\n \"body_text\": \"<string>\",\n \"body_variable_examples\": [],\n \"header_text\": \"<string>\",\n \"footer_text\": \"<string>\",\n \"buttons\": [],\n \"message_send_ttl_seconds\": 0,\n \"waba_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"language": "<string>",
"status": "APPROVED",
"category": "UTILITY",
"variables": [
"<string>"
],
"buttons": [
{
"index": 0,
"type": "QUICK_REPLY",
"text": "<string>",
"needs_value": true
}
],
"sendable": true
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Authorizations
Body
application/json
Placeholders as {{1}}, {{2}} in order, or {{named}}. Never mix the two styles.
Required string length:
1 - 1024Response
Default Response
Was this page helpful?