2
votes

i wrote a webhook in python3 and deployed in my own machines the text provided in fulfillmentText is displayed properly but rich response with cards is not displayed. how can i display my response using basic cards?

{
  "fulfillmentText": "My train is in Hyderabad",
  "fulfillmentMessages": [
    {
      "card": {
        "title": "card title",
        "subtitle": "card text",
        "imageUri": "https://assistant.google.com/static/images/molecule/Molecule-Formation-stop.png",
        "buttons": [
          {
            "text": "button text",
            "postback": "https://assistant.google.com/"
          }
        ]
      }
    }
  ]
}

this is my code trying to display the content in the form of cards this is exactly what dialogflow aslo expects as a response format https://dialogflow.com/docs/fulfillment

1
Can you update your question to show the code that is trying to display the cards and possibly an illustration if what is/isn't working? - Prisoner
i updated with the code @Prisoner the format is correct. Is there any way to work this out - Sai Durga
can anyone please let me know if there is any workaround here - Sai Durga
where are you trying to "display" it? - Prisoner

1 Answers

0
votes
    {   
"payload": {
"google": {
"expectUserResponse": true,
"richResponse": {
"items": [
{   
"simpleResponse": {
"textToSpeech": ""
}   
},  
{   
"basicCard": {
"title": "Train",
"image": {
"url": "https://8e39b052.ngrok.io/train.jpg",
"accessibilityText": "Train Image"
},  
"buttons": [
{   
"title": "WhereIsMyTrain",
"openUrlAction": {
"url": "https://whereismytrain.in/"
}   
}   
],  
"imageDisplayOptions": "WHITE"
}   
}   
]   
}   
}   
}   
}   

this worked for me i was not sending it as a payload before