curl -X GET "https://api.whaapy.com/templates/v1/tmpl-uuid" \
-H "Authorization: Bearer wha_xxxxx"
{
"data": {
"id": "tmpl-uuid-1",
"name": "order_confirmation",
"category": "UTILITY",
"language": "es_MX",
"status": "APPROVED",
"content": "Hola {{1}}, tu pedido #{{2}} ha sido confirmado. Te avisaremos cuando esté en camino.",
"variables": ["{{1}}", "{{2}}"],
"components": [
{
"type": "HEADER",
"format": "IMAGE"
},
{
"type": "BODY",
"text": "Hola {{1}}, tu pedido #{{2}} ha sido confirmado. Te avisaremos cuando esté en camino.",
"example": {
"body_text": [["Juan", "12345"]]
}
},
{
"type": "FOOTER",
"text": "Gracias por tu compra"
},
{
"type": "BUTTONS",
"buttons": [
{
"type": "URL",
"text": "Rastrear pedido",
"url": "https://ejemplo.com/track/{{1}}"
}
]
}
],
"createdAt": "2026-01-15T10:00:00Z",
"updatedAt": "2026-01-15T10:00:00Z"
}
}
Obtén los detalles de un template específico
curl -X GET "https://api.whaapy.com/templates/v1/tmpl-uuid" \
-H "Authorization: Bearer wha_xxxxx"
{
"data": {
"id": "tmpl-uuid-1",
"name": "order_confirmation",
"category": "UTILITY",
"language": "es_MX",
"status": "APPROVED",
"content": "Hola {{1}}, tu pedido #{{2}} ha sido confirmado. Te avisaremos cuando esté en camino.",
"variables": ["{{1}}", "{{2}}"],
"components": [
{
"type": "HEADER",
"format": "IMAGE"
},
{
"type": "BODY",
"text": "Hola {{1}}, tu pedido #{{2}} ha sido confirmado. Te avisaremos cuando esté en camino.",
"example": {
"body_text": [["Juan", "12345"]]
}
},
{
"type": "FOOTER",
"text": "Gracias por tu compra"
},
{
"type": "BUTTONS",
"buttons": [
{
"type": "URL",
"text": "Rastrear pedido",
"url": "https://ejemplo.com/track/{{1}}"
}
]
}
],
"createdAt": "2026-01-15T10:00:00Z",
"updatedAt": "2026-01-15T10:00:00Z"
}
}
curl -X GET "https://api.whaapy.com/templates/v1/tmpl-uuid" \
-H "Authorization: Bearer wha_xxxxx"
{
"data": {
"id": "tmpl-uuid-1",
"name": "order_confirmation",
"category": "UTILITY",
"language": "es_MX",
"status": "APPROVED",
"content": "Hola {{1}}, tu pedido #{{2}} ha sido confirmado. Te avisaremos cuando esté en camino.",
"variables": ["{{1}}", "{{2}}"],
"components": [
{
"type": "HEADER",
"format": "IMAGE"
},
{
"type": "BODY",
"text": "Hola {{1}}, tu pedido #{{2}} ha sido confirmado. Te avisaremos cuando esté en camino.",
"example": {
"body_text": [["Juan", "12345"]]
}
},
{
"type": "FOOTER",
"text": "Gracias por tu compra"
},
{
"type": "BUTTONS",
"buttons": [
{
"type": "URL",
"text": "Rastrear pedido",
"url": "https://ejemplo.com/track/{{1}}"
}
]
}
],
"createdAt": "2026-01-15T10:00:00Z",
"updatedAt": "2026-01-15T10:00:00Z"
}
}
{
"error": "Template not found"
}
| Campo | Tipo | Descripción |
|---|---|---|
id | string | UUID interno de Whaapy |
name | string | Nombre del template (usado para enviar) |
category | string | MARKETING, UTILITY, AUTHENTICATION |
language | string | Código de idioma |
status | string | Estado de aprobación |
content | string | Texto del body (para preview) |
variables | array | Variables posicionales detectadas |
components | array | Estructura completa del template |
const template = response.data;
// Enviar el template
await fetch('https://api.whaapy.com/messages/v1', {
method: 'POST',
headers: {
'Authorization': 'Bearer wha_xxxxx',
'Content-Type': 'application/json'
},
body: JSON.stringify({
to: '+5215512345678',
type: 'template',
template: {
name: template.name,
language: template.language,
components: [
{
type: 'header',
parameters: [
{ type: 'image', image: { link: 'https://ejemplo.com/logo.png' } }
]
},
{
type: 'body',
parameters: template.variables.map((_, i) => ({
type: 'text',
text: i === 0 ? 'Juan' : '12345' // Reemplazar con valores reales
}))
},
{
type: 'button',
sub_type: 'url',
index: 0,
parameters: [
{ type: 'text', text: '12345' } // Valor para {{1}} en la URL
]
}
]
}
})
});