Java 17 or later
Maven 3.3.2 or later
Configure the token as enviornment variable at runtime as illustrated below WHAPI_TOKEN=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Start ngrok to listen to the requests that are being sent to the channel. The default port is 8080.
ngrok http 8080
mvn clean package
export WHAPI_TOKEN=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
set WHAPI_TOKEN=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
If the variable is set with one of the above enviornment option the jar can be executed as given below.
java -jar ./whatsapp-bot-1.0.jar
It can also be passed during the jar execution as mentioned below.
java -DWHAPI_TOKEN=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -jar target/whatsapp-bot-1.0.jar
Configure the ngrok https url with the application listener endpoint in this case /webhook as the URL in the whapi dashboard.
