This project receives webhook data from VanillaSoft and forwards it to a MySQL database. It's designed to capture Call History and Contact data streams.
npm install
-
Copy the config template:
cp config-template.env .env
-
Edit
.env
with your actual database credentials:# MySQL Database Configuration DB_HOST=70.60.99.114 DB_PORT=3306 DB_USER=CogentDataAdmin DB_PASS=your_actual_password DB_NAME=your_database_name # SSL Configuration DB_SSL=true # Server Configuration PORT=3000
npm start
The server will start on http://localhost:3000
and test the database connection.
- Call History:
POST /webhook/call
- Contact Data:
POST /webhook/contact
- Health Check:
GET /health
Test the webhooks with the included sample data:
# Test Call History endpoint
curl -X POST http://localhost:3000/webhook/call \
-H "Content-Type: application/json" \
-d @call_payload.json
# Test Contact endpoint
curl -X POST http://localhost:3000/webhook/contact \
-H "Content-Type: application/json" \
-d @contact_payload.json
Currently, the server logs all incoming webhook data to the console. This helps you:
- See exactly what VanillaSoft sends
- Understand field types and formats
- Design the database schema based on real data
When a webhook is received, you'll see detailed logs like:
📞 CALL HISTORY WEBHOOK RECEIVED:
Timestamp: 2025-01-15T19:30:00.000Z
Headers: {...}
Body: {...}
📋 CALL HISTORY FIELDS:
callDateUTC: 2025-01-15T14:30:00Z (string)
comment: Initial contact call (string)
contactId: 12345 (string)
...
Once you see the actual data from VanillaSoft, we can:
- Analyze the real payload structure
- Design MySQL tables that match the data types
- Add database insertion logic to replace the current logging
- Handle edge cases (null values, data validation, etc.)
- Configure VanillaSoft to send test webhooks to
http://localhost:3000
- Review the console logs to understand the data structure
- Create MySQL tables based on the actual field types and sizes
- Update the webhook handlers to insert data into the database
Configure these endpoints in VanillaSoft's "Outgoing Web Leads":
- Call History Stream:
http://localhost:3000/webhook/call
- Contact Stream:
http://localhost:3000/webhook/contact
Use JSON format and map the fields according to the field mapping tables in your playbook.
vs-webhook-sql/
├── package.json # Dependencies and scripts
├── index.js # Main server file
├── config-template.env # Environment variables template
├── call_payload.json # Sample call history data
├── contact_payload.json # Sample contact data
└── README.md # This file
- express: Web server framework
- mysql2: MySQL client with Promise support
- dotenv: Environment variable management
The server provides detailed logging for:
- Database connection status
- Incoming webhook headers and payloads
- Individual field analysis
- Server startup and health
- SSL is enabled for database connections
- Environment variables keep credentials secure
- TODO: Add HMAC signature verification for production use
For production, you'll need to:
- Deploy this server to a public endpoint
- Update VanillaSoft webhook URLs to point to your production server
- Move database credentials to a secure vault (like Workato's vault)
- Add proper error handling and retry logic
- Implement HMAC signature verification
Current Status: 🟡 Data Discovery Phase
- ✅ Server setup complete
- ✅ Webhook endpoints ready
- 🔄 Waiting for real VanillaSoft data to design database schema