public sealed class WebhookResponse : IMessage<WebhookResponse>, IEquatable<WebhookResponse>, IDeepCloneable<WebhookResponse>, IBufferMessage, IMessage
Reference documentation and code samples for the Google Cloud Dialogflow v2beta1 API class WebhookResponse.
The response message for a webhook call.
This response is validated by the Dialogflow server. If validation fails,
an error will be returned in the
[QueryResult.diagnostic_info][google.cloud.dialogflow.v2beta1.QueryResult.diagnostic_info]
field. Setting JSON fields to an empty value with the wrong type is a common
error. To avoid this error:
Optional. Indicates that this intent ends an interaction. Some integrations
(e.g., Actions on Google or Dialogflow phone gateway) use this information
to close interaction with an end user. Default is false.
public RepeatedField<Intent.Types.Message> FulfillmentMessages { get; }
Optional. The rich response messages intended for the end-user.
When provided, Dialogflow uses this field to populate
[QueryResult.fulfillment_messages][google.cloud.dialogflow.v2beta1.QueryResult.fulfillment_messages]
sent to the integration or API caller.
Optional. The text response message intended for the end-user.
It is recommended to use fulfillment_messages.text.text[0] instead.
When provided, Dialogflow uses this field to populate
[QueryResult.fulfillment_text][google.cloud.dialogflow.v2beta1.QueryResult.fulfillment_text]
sent to the integration or API caller.
Indicates that a live agent should be brought in to handle the
interaction with the user. In most cases, when you set this flag to true,
you would also want to set end_interaction to true as well. Default is
false.
public RepeatedField<Context> OutputContexts { get; }
Optional. The collection of output contexts that will overwrite currently
active contexts for the session and reset their lifespans.
When provided, Dialogflow uses this field to populate
[QueryResult.output_contexts][google.cloud.dialogflow.v2beta1.QueryResult.output_contexts]
sent to the integration or API caller.
Optional. This field can be used to pass custom data from your webhook to
the integration or API caller. Arbitrary JSON objects are supported. When
provided, Dialogflow uses this field to populate
[QueryResult.webhook_payload][google.cloud.dialogflow.v2beta1.QueryResult.webhook_payload]
sent to the integration or API caller. This field is also used by the
Google Assistant
integration
for rich response messages.
See the format definition at Google Assistant Dialogflow webhook
format
public RepeatedField<SessionEntityType> SessionEntityTypes { get; }
Optional. Additional session entity types to replace or extend developer
entity types with. The entity synonyms apply to all languages and persist
for the session. Setting this data from a webhook overwrites
the session entity types that have been set using detectIntent,
streamingDetectIntent or
[SessionEntityType][google.cloud.dialogflow.v2beta1.SessionEntityType]
management methods.
Optional. A custom field used to identify the webhook source.
Arbitrary strings are supported.
When provided, Dialogflow uses this field to populate
[QueryResult.webhook_source][google.cloud.dialogflow.v2beta1.QueryResult.webhook_source]
sent to the integration or API caller.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eWebhookResponse\u003c/code\u003e class is used for sending response messages from a webhook call to the Dialogflow server and is validated by the server, with errors reported in the \u003ccode\u003eQueryResult.diagnostic_info\u003c/code\u003e field.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eWebhookResponse\u003c/code\u003e class implements several interfaces including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, and can be instantiated via a default constructor or a copy constructor.\u003c/p\u003e\n"],["\u003cp\u003eKey properties of the \u003ccode\u003eWebhookResponse\u003c/code\u003e class include \u003ccode\u003eEndInteraction\u003c/code\u003e, \u003ccode\u003eFollowupEventInput\u003c/code\u003e, \u003ccode\u003eFulfillmentMessages\u003c/code\u003e, \u003ccode\u003eFulfillmentText\u003c/code\u003e, \u003ccode\u003eLiveAgentHandoff\u003c/code\u003e, \u003ccode\u003eOutputContexts\u003c/code\u003e, \u003ccode\u003ePayload\u003c/code\u003e, \u003ccode\u003eSessionEntityTypes\u003c/code\u003e, and \u003ccode\u003eSource\u003c/code\u003e, allowing for rich and custom interactions.\u003c/p\u003e\n"],["\u003cp\u003eCommon errors in \u003ccode\u003eWebhookResponse\u003c/code\u003e validation can be avoided by using \u003ccode\u003e""\u003c/code\u003e for empty strings, \u003ccode\u003e{}\u003c/code\u003e or \u003ccode\u003enull\u003c/code\u003e for empty objects, and \u003ccode\u003e[]\u003c/code\u003e or \u003ccode\u003enull\u003c/code\u003e for empty arrays, as outlined in the Protocol Buffers Language Guide.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eWebhookResponse\u003c/code\u003e properties provide options to specify text responses, rich messages, custom data, session entity types, output contexts, and whether to end the interaction or involve a live agent, enhancing the control over the conversational flow.\u003c/p\u003e\n"]]],[],null,["# Google Cloud Dialogflow v2beta1 API - Class WebhookResponse (1.0.0-beta23)\n\nVersion latestkeyboard_arrow_down\n\n- [1.0.0-beta23 (latest)](/dotnet/docs/reference/Google.Cloud.Dialogflow.V2Beta1/latest/Google.Cloud.Dialogflow.V2Beta1.WebhookResponse)\n- [1.0.0-beta22](/dotnet/docs/reference/Google.Cloud.Dialogflow.V2Beta1/1.0.0-beta22/Google.Cloud.Dialogflow.V2Beta1.WebhookResponse) \n\n public sealed class WebhookResponse : IMessage\u003cWebhookResponse\u003e, IEquatable\u003cWebhookResponse\u003e, IDeepCloneable\u003cWebhookResponse\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Google Cloud Dialogflow v2beta1 API class WebhookResponse.\n\nThe response message for a webhook call.\n\nThis response is validated by the Dialogflow server. If validation fails,\nan error will be returned in the\n\\[QueryResult.diagnostic_info\\]\\[google.cloud.dialogflow.v2beta1.QueryResult.diagnostic_info\\]\nfield. Setting JSON fields to an empty value with the wrong type is a common\nerror. To avoid this error:\n\n- Use `\"\"` for empty strings\n- Use `{}` or `null` for empty objects\n- Use `[]` or `null` for empty arrays\n\nFor more information, see the\n[Protocol Buffers Language\nGuide](https://developers.google.com/protocol-buffers/docs/proto3#json). \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e WebhookResponse \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[WebhookResponse](/dotnet/docs/reference/Google.Cloud.Dialogflow.V2Beta1/latest/Google.Cloud.Dialogflow.V2Beta1.WebhookResponse), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[WebhookResponse](/dotnet/docs/reference/Google.Cloud.Dialogflow.V2Beta1/latest/Google.Cloud.Dialogflow.V2Beta1.WebhookResponse), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[WebhookResponse](/dotnet/docs/reference/Google.Cloud.Dialogflow.V2Beta1/latest/Google.Cloud.Dialogflow.V2Beta1.WebhookResponse), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Dialogflow.V2Beta1](/dotnet/docs/reference/Google.Cloud.Dialogflow.V2Beta1/latest/Google.Cloud.Dialogflow.V2Beta1)\n\nAssembly\n--------\n\nGoogle.Cloud.Dialogflow.V2Beta1.dll\n\nConstructors\n------------\n\n### WebhookResponse()\n\n public WebhookResponse()\n\n### WebhookResponse(WebhookResponse)\n\n public WebhookResponse(WebhookResponse other)\n\nProperties\n----------\n\n### EndInteraction\n\n public bool EndInteraction { get; set; }\n\nOptional. Indicates that this intent ends an interaction. Some integrations\n(e.g., Actions on Google or Dialogflow phone gateway) use this information\nto close interaction with an end user. Default is false.\n\n### FollowupEventInput\n\n public EventInput FollowupEventInput { get; set; }\n\nOptional. Invokes the supplied events.\nWhen this field is set, Dialogflow ignores the `fulfillment_text`,\n`fulfillment_messages`, and `payload` fields.\n\n### FulfillmentMessages\n\n public RepeatedField\u003cIntent.Types.Message\u003e FulfillmentMessages { get; }\n\nOptional. The rich response messages intended for the end-user.\nWhen provided, Dialogflow uses this field to populate\n\\[QueryResult.fulfillment_messages\\]\\[google.cloud.dialogflow.v2beta1.QueryResult.fulfillment_messages\\]\nsent to the integration or API caller.\n\n### FulfillmentText\n\n public string FulfillmentText { get; set; }\n\nOptional. The text response message intended for the end-user.\nIt is recommended to use `fulfillment_messages.text.text[0]` instead.\nWhen provided, Dialogflow uses this field to populate\n\\[QueryResult.fulfillment_text\\]\\[google.cloud.dialogflow.v2beta1.QueryResult.fulfillment_text\\]\nsent to the integration or API caller.\n\n### LiveAgentHandoff\n\n public bool LiveAgentHandoff { get; set; }\n\nIndicates that a live agent should be brought in to handle the\ninteraction with the user. In most cases, when you set this flag to true,\nyou would also want to set end_interaction to true as well. Default is\nfalse.\n\n### OutputContexts\n\n public RepeatedField\u003cContext\u003e OutputContexts { get; }\n\nOptional. The collection of output contexts that will overwrite currently\nactive contexts for the session and reset their lifespans.\nWhen provided, Dialogflow uses this field to populate\n\\[QueryResult.output_contexts\\]\\[google.cloud.dialogflow.v2beta1.QueryResult.output_contexts\\]\nsent to the integration or API caller.\n\n### Payload\n\n public Struct Payload { get; set; }\n\nOptional. This field can be used to pass custom data from your webhook to\nthe integration or API caller. Arbitrary JSON objects are supported. When\nprovided, Dialogflow uses this field to populate\n\\[QueryResult.webhook_payload\\]\\[google.cloud.dialogflow.v2beta1.QueryResult.webhook_payload\\]\nsent to the integration or API caller. This field is also used by the\n[Google Assistant\nintegration](https://cloud.google.com/dialogflow/docs/integrations/aog)\nfor rich response messages.\nSee the format definition at [Google Assistant Dialogflow webhook\nformat](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json)\n\n### SessionEntityTypes\n\n public RepeatedField\u003cSessionEntityType\u003e SessionEntityTypes { get; }\n\nOptional. Additional session entity types to replace or extend developer\nentity types with. The entity synonyms apply to all languages and persist\nfor the session. Setting this data from a webhook overwrites\nthe session entity types that have been set using `detectIntent`,\n`streamingDetectIntent` or\n\\[SessionEntityType\\]\\[google.cloud.dialogflow.v2beta1.SessionEntityType\\]\nmanagement methods.\n\n### Source\n\n public string Source { get; set; }\n\nOptional. A custom field used to identify the webhook source.\nArbitrary strings are supported.\nWhen provided, Dialogflow uses this field to populate\n\\[QueryResult.webhook_source\\]\\[google.cloud.dialogflow.v2beta1.QueryResult.webhook_source\\]\nsent to the integration or API caller."]]