Template-wise delivery, read, and failure counts.
Template Analytics
Summary
Template-wise delivery, read, and failure counts.
Prerequisites
- Authorization: Bearer w91_live_xxx
- Content-Type: application/json for JSON requests
Related documentation
Endpoint: GET /api/v2/reports/analytics/templates. Template-wise delivery counts.
GET
/api/v2/reports/analytics/templates| Parameter | Type | Required | Description |
|---|---|---|---|
senderId | string | Optional | WhatsApp sender phone number. |
dateFrom | string | Optional | YYYY-MM-DD start date. |
dateTo | string | Optional | YYYY-MM-DD end date. |
storage | string | Optional | live or archive. |
templateName | string | Optional | Optional template name filter. |
Get template analytics
curl "https://graph.whats91.com/api/v2/reports/analytics/templates?templateName=payment_reminder" \
-H "Authorization: Bearer w91_live_xxx"Template analytics response
{
"success": true,
"data": {
"templates": [
{
"templateName": "payment_reminder",
"sent": 90,
"delivered": 80,
"read": 55,
"failed": 5
}
]
}
}SDK Examples
Use these examples as starting points for server-side implementations.
cURL
curl -X GET "https://graph.whats91.com/api/v2/reports/analytics/templates" \
-H "Authorization: Bearer w91_live_xxx"Node.js
const response = await fetch("https://graph.whats91.com/api/v2/reports/analytics/templates", {
method: "GET",
headers: {
"Authorization": "Bearer w91_live_xxx",
"Content-Type": "application/json"
}
});
const data = await response.json();
console.log(data);PHP
$ch = curl_init("https://graph.whats91.com/api/v2/reports/analytics/templates");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer w91_live_xxx",
"Content-Type: application/json"
]
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;Python
import requests
response = requests.request(
"GET",
"https://graph.whats91.com/api/v2/reports/analytics/templates",
headers={
"Authorization": "Bearer w91_live_xxx",
"Content-Type": "application/json",
}
)
print(response.json())C#
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer w91_live_xxx");
var request = new HttpRequestMessage(HttpMethod.Get, "https://graph.whats91.com/api/v2/reports/analytics/templates");
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());