Get Template by ID
Retrieve a single WhatsApp message template by its Meta template ID — the numeric
id returned by List Templates. Includes the template's body text,
parameter format, status, and example values.
Authentication Required
Requires the x-api-key header. See Overview for details.
HTTP Request
GET /api/dragonfly/whatsapp/message_templates/:id
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The Meta template ID (numeric string, e.g. 1249453949471629) — not the template name. |
Try it
Loading playground…
Code Examples
- cURL
- JavaScript
- Python
curl -X GET "https://prod-api.superfone.co.in/superfone/api/dragonfly/whatsapp/message_templates/1249453949471629" \
-H "x-api-key: your_api_key_here"
const templateId = '1249453949471629';
const response = await fetch(
`https://prod-api.superfone.co.in/superfone/api/dragonfly/whatsapp/message_templates/${templateId}`,
{ headers: { 'x-api-key': process.env.SF_API_KEY } }
);
const result = await response.json();
console.log(result.data.name, result.data.language, result.data.status);
import os
import requests
template_id = '1249453949471629'
url = f'https://prod-api.superfone.co.in/superfone/api/dragonfly/whatsapp/message_templates/{template_id}'
headers = {'x-api-key': os.environ['SF_API_KEY']}
response = requests.get(url, headers=headers)
response.raise_for_status()
template = response.json()['data']
print(template['name'], template['language'], template['status'])
Success Response
Status Code: 200 OK
{
"data": {
"name": "hello__",
"parameter_format": "POSITIONAL",
"components": [
{
"type": "BODY",
"text": "Hello sir / ma'am\n {{1}}",
"example": { "body_text": [["Name"]] }
}
],
"language": "en",
"status": "APPROVED",
"category": "MARKETING",
"id": "1249453949471629",
"template_media": null
},
"message": "success"
}
Response Fields
| Field | Type | Description |
|---|---|---|
id | string | Meta template ID |
name | string | Template name — the templateName for Send Message |
language | string | Language code — pass this exact value as language when sending |
status | string | Approval status (APPROVED, PENDING, REJECTED, …) |
category | string | MARKETING, UTILITY, or AUTHENTICATION |
parameter_format | string | POSITIONAL (variables numbered {{1}}, {{2}}, …) or NAMED (variables like {{name}}, with example.body_text_named_params) |
components[] | object[] | Template structure (HEADER, BODY, FOOTER, BUTTONS) with text and example values |
template_media | object | null | Attached header media metadata, if any |
Error Responses
| Status | Message | When it occurs |
|---|---|---|
400 | (Meta error message) | Template ID doesn't exist or isn't accessible from your account |
401 | UnAuthorized, Please Provide Valid API Key | Missing or invalid x-api-key |
Related Endpoints
- List Templates — find template IDs
- Send Message — send an approved template