From Dialogflow console, i can set a custom payload like this

How can i send the exact same response from a webhook custom integration.
I tried sending it from Flask as JSON but it didn't work.
{
    "fulfillmentText": "Your text response",
    "fulfillmentMessages": [
        {
            // this item is optional
            "text": {
                "text": [
                    "Your text response"
                ]
            }
        },
        {
            "payload": {
                // Your custom fields payload
            }
        }
    ]
}
                        When you are using a webhook you have to send back a complete WebhookResponse. Unfortunately, the documentation for the webhook protocol seems to have gone missing when they migrated the documentation from dialogflow.com to cloud.google.com/dialogflow. However, it is still available in the Dialogflow Discovery document. If you look for the GoogleCloudDialogflowV2WebhookResponse there you'll see that you would have to send back something like this:
{
    "payload": {
        "facebook": {
            "attachment": {
                # ... etc.
            }
        },
        "slack": {}  # ... etc.
    }
}
The format for version v2beta1 of the Dialogflow API is the same.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With