Search code examples
c#webhooksactions-on-googledialogflow-esgoogle-home

A Very simple dialgoue flow fulfillment webhook in c# not working


I am very new to webservices, i am basically trying to make a webhook in C# and host it on azure which will be the end point for a dialogflow fulfillment for google assistant. I searched a lot and found JSON response which the google assistant - dialogflow expects and did it in that manner. The link is given below.

http://sprotsapicoretest20180525012122.azurewebsites.net/api/values

If you hit a GET you will just get a "it is working test message." but if you hit a post from postman you will get a proper JSON.

However even though the response is received in POSTMAN, it doesnt work when actually trying it in dialogflow.

I am at my wits end and not being able to figure why doesnt it work even though the POST is working properly when tested in POSTMAN.

Any help will be highly highly appreciated.


Solution

  • You don't post what the errors are, so there are a number of possible causes for the problem.

    The two most likely problems in your case are

    1. You are not using an HTTPS endpoint with a valid SSL certificate.

    2. The JSON being returned in in v1 format and your Dialogflow project is using v2.

    If Dialogflow is sending back the responses you have set in the Intent rather than the responses you're sending back from the webhook, it is typically from one of these:

    1. You are not actually calling the webhook. Make sure the "Enable webhook call for this intent" is switched on.

      enter image description here

    2. Your webhook isn't returning anything, or what it is returning is incorrectly formatted. (Again, it could be that you're returning Dialogflow v2 formatted JSON from your C# code, but your Dialogflow project is set for v1.)