Getting Started
The engine comes with sample templates - you can set your credentials and if all goes well, start your chatbot with
start
The JAWCE engine reads your conversation flow (templates
) directly from the project resources\templates
and resources\triggers
folder. To get started:
- Create a
templates
directory in..\resources\templates
if it does not exist. - Create a
triggers
directory in..\resources\triggers
if it does not exist. - Add some templates files in the
.yaml
format to define your bot message flows. - Add a
trigger.yaml
inside the..\resources\triggers
to define your bot message global triggers.
Before running, you must have WhatsApp credentials all set
Checkout the getting started to WhatsApp Cloud API.
Running locally#
If running on different port, use your custom port in place of 8080
The default engine uses file based H2 database. The file is saved under ./data/JavaWhatsappEngineDb
when the engine starts.
You can access the H2 console by opening your browser at http://localhost:8080/h2-console
. Use the config as below to connect.
![](https://raw.githubusercontent.com/donnc/jawce/main/docs/assets/h2-console.png)
After the project is up and running, set your credentials by making a post request or add the data in the database manually
POST: http://localhost:port/webhook/config
Checkout the Postman Collection
{
"accessToken": "",
"hubToken": "jawce-hub-token-123",
"phoneNumberId": "",
"apiVersion": "v18.0"
}
![](https://raw.githubusercontent.com/donnc/jawce/main/docs/assets/h2-data.png)
If all goes well, RESTART the service.
Meta Developer#
I assume you already set your meta / facebook / whatsapp account and have access to the developer portal of your application
When the project is running successfully, you can use NGROK to tunnel the engine service to enable WhatsApp to send webhook request to the engine
$ ngrok http 8080
The webhook url will be accessible on https://ngrok-url/webhook
which you can use to configure on your meta developer application portal as below
![](https://raw.githubusercontent.com/donnc/jawce/main/docs/assets/ngrok.png)
Portal config
![](https://raw.githubusercontent.com/donnc/jawce/main/docs/assets/webhook-config.png)