Enabling a webhook

In the previous section, you created entities and intents. When you were creating intents, you enabled a webhook call in the Fulfillment section of each intent. A webhook for Dialogflow is similar to the service endpoint that you defined in Alexa. The webhook will allow Dialogflow to submit the mapped intents back to the server you specified and it would be the responsibility of your server code to fulfill the request:

  1. Open Firefox or Chrome
  2. Go to https://console.dialogflow.com and log in to the Dialogflow
  3. If HenrysKitchen is not selected, click the down arrow in the top-left corner, and you should see HenrysKitchen agent
  4. In the left menu, click Fulfillment
  5. In the URL, enter https://myhenrytestapp.azurewebsites.net/dialogflow/cookingApi
  6. In the headers section, enter mysecret as the key and 12345 as the value
  7. Click Save

The following screenshot shows the enabled webhook:

Enabled webhook
Alexa and Dialogflow take very different approaches to the security. In Alexa, your server code performs a series of steps in order to verify the request sent by Alexa. To simplify the verification, you used the Alexa verifier Node.js component. In Dialogflow, you will setting up the secret key and value that Dialogflow will be injecting into the header that you will be verifying in your server code.