Skip to content

Integración del Webhook de WhatsApp en Node.js #111417

Discussion options

You must be logged in to vote

Usa Twilio para que puedas integrar whatsapp con node, un tiempo lo use y va de maravilla pero recuerda que cobra comiciones

`const express = require('express');
const bodyParser = require('body-parser');

const app = express();
const port = 3000;

app.use(bodyParser.urlencoded({ extended: false }));

app.post('/webhook', (req, res) => {
const message = req.body.Body;
const sender = req.body.From;

console.log(Mensaje recibido de ${sender}: ${message});

// Aquí puedes agregar la lógica para procesar el mensaje recibido

res.sendStatus(200);
});

app.listen(port, () => {
console.log(Servidor corriendo en http://localhost:${port});
});
`

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@connuna
Comment options

Answer selected by connuna
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API and Webhooks Discussions and conversations related to APIs or Webhooks Question
3 participants