Artículo de ayuda · Waclis

Ejemplo CAL 4 y 5: gestionar Webhooks e integrar un asistente por MCP

Ejemplo CAL 4 y 5: gestionar Webhooks e integrar un asistente por MCP

Este tutorial combina los ejemplos 4 y 5 de integración avanzada con WaclisCAL: cómo procesar eventos en tiempo real mediante Webhooks firmados y cómo conectar un asistente conversacional de IA al servidor MCP del Tipo de Evento.


1. Ejemplo 4: Receptor de eventos Webhook (X-Cal-Signature-256)

Al recibir un POST desde WaclisCAL en tu endpoint HTTPS, verifica la firma HMAC-SHA256 e inspecciona triggerEvent (BOOKING_CREATED, BOOKING_RESCHEDULED, BOOKING_CANCELLED) y payload.uid para actualizar el turno en tu sistema interno de forma idempotente.


2. Ejemplo 5: Conectar un asistente conversacional con WaclisCAL vía MCP

# 1. Consultar disponibilidad desde el asistente IA usando tools/call (get_availability)
curl -sS -X POST "https://cal.waclis.com/api/wacliscal/mcp/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer ${WACLISCAL_EVENT_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 10,
    "method": "tools/call",
    "params": {
      "name": "get_availability",
      "arguments": {
        "from": "2026-11-16",
        "to": "2026-11-18",
        "time_zone": "America/Argentina/Buenos_Aires"
      }
    }
  }'

# 2. Confirmar el turno elegido por el usuario mediante create_booking
curl -sS -X POST "https://cal.waclis.com/api/wacliscal/mcp/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer ${WACLISCAL_EVENT_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 11,
    "method": "tools/call",
    "params": {
      "name": "create_booking",
      "arguments": {
        "start": "2026-11-16T15:00:00-03:00",
        "time_zone": "America/Argentina/Buenos_Aires",
        "attendee": {
          "name": "Martín Gómez",
          "email": "martin@empresa-demo.com",
          "phone_number": "+5491144445555"
        }
      }
    }
  }'

¿Necesitas más ayuda?

Si este artículo no resolvió tu consulta, nuestro equipo puede ayudarte personalmente.

Soporte por WhatsApp
QA · /ayuda-test