This is a webhook implementation that connects Facebook Messenger Apps (chatbots) to API.ai.
This work was inspired by api.ai's example webhook at https://github.com/api-ai/api-ai-facebook.
Software Dependencies:
- Node v6.0.0
- npm v3.8.6
To run locally do:
- Clone this repository to your machine
- Install node packages with
npm install - Ensure the following environment variables are set:
- APIAI_ACCESS_TOKEN="Your API.AI client access token"
- FB_PAGE_ACCESS_TOKEN="Your Facebook Page Access Token"
- FB_VERIFY_TOKEN="Your Facebook Verify Token"
- Start app with
npm start
You can either deploy with a pre-built image or buid one yourself. To use Hevlia.io's pre-build image do:
docker run -it --name api_ai_fb_webhook \
-p <your_desired_port_here>:5000 \
-e APIAI_ACCESS_TOKEN="Your API.AI client access token" \
-e FB_PAGE_ACCESS_TOKEN="Your Facebook Page Access Token" \
-e FB_VERIFY_TOKEN="Your Facebook Verify Token" \
-e APIAI_LANG="en" \
helvia/api_ai_fb:latestIf you want to build a new container do:
- Clone this repository to your machine
- Build with the following
docker build -t api-ai--fb-facebook .from within the project directory. - Run with :
bash docker run -it --name api_ai_fb_webhook -p <your_desired_port_here>:5000 -e APIAI_ACCESS_TOKEN="API.AI client access token" -e FB_PAGE_ACCESS_TOKEN="Your Facebook Page Access Token" -e FB_VERIFY_TOKEN="your Facebook Verify Token" -e APIAI_LANG="en" helvia/api-ai--fb-facebook:latest