Skip to main content

¿Cuándo usar templates?

  • Cuando el contacto no te escribió en las últimas 24 horas
  • Para campañas o notificaciones proactivas
  • Para confirmaciones de pedido, envíos, pagos

1. Buscar templates disponibles

curl "https://api.waspytech.com/api/v2/templates?status=APPROVED" \
  -H "Authorization: Bearer wspy_tu_key"
Elegí un template y anotá su name y language.

2. Enviar template sin variables

curl -X POST https://api.waspytech.com/api/v2/messages \
  -H "Authorization: Bearer wspy_tu_key" \
  -H "Content-Type: application/json" \
  -d '{
    "phoneNumberId": "TU_CHANNEL_ID",
    "to": "+5491126032641",
    "type": "template",
    "template": {
      "name": "hello_world",
      "language": "en_US"
    }
  }'

3. Enviar template con variables

Si tu template tiene variables (ej: Hola {{1}}, tu pedido {{2}} fue confirmado):
curl -X POST https://api.waspytech.com/api/v2/messages \
  -H "Authorization: Bearer wspy_tu_key" \
  -H "Content-Type: application/json" \
  -d '{
    "phoneNumberId": "TU_CHANNEL_ID",
    "to": "+5491126032641",
    "type": "template",
    "template": {
      "name": "confirmacion_pedido",
      "language": "es_AR",
      "components": [
        {
          "type": "body",
          "parameters": [
            { "type": "text", "text": "María" },
            { "type": "text", "text": "#1847" }
          ]
        }
      ]
    }
  }'
Los parámetros se asignan en orden: {{1}} = primer parámetro, {{2}} = segundo, etc.

Errores comunes

ErrorCausaSolución
TEMPLATE_NOT_FOUNDEl template no existe o no está aprobadoVerificá nombre, idioma y que esté APPROVED
Error de Meta 132000Parámetros incorrectosRevisá cantidad y tipo de variables