API
Log in
Documentation › Messages › List Meta templates
GET

List Meta templates

GEThttps://app.sendapp.ai/api/whatsapp-meta/get_templates
Retrieve all WhatsApp templates approved by Meta for the account, with name, language, category, status and component/variable structure.
Parameters
apikey required
Your API Key.
token required
Account token.
Request
curl 'https://app.sendapp.ai/api/whatsapp-meta/get_templates?apikey=YOUR_API_KEY&token=YOUR_ACCOUNT_TOKEN'
<?php
$url = 'https://app.sendapp.ai/api/whatsapp-meta/get_templates?apikey=YOUR_API_KEY&token=YOUR_ACCOUNT_TOKEN';
$response = file_get_contents($url);
$data = json_decode($response, true);
print_r($data);
const params = new URLSearchParams({ apikey: 'YOUR_API_KEY', token: 'YOUR_ACCOUNT_TOKEN' });
const res = await fetch('https://app.sendapp.ai/api/whatsapp-meta/get_templates?' + params);
const data = await res.json();
console.log(data.templates);
Response (200 OK)
{
  "status": "success",
  "templates": [
    {
      "name": "order_confirmation",
      "language": "it",
      "category": "UTILITY",
      "status": "APPROVED",
      "components": [
        {
          "type": "BODY",
          "text": "Ciao {{1}}, il tuo ordine {{2}} è confermato."
        }
      ],
      "variables": [
        "1",
        "2"
      ]
    }
  ],
  "total": 1
}
Error
{
  "status": "error",
  "message": "WhatsApp Meta instance not found for this account"
}