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.
See the developer guide at developers.viber.com for more details.
Create a new agent in DialogFlow.
Select "Export and Import".
Select "Restore from zip". Follow the directions to restore.
ViberSampleAgent.zip file in this repository.
[Optional] Set your Data.gov API key in the environment variable:
cp .env.sample .env.
.envwith your Data.gov API key.
Deploy this app to your preferred hosting environment.
Set the "Fulfillment" webhook URL to the deployment url. For instance on Heroku it will look like this
Enable Viber in the DialogFlow "Integrations" panel.
nutrition.info intents check both "Use webhook" and "Use webhook for slot-filling" in the "Fulfillment" section, and save the intent.
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.