1

How can I get Dialogflow Messenger v1 to display moch response messages, specifically Quick Replies (a button that sends text when clicked)?

When provided with the below WebhookResponse (v2), the Dialogflow Console debugger correctly displays text_1, quick_reply_1, quick_reply_2, text_2

However, Dialogflow Messenger only displays the plain text, i.e. 'text_1 text_2'

See screenshot

{
  "responseId": "XXX",
  "queryResult": {
    "queryText": "cancel",
    "parameters": {},
    "allRequiredParamsPresent": true,
    "fulfillmentText": "XXX",
    "fulfillmentMessages": [
      {
        "text": {
          "text": [
            "text_1"
          ]
        }
      },
      {
        "quickReplies": {
          "title": "quick reply title",
          "quickReplies": [
            "quick_reply_1",
            "quick_reply_2"
          ]
        }
      },
      {
        "text": {
          "text": [
            "text_2"
          ]
        }
      }
    ],
    "intent": {
      "name": "XXX",
      "displayName": "XXX"
    },
    "intentDetectionConfidence": 1,
    "diagnosticInfo": {
      "webhook_latency_ms": 1692
    },
    "languageCode": "en"
  },
  "webhookStatus": {
    "message": "Webhook execution successful"
  }
}
Xiao Wei Chen
  • 103
  • 1
  • 11

2 Answers2

0

For me, it was simple as I was using dailogflow custom payload. here are the steps:

  1. Open you intent
  2. Scroll down & go-to response.
  3. Click on "Add response button" then choose "custom payload" option. At below, it will enable the area for code.
  4. In that area, add your JSON code. something like:
{
  "richContent": [
    [
      {
        "type": "info",
        "title": "Info item title",
        "subtitle": "Info item subtitle",
        "image": {
          "src": {
            "rawUrl": "https://example.com/images/logo.png"
          }
        },
        "actionLink": "https://example.com"
      }
    ]
]
}

For more rich reply, you can refer code from here: https://cloud.google.com/dialogflow/docs/integrations/dialogflow-messenger#rich

Mihir
  • 504
  • 3
  • 11
  • I wasn't clear when I originally asked the question. I intended to ask how to get Dialogflow Messenger v1 to support the Quick Replies message type in the V2 API https://cloud.google.com/dialogflow/docs/reference/rpc/google.cloud.dialogflow.v2#google.cloud.dialogflow.v2.Intent.Message.QuickReplies – Xiao Wei Chen Jun 09 '20 at 16:36
  • Are you using API for replies? – Mihir Jun 10 '20 at 08:46
  • I'm using Webhook response for the replies. https://cloud.google.com/dialogflow/docs/fulfillment-webhook#webhook_response – Xiao Wei Chen Jun 22 '20 at 18:05
  • OK. Actually I am not using webhook but inbuilt custom payload option for quick replies. Check here http://clientdemo.justgreen.in/chatbot/ – Mihir Jun 23 '20 at 04:08
0

For anyone interested, it appears Dialogflow Messenger V1 simply doesn't support the Dialogflow V2 API's Quick Replies Message type. As a workaround, I used Kommunicate.io & custom payloads to implement Quick Replies

Xiao Wei Chen
  • 103
  • 1
  • 11