Fariba.Cristhian
Fariba.Cristhian

Reputation: 15

Receive WhatsApp messages using Node.js

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

Upvotes: 0

Views: 1047

Answers (1)

ViktorEmmanuel_dev
ViktorEmmanuel_dev

Reputation: 51

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

Upvotes: 1

Related Questions