To receive messages from your customers, you need to configure a webhook for your Whatsapp Business Account. The webhook is a URL that you provide to Whatsapp to send messages to your application.

Configuring Webhook for local development setup

Getting a public URL for your local development setup

You may sometimes face an error on the whatsapp webhook management dashboard saying that the URL is malicious in case when you are using NGROK, in that case you must go ahead with using cloudflare tunnel.

NGROK

If you are developing your application locally, you can use ngrok to expose your local server to the internet.

To use ngrok, follow these steps:

  1. Download and install ngrok from here.
  2. Run the following command in your terminal to expose your local server to the internet:
ngrok http http://localhost:<your-application-port>
  1. You will see something like this in your terminal:
Make sure to replace <your-application-port> with the port number on which your application is running.

Cloudflare Tunnel

To use cloudflare tunnel, follow these steps:

  1. Download and install cloudflare tunnel from here.
  2. Run the following command in your terminal to expose your local server to the internet:
cloudflared tunnel --url http://localhost:<your-application-port>
  1. You will see something like this in your terminal:
Make sure to replace <your-application-port> with the port number on which your application is running.

Submitting URL to whatsapp business platform

Follow the steps below to submit your webhook URL to the Whatsapp Business Platform and enable incoming events routing to your local development setup:

1

2

3

4

Make sure your Wapi.js local application is up and running before proceeding with verify and save process.