Home > front end >  Receive WhatsApp messages using Node.js
Receive WhatsApp messages using Node.js

Time:02-16

I'm trying to read messages from users via WhatsApp api with ultramsg

and use NGROK

const express = require('express')
const bodyParser = require('body-parser')
const app = express()
const PORT = 4000
app.use(bodyParser.json())
app.listen(PORT, () => console.log(`Server running ${PORT}`))

ngrok show display 404 error

CodePudding user response:

You need Setup a webhook route

app.use(bodyParser.json())
app.post('/test_webhook', (req, res) => {
  console.log(req.body)
  res.status(200).end()
})

Now Webhook URL is : http://your_ngrok_url/test_webhook

  • Related