0

I have an issue, I would like that Dialogflow executes C# code in my computer as a response to a determined Intent. I imagine the webhook feature offers a way of calling and executing locally a C# code. However, I have not found any guidance about this.

Thanks for your time!

2 Answers2

0

Fulfillment allows Dialogflow to call your own HTTPS endpoint in response to particular intents being matched; you can find the documentation here.

Your endpoint will receive a POST containing JSON with the same format as you'll see in the test console in Dialogflow's UI.

Daniel Situnayake
  • 2,874
  • 2
  • 30
  • 38
0

use this https://www.nuget.org/packages/Google.Apis.Dialogflow.v2/ it's a nuget specifically for dialogflow, and it's so easy to see the intents like this.

public GoogleCloudDialogflowV2WebhookResponse Post(GoogleCloudDialogflowV2WebhookRequest obj)
    {
            string Location = string.Empty;

            switch (obj.QueryResult.Intent.DisplayName)
            {
                case "getstock":
                Location = obj.QueryResult.Parameters["Location"].ToString();
                break;
            }

            var response = new GoogleCloudDialogflowV2WebhookResponse()
            {
                FulfillmentText = $"The stock at {Location} is valuing Rs. 31 Lakhs \n And consists of items such as slatwall, grid and new pillar. The detailed list of the same has been email to you",
                Source = "API.AI"
            };

            return response;
    }

from this answer: dialogflow simple fulfillment webhook in c# not working

PinoyDev
  • 949
  • 1
  • 10
  • 21