0

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"}
     }
    ]
  }
}
2
  • Btw, i used developers.google.com/assistant/actions/reference/… but produces a json that isnt valid as a response for Dialogflow. Commented Mar 26, 2024 at 8:40
  • seems its a Dialogflow messenger limitation. JSON with a card format (links) is shown correctly in google assistant. Commented Mar 26, 2024 at 10:52

1 Answer 1

0

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"
      }]
   }}]
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.