Dialogflow Webhook response format (Dialogflow messenger)

51 Views Asked by At

I've set up a Dialogflow webhook with PHP that is working correctly. Receives a query and responds with a text string (shown correctly by the agent). The problem that I have is I can't figure out a correct payload that sends a reply with two links to be shown by the agent to the user. Can someone kindly post a json example of a reply that shows, for example, 2 links? My current respond in JSON is quite simple:

{
   "source": "aaaaaaaa-aaaaaaaa-aaaa-aaaaaaaa-aaaaaaaa",
   "fulfillmentText": "Response OK",
   "payload": {
    "items": [
     {"simpleResponse": 
      {"textToSpeech": "RESPONSE: OK"}
     }
    ]
  }
}
1

There are 1 best solutions below

0
from On

Dialogflow messenger ONLY shows a text response. If you log into Dialogflow webui and try any intent with a "card" response you will see it shows correctly, but wont show the card in Dialogflow messenger. This JSON is a working example:

{
   "source": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa-aaaaaaaa",
   "fulfillmentMessages": [{"card":    {
      "title": "Title",
      "subtitle": "text sample",
      "imageUri": "www.domain.com/img.png",
      "buttons": [      {
         "text": "Read",
         "postback": "www.domain.com"
      }]
   }}]
}