This sample shows Dialogflow's fulfillment webhook JSON requests and responses for v1 and v2 agents, including Actions on Google-specific responses/requests for rich responses (cards, lists, suggestions, etc.) and event (ask for name, location, sign in, etc.) as well as platform-agnostic request/response examples.
- Sign-up/Login to Google account
- Create a Firebase project
- Deploy the
responses
directory with Firebase hosting:- Follow the instructions to set up and initialize Firebase SDK for Cloud Functions. Make sure to select the project that you have previously generated in the Actions on Google Console and to reply
N
when asked to overwrite existing files by the Firebase CLI. - Run
firebase deploy --only hosting
and take note of the endpoint where theresponses
folder has been published. It should look likeHosting URL: https://${PROJECTID}.firebaseapp.com
- Follow the instructions to set up and initialize Firebase SDK for Cloud Functions. Make sure to select the project that you have previously generated in the Actions on Google Console and to reply
- Select the correct JSON file for your Dialogflow fulfillment and take a note of the URL of the file (e.g.
https://${PROJECTID}.firebaseapp.com/v2/ActionsOnGoogle/RichResponses/SimpleResponse.json
) - Go to the Dialogflow console and select Fulfillment from the left navigation menu.
- Enable Webhook > URL to the URL of the JSON file from the previous step, then select Save.
- Go to Intents from the left navigation menu and for every intent that you'd like to enable fulfillment for:
- Select the intent
- In Fulfillment > Enable Webhook call for this intent.
- For bugs, please add an issue on Github.
- Questions? Try StackOverflow.
- For Dialogflow documentation.
Please read and follow the steps in the CONTRIBUTING.md
See LICENSE.md
Your use of this sample is subject to, and by using or downloading the sample files you agree to comply with, the Google APIs Terms of Service and Dialogflow's Terms of Use and Privacy Policy.