Viber/DialogFlow (API.AI) webhook demonstration
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
img
lib
.env.sample
.gitignore
LICENSE
README.md
ViberSampleAgent.zip
app.json
package.json

README.md

Developing a Viber chatbot with DialogFlow (API.AI) and Node.js

In this example we are building a simple Viber chatbot using DialogFlow and Node.js. The final chatbot will generate nutrition responses for users based on the inputs they provide. The bot uses the data.gov nutrition facts API as its source.

Setup instructions

Prerequisites

  1. DialogFlow account
  2. Viber bot account
  3. Data.gov API key

See the developer guide at developers.viber.com for more details.

Deploy to:

Deploy to Heroku

Steps

  1. Create a new agent in DialogFlow.

  2. Click on the project gear icon (gear icon) to see the project settings.

  3. Select "Export and Import".

  4. Select "Restore from zip". Follow the directions to restore.

  5. Select the ViberSampleAgent.zip file in this repository.

  6. [Optional] Set your Data.gov API key in the environment variable:

    1. Copy the sample environment variable cp .env.sample .env.
    2. Edit .env with your Data.gov API key.
  7. Deploy this app to your preferred hosting environment.

  8. Set the "Fulfillment" webhook URL to the deployment url. For instance on Heroku it will look like this https://[App Name].herokuapp.com/hook.

  9. Enable Viber in the DialogFlow "Integrations" panel.

  10. For both meal.info and nutrition.info intents check both "Use webhook" and "Use webhook for slot-filling" in the "Fulfillment" section, and save the intent.

References and how to report bugs

If you find any issues with this sample, please open a bug here on GitHub.

Terms

Your use of this sample is subject to, and by using or downloading the sample files you agree to comply with, the Viber API Terms of Service.