Get WhatsApp Templates
curl --request GET \
--url https://api-ai.zixflow.com/api/data/whatsapp/v1/{phone_id}/templates \
--header 'x-api-key: <x-api-key>' \
--header 'x-workspace-id: <x-workspace-id>'import requests
url = "https://api-ai.zixflow.com/api/data/whatsapp/v1/{phone_id}/templates"
headers = {
"x-api-key": "<x-api-key>",
"x-workspace-id": "<x-workspace-id>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-workspace-id': '<x-workspace-id>'}
};
fetch('https://api-ai.zixflow.com/api/data/whatsapp/v1/{phone_id}/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_URL => "https://api-ai.zixflow.com/api/data/whatsapp/v1/{phone_id}/templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api-ai.zixflow.com/api/data/whatsapp/v1/{phone_id}/templates"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("x-workspace-id", "<x-workspace-id>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-ai.zixflow.com/api/data/whatsapp/v1/{phone_id}/templates")
.header("x-api-key", "<x-api-key>")
.header("x-workspace-id", "<x-workspace-id>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-ai.zixflow.com/api/data/whatsapp/v1/{phone_id}/templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<x-api-key>'
request["x-workspace-id"] = '<x-workspace-id>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Templates retrieved successfully",
"data": {
"data": [
{
"name": "welcome_message",
"language": "en",
"category": "UTILITY",
"status": "APPROVED",
"components": []
},
{
"name": "order_confirmation",
"language": "en_US",
"category": "MARKETING",
"status": "APPROVED",
"components": []
}
],
"pagination": {
"size": 25,
"count": 10,
"pageSize": 10
}
}
}
{
"success": false,
"message": "Invalid phone_id parameter"
}
{
"success": false,
"message": "Unauthorized. Please check your API key and workspace ID."
}
{
"success": false,
"message": "Internal server error. Please try again later."
}
WhatsApp
Get WhatsApp Templates
Retrieves a list of WhatsApp templates for a specific phone ID
GET
/
api
/
data
/
whatsapp
/
v1
/
{phone_id}
/
templates
Get WhatsApp Templates
curl --request GET \
--url https://api-ai.zixflow.com/api/data/whatsapp/v1/{phone_id}/templates \
--header 'x-api-key: <x-api-key>' \
--header 'x-workspace-id: <x-workspace-id>'import requests
url = "https://api-ai.zixflow.com/api/data/whatsapp/v1/{phone_id}/templates"
headers = {
"x-api-key": "<x-api-key>",
"x-workspace-id": "<x-workspace-id>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-workspace-id': '<x-workspace-id>'}
};
fetch('https://api-ai.zixflow.com/api/data/whatsapp/v1/{phone_id}/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_URL => "https://api-ai.zixflow.com/api/data/whatsapp/v1/{phone_id}/templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api-ai.zixflow.com/api/data/whatsapp/v1/{phone_id}/templates"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("x-workspace-id", "<x-workspace-id>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-ai.zixflow.com/api/data/whatsapp/v1/{phone_id}/templates")
.header("x-api-key", "<x-api-key>")
.header("x-workspace-id", "<x-workspace-id>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-ai.zixflow.com/api/data/whatsapp/v1/{phone_id}/templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<x-api-key>'
request["x-workspace-id"] = '<x-workspace-id>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Templates retrieved successfully",
"data": {
"data": [
{
"name": "welcome_message",
"language": "en",
"category": "UTILITY",
"status": "APPROVED",
"components": []
},
{
"name": "order_confirmation",
"language": "en_US",
"category": "MARKETING",
"status": "APPROVED",
"components": []
}
],
"pagination": {
"size": 25,
"count": 10,
"pageSize": 10
}
}
}
{
"success": false,
"message": "Invalid phone_id parameter"
}
{
"success": false,
"message": "Unauthorized. Please check your API key and workspace ID."
}
{
"success": false,
"message": "Internal server error. Please try again later."
}
Description
This endpoint allows you to retrieve a paginated list of all WhatsApp templates available for a specific Phone ID. Templates can be filtered by status and include details such as name, category, language, and status.Headers
Path Parameters
The unique Phone ID associated with your WhatsApp Business account. You can find this on the Zixflow WhatsApp Settings page or by calling the Get WhatsApp Accounts endpoint.
Query Parameters
The number of templates to skip before starting to return results. Used for pagination. Default is 0.
Response
{
"success": true,
"message": "Templates retrieved successfully",
"data": {
"data": [
{
"name": "welcome_message",
"language": "en",
"category": "UTILITY",
"status": "APPROVED",
"components": []
},
{
"name": "order_confirmation",
"language": "en_US",
"category": "MARKETING",
"status": "APPROVED",
"components": []
}
],
"pagination": {
"size": 25,
"count": 10,
"pageSize": 10
}
}
}
{
"success": false,
"message": "Invalid phone_id parameter"
}
{
"success": false,
"message": "Unauthorized. Please check your API key and workspace ID."
}
{
"success": false,
"message": "Internal server error. Please try again later."
}