Update a message template
curl --request PATCH \
--url https://api.izap.ai/api/v1/whatsapp_templates/{template_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'business-id: <business-id>' \
--data '
{
"body_text": "<string>",
"buttons": [
{
"type": "<string>",
"flow_id": "<string>",
"navigate_screen": "<string>",
"phone_number": "<string>",
"text": "",
"url": "<string>"
}
],
"call_permission_request": true,
"display_name": "<string>",
"example_variables": [
"<string>"
],
"footer_text": "<string>",
"header_media_document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"header_text": "<string>",
"language": "<string>"
}
'import requests
url = "https://api.izap.ai/api/v1/whatsapp_templates/{template_id}"
payload = {
"body_text": "<string>",
"buttons": [
{
"type": "<string>",
"flow_id": "<string>",
"navigate_screen": "<string>",
"phone_number": "<string>",
"text": "",
"url": "<string>"
}
],
"call_permission_request": True,
"display_name": "<string>",
"example_variables": ["<string>"],
"footer_text": "<string>",
"header_media_document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"header_text": "<string>",
"language": "<string>"
}
headers = {
"business-id": "<business-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'business-id': '<business-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
body_text: '<string>',
buttons: [
{
type: '<string>',
flow_id: '<string>',
navigate_screen: '<string>',
phone_number: '<string>',
text: '',
url: '<string>'
}
],
call_permission_request: true,
display_name: '<string>',
example_variables: ['<string>'],
footer_text: '<string>',
header_media_document_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
header_text: '<string>',
language: '<string>'
})
};
fetch('https://api.izap.ai/api/v1/whatsapp_templates/{template_id}', 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.izap.ai/api/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 => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'body_text' => '<string>',
'buttons' => [
[
'type' => '<string>',
'flow_id' => '<string>',
'navigate_screen' => '<string>',
'phone_number' => '<string>',
'text' => '',
'url' => '<string>'
]
],
'call_permission_request' => true,
'display_name' => '<string>',
'example_variables' => [
'<string>'
],
'footer_text' => '<string>',
'header_media_document_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'header_text' => '<string>',
'language' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"business-id: <business-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.izap.ai/api/v1/whatsapp_templates/{template_id}"
payload := strings.NewReader("{\n \"body_text\": \"<string>\",\n \"buttons\": [\n {\n \"type\": \"<string>\",\n \"flow_id\": \"<string>\",\n \"navigate_screen\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"text\": \"\",\n \"url\": \"<string>\"\n }\n ],\n \"call_permission_request\": true,\n \"display_name\": \"<string>\",\n \"example_variables\": [\n \"<string>\"\n ],\n \"footer_text\": \"<string>\",\n \"header_media_document_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"header_text\": \"<string>\",\n \"language\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("business-id", "<business-id>")
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.patch("https://api.izap.ai/api/v1/whatsapp_templates/{template_id}")
.header("business-id", "<business-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"body_text\": \"<string>\",\n \"buttons\": [\n {\n \"type\": \"<string>\",\n \"flow_id\": \"<string>\",\n \"navigate_screen\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"text\": \"\",\n \"url\": \"<string>\"\n }\n ],\n \"call_permission_request\": true,\n \"display_name\": \"<string>\",\n \"example_variables\": [\n \"<string>\"\n ],\n \"footer_text\": \"<string>\",\n \"header_media_document_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"header_text\": \"<string>\",\n \"language\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.izap.ai/api/v1/whatsapp_templates/{template_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["business-id"] = '<business-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"body_text\": \"<string>\",\n \"buttons\": [\n {\n \"type\": \"<string>\",\n \"flow_id\": \"<string>\",\n \"navigate_screen\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"text\": \"\",\n \"url\": \"<string>\"\n }\n ],\n \"call_permission_request\": true,\n \"display_name\": \"<string>\",\n \"example_variables\": [\n \"<string>\"\n ],\n \"footer_text\": \"<string>\",\n \"header_media_document_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"header_text\": \"<string>\",\n \"language\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"body_text": "<string>",
"business_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"modified": "2023-11-07T05:31:56Z",
"name": "<string>",
"status": "draft",
"buttons": [
{
"type": "<string>",
"flow_action": "<string>",
"flow_id": "<string>",
"navigate_screen": "<string>",
"phone_number": "<string>",
"text": "",
"url": "<string>"
}
],
"call_permission_request": false,
"category": "utility",
"display_name": "<string>",
"example_variables": [
"<string>"
],
"footer_text": "<string>",
"header_format": "none",
"header_media_document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"header_text": "<string>",
"language": "pt_BR",
"last_synced_at": "2023-11-07T05:31:56Z",
"provider_template_id": "<string>",
"quality_score": "<string>",
"rejection_reason": "<string>",
"waba_id": "<string>"
}{
"detail": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"code": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}{
"detail": "<string>",
"code": "<string>"
}whatsapp-templates
Update a message template
Updates a template. Its content can only be changed while the template is still a local draft or has been rejected — an approved template has to be replaced by a new one.
PATCH
/
api
/
v1
/
whatsapp_templates
/
{template_id}
Update a message template
curl --request PATCH \
--url https://api.izap.ai/api/v1/whatsapp_templates/{template_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'business-id: <business-id>' \
--data '
{
"body_text": "<string>",
"buttons": [
{
"type": "<string>",
"flow_id": "<string>",
"navigate_screen": "<string>",
"phone_number": "<string>",
"text": "",
"url": "<string>"
}
],
"call_permission_request": true,
"display_name": "<string>",
"example_variables": [
"<string>"
],
"footer_text": "<string>",
"header_media_document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"header_text": "<string>",
"language": "<string>"
}
'import requests
url = "https://api.izap.ai/api/v1/whatsapp_templates/{template_id}"
payload = {
"body_text": "<string>",
"buttons": [
{
"type": "<string>",
"flow_id": "<string>",
"navigate_screen": "<string>",
"phone_number": "<string>",
"text": "",
"url": "<string>"
}
],
"call_permission_request": True,
"display_name": "<string>",
"example_variables": ["<string>"],
"footer_text": "<string>",
"header_media_document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"header_text": "<string>",
"language": "<string>"
}
headers = {
"business-id": "<business-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'business-id': '<business-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
body_text: '<string>',
buttons: [
{
type: '<string>',
flow_id: '<string>',
navigate_screen: '<string>',
phone_number: '<string>',
text: '',
url: '<string>'
}
],
call_permission_request: true,
display_name: '<string>',
example_variables: ['<string>'],
footer_text: '<string>',
header_media_document_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
header_text: '<string>',
language: '<string>'
})
};
fetch('https://api.izap.ai/api/v1/whatsapp_templates/{template_id}', 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.izap.ai/api/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 => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'body_text' => '<string>',
'buttons' => [
[
'type' => '<string>',
'flow_id' => '<string>',
'navigate_screen' => '<string>',
'phone_number' => '<string>',
'text' => '',
'url' => '<string>'
]
],
'call_permission_request' => true,
'display_name' => '<string>',
'example_variables' => [
'<string>'
],
'footer_text' => '<string>',
'header_media_document_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'header_text' => '<string>',
'language' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"business-id: <business-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.izap.ai/api/v1/whatsapp_templates/{template_id}"
payload := strings.NewReader("{\n \"body_text\": \"<string>\",\n \"buttons\": [\n {\n \"type\": \"<string>\",\n \"flow_id\": \"<string>\",\n \"navigate_screen\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"text\": \"\",\n \"url\": \"<string>\"\n }\n ],\n \"call_permission_request\": true,\n \"display_name\": \"<string>\",\n \"example_variables\": [\n \"<string>\"\n ],\n \"footer_text\": \"<string>\",\n \"header_media_document_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"header_text\": \"<string>\",\n \"language\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("business-id", "<business-id>")
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.patch("https://api.izap.ai/api/v1/whatsapp_templates/{template_id}")
.header("business-id", "<business-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"body_text\": \"<string>\",\n \"buttons\": [\n {\n \"type\": \"<string>\",\n \"flow_id\": \"<string>\",\n \"navigate_screen\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"text\": \"\",\n \"url\": \"<string>\"\n }\n ],\n \"call_permission_request\": true,\n \"display_name\": \"<string>\",\n \"example_variables\": [\n \"<string>\"\n ],\n \"footer_text\": \"<string>\",\n \"header_media_document_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"header_text\": \"<string>\",\n \"language\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.izap.ai/api/v1/whatsapp_templates/{template_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["business-id"] = '<business-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"body_text\": \"<string>\",\n \"buttons\": [\n {\n \"type\": \"<string>\",\n \"flow_id\": \"<string>\",\n \"navigate_screen\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"text\": \"\",\n \"url\": \"<string>\"\n }\n ],\n \"call_permission_request\": true,\n \"display_name\": \"<string>\",\n \"example_variables\": [\n \"<string>\"\n ],\n \"footer_text\": \"<string>\",\n \"header_media_document_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"header_text\": \"<string>\",\n \"language\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"body_text": "<string>",
"business_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"modified": "2023-11-07T05:31:56Z",
"name": "<string>",
"status": "draft",
"buttons": [
{
"type": "<string>",
"flow_action": "<string>",
"flow_id": "<string>",
"navigate_screen": "<string>",
"phone_number": "<string>",
"text": "",
"url": "<string>"
}
],
"call_permission_request": false,
"category": "utility",
"display_name": "<string>",
"example_variables": [
"<string>"
],
"footer_text": "<string>",
"header_format": "none",
"header_media_document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"header_text": "<string>",
"language": "pt_BR",
"last_synced_at": "2023-11-07T05:31:56Z",
"provider_template_id": "<string>",
"quality_score": "<string>",
"rejection_reason": "<string>",
"waba_id": "<string>"
}{
"detail": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"code": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}{
"detail": "<string>",
"code": "<string>"
}Autorizaciones
Cuerpo
application/json
Partial update. Content edits to APPROVED/PAUSED templates are sent to Meta immediately.
Required string length:
1 - 1024Respuesta
Successful Response