Deletar template
curl --request DELETE \
--url https://api.omni.z-api.io/whatsapp/businesses/{wabaId}/templates/{templateId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.omni.z-api.io/whatsapp/businesses/{wabaId}/templates/{templateId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.omni.z-api.io/whatsapp/businesses/{wabaId}/templates/{templateId}', 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.omni.z-api.io/whatsapp/businesses/{wabaId}/templates/{templateId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.omni.z-api.io/whatsapp/businesses/{wabaId}/templates/{templateId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.omni.z-api.io/whatsapp/businesses/{wabaId}/templates/{templateId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.omni.z-api.io/whatsapp/businesses/{wabaId}/templates/{templateId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true
}{
"error": 401,
"message": "Unauthorized"
}{
"error": "integration_unavailable",
"message": "The operation could not be completed right now. Try again in a few moments."
}{
"error": "outcome_unknown",
"message": "The operation did not finish in time and may still be completed. Check the result before trying again."
}Outros endpoints
Remover template
Remove um template existente
DELETE
/
whatsapp
/
businesses
/
{wabaId}
/
templates
/
{templateId}
Deletar template
curl --request DELETE \
--url https://api.omni.z-api.io/whatsapp/businesses/{wabaId}/templates/{templateId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.omni.z-api.io/whatsapp/businesses/{wabaId}/templates/{templateId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.omni.z-api.io/whatsapp/businesses/{wabaId}/templates/{templateId}', 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.omni.z-api.io/whatsapp/businesses/{wabaId}/templates/{templateId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.omni.z-api.io/whatsapp/businesses/{wabaId}/templates/{templateId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.omni.z-api.io/whatsapp/businesses/{wabaId}/templates/{templateId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.omni.z-api.io/whatsapp/businesses/{wabaId}/templates/{templateId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true
}{
"error": 401,
"message": "Unauthorized"
}{
"error": "integration_unavailable",
"message": "The operation could not be completed right now. Try again in a few moments."
}{
"error": "outcome_unknown",
"message": "The operation did not finish in time and may still be completed. Check the result before trying again."
}Conceituação
Remove um template existente do WABA. A exclusão é permanente.Essa ação não pode ser desfeita. Uma vez deletado, o template precisará ser criado novamente e passar por nova aprovação da Meta.
O
templateId é obtido através do endpoint de Listar templates.Autorizações
Secret Key gerada no painel de Segurança do Omni Z-API
Parâmetros de caminho
ID do WABA (obtido via Listar WABAs)
Exemplo:
"428083093730937"
ID do template (obtido via Listar templates)
Exemplo:
"1900296177408890"
Parâmetros de consulta
Nome do template. A Meta exige o nome junto do ID para remover todas as traduções do template
Exemplo:
"atualizacao_pedido_v1"
Resposta
Template deletado com sucesso
Indica se a operação foi realizada com sucesso