question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Documentation for Dialogflow web hooks on ASP.NET

See original GitHub issue

I’m currently having a problem of sending a comprehensible response from my webhook API to Actions on Google. Below is the code sample where I set up the webhook response:

var response = new WebhookResponse
            {
                FulfillmentText = text,
                OutputContexts =
                {
                    new Context
                    {
                        Name = $"{request.Session}/contexts/action_selecting",
                        Parameters = parameters,
                        LifespanCount = 1
		    }
		}
	    }
	return response;

This works perfectly when I want to form a response to Dialogflow, but not Actions on Google. I also noticed that it can still work with Actions on Google if I remove the outputcontext from the response. In the following image is the error I found on Actions on Google from the log: image

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:19

github_iconTop GitHub Comments

1reaction
jskeetcommented, May 24, 2019

Some sample code for the response - untested, but I’d hope it would be okay…

var response = new HttpResponseMessage(HttpStatusCode.OK)
{
    Content = new StringContent(Json)
    {
        Headers = { ContentType = new MediaTypeHeaderValue("text/json") }
    }
};

Then return that from your method.

0reactions
kobelinh24commented, Jun 14, 2019

The new docs will be published when we next do a release for Dialogflow, which I expect to be next week. (We generally don’t release on Fridays.)

That’s good to know, hope that this can somehow contribute to the development of Dialogflow and .NET 💃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Integration of Google Dialogflow Webhook Fullfillment and ...
In this tutorial, I would like to introduce how to integrate Google Dialogflow Webhook and Web API using .NET Core and C#.
Read more >
.NET client library | Google Cloud
Dialogflow.V2 is a.NET client library for the Google Cloud Dialogflow API. Note: This documentation is for version 4.11.0 of the library.
Read more >
ASP.Net | Part - 11 | Create Chatbots using Dialogflow(API.AI ...
Webhook : ASP. Net | Part - 11 | Create Chatbots using Dialogflow (API.AI) & deploy on GCloud ##################################### Create ...
Read more >
How to use C# and Google.Cloud.Dialogflow.Cx.V3 ...
I've created a webhook using C# and ASP.NET Core in order to try to generate the webhook response to DialogFlow, but I'm really...
Read more >
Dialogflow fulfillment with C# and App Engine - Mete Atamel
A fulfillment is a HTTPS webhook that Dialogflow can forward requests to. From then on, your code is in charge of handling the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found