0
votes

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"
  }
}
2

2 Answers

0
votes

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

0
votes

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