1

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.

Prisoner
  • 49,922
  • 7
  • 53
  • 105

1 Answers1

3

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.)

Prisoner
  • 49,922
  • 7
  • 53
  • 105
  • well their is no error as it simply reverts to my default response – Mikdad Merchant Jun 12 '18 at 09:09
  • also the link is https and regarding version what is the simple jain v2 the link on the console gives a very complicated json – Mikdad Merchant Jun 12 '18 at 09:15
  • i mean the api link i have given works even if i type https instead of http – Mikdad Merchant Jun 12 '18 at 09:17
  • If there is "no error", then what "doesn't work"? What do you get in the simulator if you test it through the simulator? Do you have Dialogflow's logging turned on and what does it say? Is it even hitting your webhook? I understand your link works for both http and https, but did you setup fulfillment to use the https url? – Prisoner Jun 12 '18 at 10:14
  • Did you confirm if your project is set for v2? If you are set for v2, then this is the problem since you're sending v1 JSON back. – Prisoner Jun 12 '18 at 10:15
  • in the simulator the fulfilment speech output doesn’t come just default output comes – Mikdad Merchant Jun 12 '18 at 10:30
  • Is the Dialogflow project set for v1 or v2? – Prisoner Jun 12 '18 at 10:44
  • When you say the "default output", do you mean the Responses that you have set in the Intent? – Prisoner Jun 12 '18 at 10:44
  • Have you confirmed that your webhook is being called at all when you do something through the simulator? – Prisoner Jun 12 '18 at 10:45
  • you were right i was using wrong json with wrong version thanks a million you put to rest a big issue yaar – Mikdad Merchant Jun 13 '18 at 18:29
  • Glad we were able to figure out the problem! If the answer helps, accepting and/or upvoting it is always appreciated. – Prisoner Jun 13 '18 at 18:47
  • we developers are never satisfied – Mikdad Merchant Jun 14 '18 at 08:33
  • hey bro can you look at my edit, went a little forward and once again got stuck. – Mikdad Merchant Jun 14 '18 at 09:48
  • That isn't an edit - that was removing the old question and creating a new one. {: I'd suggest reverting the question to what it was (you asked it, it was answered) and create a new question with as much information about the problem you're having (code, errors, etc) – Prisoner Jun 14 '18 at 10:29
  • Value cannot be null. Parameter name: value – Mikdad Merchant Jun 14 '18 at 10:47
  • 1
    I still suggest you create a new question. Updating questions is for adding new information (such as the error), not replacing it and asking something different. New questions are good things! – Prisoner Jun 14 '18 at 10:54
  • ok posted a new question, if you know the answer please help the link of the thread is https://stackoverflow.com/questions/50856306/dialogueflow-simple-fulfillment-webhook-in-c-sharp-not-working – Mikdad Merchant Jun 14 '18 at 11:20