Getting Started

Get started with WCE.

I assume you have your WhatsApp account and credentials in place

Checkout the corresponding WCE above for full details on engine configuration. The basic steps to configure each of the engine is as below

  • Clone engine

    Clone or download your preferred engine repository:

    # java
    git clone git@github.com:DonnC/jawce.git
    
    # python
    git clone git@github.com:DonnC/pywce.git
    

    After successful clone, open the project in an IDE of your choice (Both engines are developed using JetBrains IDEs)

  • Install dependencies

    For JAWCE - Install project maven dependencies

    For PYWCE - Pip install requirements in requirements.txt

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

  • Setup Credentials

    Remember the WhatsApp Credentials we mentioned?

    For Java

    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"
    

    For Python

    Navigate to the Settings.py file and set your configs appropriately

  • Test Run

    For Java

    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.

    For Python

    The sample chatbot uses FastApi. Ensure fastapi is installed

  • Webhook Config

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

    In a new terminal, do

    ngrok http <service port>
    

    The webhook url will be accessible on https://ngrok-url/jawce/webhook for JAWCE and https://ngrok-url/pywce/webhook for PYWCE.

    You can use the generated https url to configure on your meta developer application portal as below

    Example dev console portal config