← All Build Logs
AI AgentsAutomation & WorkflowsFailures & FixesFailed → Fixed

Building a WhatsApp AI Chatbot With Zero API Experience

Building a WhatsApp AI Chatbot With Zero API Experience

I built a WhatsApp AI chatbot in 4 hours with zero API experience. Here's my messy, error-filled journey.

I wanted a bot that could reply to customer questions on WhatsApp automatically. I'd never touched a webhook before. I barely knew what a JSON payload was. This is the exact, unfiltered path from "I have no idea what I'm doing" to "it actually works."

The Meta Portal Maze

I assumed setting up WhatsApp's Business API would feel like Telegram — grab a token, start coding. It didn't.

To send or receive messages, you need a Meta Business Account, a WhatsApp Business App inside Meta's developer console, and a verified phone number. Just finding the right IDs took me over an hour. There are two IDs that look similar but do completely different jobs:

  • Phone Number ID — identifies which WhatsApp number is sending the message
  • WhatsApp Business Account ID (WABA ID) — identifies the business account itself

I kept copying the wrong one into my requests and getting cryptic permission errors.

Getting n8n Talking to the Internet

I installed n8n locally to handle the logic without writing a full backend. Problem: Meta needs a public HTTPS URL to send webhook events to, and my n8n instance was sitting on localhost. I used ngrok to tunnel it out:

ngrok http 5678

That worked — but it also meant anyone who found my ngrok URL could hit my n8n instance directly, with no login. I added basic auth before going further:

ngrok http 5678 --basic-auth="admin:strongpassword123"

Lesson: never expose a local dev tool to the public internet without locking the door first.

The Body Payload That Actually Works

This is the part I got wrong the first time I wrote this story up, so let's get it exactly right.

The Phone Number ID isn't something you put inside the JSON body — it's part of the endpoint URL itself:

POST https://graph.facebook.com/v20.0/{PHONE_NUMBER_ID}/messages

The JSON body that actually goes with that request looks like this:

{
  "messaging_product": "whatsapp",
  "to": "15551234567",
  "type": "text",
  "text": {
    "body": "Hi, how can I help?"
  }
}

My first attempt left out messaging_product entirely and got a 400 error with a vague "Unsupported request" message. Once I matched the exact shape Meta expects — messaging_product, to, type, and a nested text.body — it went through cleanly.

Verify the endpoint version (v20.0 above) against Meta's current documentation before publishing — this number moves forward over time.

The "It Works" Moment

I sent "Hello" from my personal WhatsApp to the test number. A few seconds later: "Hi, how can I help?" I actually cheered out loud. Small win, but it was the first time the whole chain — WhatsApp → Meta → webhook → n8n → response — worked end to end.

What I'd Do Differently

If I started over, I'd test the raw HTTP request in Postman first, before ever touching n8n's dedicated WhatsApp node — it's much easier to see exactly what payload shape is expected when you're not also debugging a visual workflow tool at the same time. I also wouldn't put this in front of real customers yet; I have no rate limiting, no error handling for malformed messages, and no fallback if Meta's webhook retries duplicate events. That's the next problem to solve, not this one.

Want something like this built for your business?

See AI Agents services

Related Build Logs

Comments

No comments yet — be the first.