How to receive data from WATI and post it into HubSpot

Hi, I am new to HubSpot. I am currently using WATI as my WhatsApp API business provider.

What I want to achieve is, As the user interacts with my WATI bot, I want to capture the relevant information such as name, and email and send it to HubSpot to perform further operations on the retrieved data.
WATI has a Webhook functionality where I can POST data and I am using use HubSpot automation’s GET method to retrieve the data.
I have created a simple express server that performs the get and post method

index.js

const express = require('express')const app = express()const port = 3000app.post('/test', (req, res) => { // Receive data from WATI console.log("Receive data from WATI ", req.query) res.send()})app.get('/test', (req, res) => { // res = JSON.parse(req) console.log("Hubspot ", req.query) res.send(req.query)})app.listen(port, () => { console.log(Example app listening on port ${port})})

WATI GET URL: https://10ec-183-87-190-26.ngrok.io/test?&name=name
HubSpot POST URL: https://10ec-183-87-190-26.ngrok.io/test

WATI webhook interface:

Output:

RShaikh1_0-1664291159664.png

Hubspot Test action output:

1. Is there a better way I can achieve my goal?

2. How do I trigger the workflow in HubSpot as soon as the webhook in WATI is triggered and store that data?

I guess I’m not understanding the flow here. If you want to get data into HubSpot, why are you doing a GET to HubSpot. You also say “HubSpot automation’s GET method”. Do you mean HubSpot’s API?

Generally once your external system has data you would need to send a POST request to one of HubSpot’s API endpoints to create or update the data in HubSpot. One viable endpoint would be the Form Submission API which can create contacts as well as update properties of existing contacts.