Getting Started

Hooks

Advanced

Miscellaneous

Getting Started

Get started with JAWCE.

Java knowledge is assumed

The example chatbot comes with a sample template (eHailing chatbot) -
see my LinkedIn post here

Checkout the Official getting started to WhatsApp Cloud API.

I assume you have your WhatsApp account and credentials in place

Since JAWCE is developed with Java (porting to Kotlin WIP 🚧) it is natural that chatbot templates (conversation flow) are saved in the project src/main/resources/templates folder.

  • Clone JAWCE

    Clone or download the JAWCE chatbot sample project:

    git clone git@github.com:DonnC/jawce.git
    

    After successful clone, open the project in an IDE of your choice

  • Install dependencies

    Install project maven dependencies

    From now on, we will focus on the example folder with the sample chatbot

  • Setup Credentials

    Remember the WhatsApp Credentials we mentioned?

    Navigate to the /jchatbot/src/main/resources/application.yml properties file and replace secret keys with your account credentials

    chatbot:
        configs:
            # ...
            hub-token: "replace-with-your-hub-token"
            access-token: "replace-with-your-access-token"
            phone-number-id: "replace-with-your-phone-number-id"
    
  • Test Run

    Before you run the project, setup the full path to the project resources folder

    resources:
        templates: ..full/path/to/templates
        triggers: ..full/path/to/triggers
        watcher: ..full/path/to/watch
    

    E.g If you cloned the project in

    C:\Users\me\projects\jawce

    Your path folders will be as

    C:\\Users\\me\\projects\\jawce\\example\\jchatbot\\src\\main\\resources\\templates

    If all goes well,

    Start your development server

    Run the chatbot project, if all goes well. It should run on the port configured in the application properties file.

  • Webhook Config

    If the example chatbot run successfully. You can configure NGROK to tunnel your local setup to obtain an HTTPS webhook to configure on Meta developer portal.

    In a new terminal, do

    ngrok http 8080
    

    The webhook url will be accessible on https://ngrok-url/jawce/webhook which you can use to configure on your meta developer application portal as below

    Example dev console portal config