thinkty / dialogflow-tester

A simple Node based Webhook to test Dialog Flow APIs and mock webhook for fulfillment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DialogFlow Tester (Mock Fulfillment Webhook)

wehbooks in DialogFlow Image from DialogFlow

This is a simple Node+Express Webhook to test DialogFlow V2 APIs and mock a fulfillment webhook locally while meeting the requirements. It uses an npm version of ngrok to get a secure public url which is a core requirement for registering a webhook to DialogFlow. Depending on how the program is started, the requests or responses will be stored locally in a json file.

Install

  1. Clone the repository and install the npm dependencies
git clone https://github.com/thinkty/dialogflow-tester.git
npm install
  1. After downloading the dependencies, start the application with either npm run request to test requests from DialogFlow or npm run response to test sending responses from this application to DialogFlow.

  2. After successfully launching the application, in the terminal, there should be a secured (https) public url from ngrok.

  3. Copy the url and paste it in to the DialogFlow console. Go to DialogFlow console > Fulfillment > Webhook and paste the ngrok url in the url input field and click save. dialogflow console for webhook

  4. Click on Save and type into the Try it now input field to test your webhook. Make sure to enable webhook in the Fulfillment section of the intent.

Customization

You can also modify the generateResponse function to add your own payloads to the response back to DialogFlow.

License

MIT

About

A simple Node based Webhook to test Dialog Flow APIs and mock webhook for fulfillment

License:MIT License


Languages

Language:JavaScript 100.0%