Viber API.AI Nutrition Sample

by Viber


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 nutrition facts API as its source.

Setup instructions


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

See the developer guide at for more details.

Deploy to:

Deploy to Heroku


  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 file in this repository.

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

    1. Copy the sample environment variable cp .env.sample .env.
    2. Edit .env with your 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]

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

  10. For both and 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.


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.