← Back to Blog

Building a WhatsApp Chatbot with Node.js and 5MinutesAPI

By 5MinutesAPI Engineering

Automating Level 1 Support

Customer support teams spend 80% of their time answering repetitive questions ("Where is my order?", "What are your hours?"). A basic WhatsApp chatbot can intercept these queries instantly.

The Webhook Loop

Building a bot with 5MinutesAPI is a simple request-response loop. When a user sends a message, our server POSTs the data to your Node.js backend. Your code parses the text, and fires a POST request back to our /send-message endpoint.



// Inside your Express Webhook Route
const userMessage = data.text.toLowerCase();

if (userMessage.includes("hours")) {
await fetch("https://api.5minutesapi.com/v1/send-message", {
method: "POST",
headers: { "Authorization": "Bearer YOUR_KEY", "Content-Type": "application/json" },
body: JSON.stringify({
to: data.from,
text: "We are open Monday to Friday, 9 AM to 6 PM EST!"
})
});
}

Zero Markup on Inbound Windows

When a user messages you, Meta opens a 24-hour "Service Window". With our Dedicated WABA, you pay the tiny Meta inbound fee, and $0.00 to us. You can exchange 10,000 bot messages in that 24-hour window for free.

Ready to upgrade your infrastructure?

Start Building with 5MinutesAPI