chat widget
# support
u
Want to send structured data to custom web-hook made on Make.com for chat widget. #1211483291191083018 #chatwidget
v
To send structured chat data from the Vapi chat widget to your Make.com webhook, add a JavaScript event listener for the widget's
message
event and forward the data using
fetch
. Here’s a concrete example:
Copy code
javascript
document.addEventListener('DOMContentLoaded', function() {
  const widget = document.querySelector('vapi-widget');
  widget.addEventListener('message', function(event) {
    fetch('https://your-make-webhook-url.com', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify(event.detail) // event.detail contains the chat message
    });
  });
});
Replace
https://your-make-webhook-url.com
with your actual Make.com webhook URL.
This will forward each chat message as structured JSON to your webhook for further processing. Source: - [Vapi Web Widget Documentation](https://docs.vapi.ai/chat/web-widget)
u
What Assistant is doing is that collecting name,email number and an appointment date. Want to send this data in json to webhook.
Event is not being called. It’s being loaded but when i click on end chat button its not being called
c
Hi Usman, How can I assist you with the setup or configuration of the Vapi Web Widget? Let me know if you have any specific questions or if you need guidance on integrating or customizing the widget. You can also find detailed documentation for embedding the widget and customizing its appearance [here](https://docs.vapi.ai/chat/web-widget).
3 Views