# Google action response with an image (basic card)

**URL:** <https://discourse.nodered.org/t/google-action-response-with-an-image-basic-card/10145>\
**Category:** General\
**Created:** [14 April 2019 21:39 UTC](https://discourse.nodered.org/t/google-action-response-with-an-image-basic-card/10145 "2019-04-14T21:39:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike67](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@mike67](https://discourse.nodered.org/u/mike67)\
**Post date:** [14 April 2019 21:39 UTC](https://discourse.nodered.org/t/google-action-response-with-an-image-basic-card/10145/1 "2019-04-14T21:39:17Z")

</div>

Hello  
I use google-action on my node-red machine.  
That works fine.  
Now, I want to add some image in the response. So, I think the good way is to use basic card or table card.  
I found the [code in the google action console](https://developers.google.com/actions/assistant/responses#basic_card)  
So, I have inserted this code in the function wich creates the anwser 🙂

```auto
{
  "payload": {
    "google": {
      "expectUserResponse": true,
      "richResponse": {
        "items": [
          {
            "simpleResponse": {
              "textToSpeech": "This is a basic card example."
            }
          },
          {
            "basicCard": {
              "title": "Title: this is a title",
              "subtitle": "This is a subtitle",
              "formattedText": "This is a basic card. Text in a basic card can include \"quotes\" and\n most other unicode characters including emoji 📱. Basic cards also support\n some markdown formatting like *emphasis* or _italics_, **strong** or\n __bold__ , and ***bold itallic*** or ___strong emphasis___ as well as other\n things like line \nbreaks",
              "image": {
                "url": "https://example.com/image.png",
                "accessibilityText": "Image alternate text"
              },
              "buttons": [
                {
                  "title": "This is a button",
                  "openUrlAction": {
                    "url": "https://assistant.google.com/"
                  }
                }
              ],
              "imageDisplayOptions": "CROPPED"
            }
          }
        ]
      }
    }
  }
}

```

This code should display an image, a title and a button.  
But i only get a return message saying : [object Object]

I need to know if the syntax I chose is the correct one (dialogflow Json)?  
I also tried with an other syntax : ACTIONS SDK JSON. But I get the same result.

With the link above, can you tell me is what is written there is useable with the google-action version 1.2.1?

Here is the debug result of the google action console 🙂

```auto
{
  "response": "[object Object]",
  "expectUserResponse": true,
  "conversationToken": "EroCS2w1Tm...",
  "audioResponse": "//NExAAAAA...",
  "ssmlMarkList": [],
  "debugInfo": {
    "assistantToAgentDebug": {
      "curlCommand": "curl -v https://88.176.64.72:8081/ -H 'Content-Type: application/json;charset=UTF-8' -H 'Google-Actions-API-Version: 2' -H 'Authorization: eyJhbGciOiJSUzI1NiIsImtpZCI6IjM3ODJkM2YwYmM4OTAwOGQ5ZDJjMDE3MzBmNzY1Y2ZiMTlkM2I3MGUiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL2FjY291bnRzLmdvb2dsZS5jb20iLCJhdWQiOiJteS10ZXN0LWFwcC1kMTNkZSIsIm5iZiI6MTU1NTI3NzYxNywiaWF0IjoxNTU1Mjc3OTE3LCJleHAiOjE1NTUyNzgwMzcsImp0aSI6IjgwMTI5MTBkNmExYjIwOWQzZjk3NjI0YTcwYTFlZDBkYWM0MTBmM2MifQ.hODIBx-Geau2JwJAAD0TwHm3tsl210o6JRWTWDGnwFgDwpvCZJt_1UQ-o49NtYx-KApfHxSU2i_DcnHca3MX8kkdz51B475w3X4advT5sU69MgZI82O7SKaYsJIsKSq30yvO43m81I6_Vcx6IrPWlu5mn6YGC2bw5Lc_dPjyUQXNtW7YfOnxK2OE2MOBHN2kjKe7ulcSAWYjVRzKW2EVus1i_Y8uwF5ieSMBYYSo0uvFS0qIQjeOULwE-xKp_fZ3P3cLAhlYQH76EIZSxI6OQfxYFQkVfTYkUDxoXzjELQuQbNMZ3FcjrvQ4FKhL14JevjB78nBhm2yOkZbRkq1akQ' -A 'Mozilla/5.0 (compatible; Google-Cloud-Functions/2.1; +http://www.google.com/bot.html)' -X POST -d '{\"user\":{\"userId\":\"ABwppHGZMM6CHA-JcPkrCzVpkgGv953hFvVdAGAEGOWQSETGxFO18zXyIbXrhHAlw63M9Gz7dKcFxn3fIGKd2sw\",\"locale\":\"fr-CA\",\"lastSeen\":\"2019-04-14T21:27:04Z\",\"userStorage\":\"{\\\"data\\\":{}}\"},\"conversation\":{\"conversationId\":\"ABwppHHYGJV-sVySdFxJJtWlUtpt3qL6HyB3fIi0N-ose5aUNUagVlhJsKIAcY3cmofXWo8nfTeDQLLMp0Ji-AU\",\"type\":\"ACTIVE\",\"conversationToken\":\"{}\"},\"inputs\":[{\"intent\":\"actions.intent.TEXT\",\"rawInputs\":[{\"inputType\":\"KEYBOARD\",\"query\":\"image\"}],\"arguments\":[{\"name\":\"text\",\"rawText\":\"image\",\"textValue\":\"image\"}]}],\"surface\":{\"capabilities\":[{\"name\":\"actions.capability.WEB_BROWSER\"},{\"name\":\"actions.capability.SCREEN_OUTPUT\"},{\"name\":\"actions.capability.ACCOUNT_LINKING\"},{\"name\":\"actions.capability.MEDIA_RESPONSE_AUDIO\"},{\"name\":\"actions.capability.AUDIO_OUTPUT\"}]},\"isInSandbox\":true,\"availableSurfaces\":[{\"capabilities\":[{\"name\":\"actions.capability.SCREEN_OUTPUT\"},{\"name\":\"actions.capability.WEB_BROWSER\"},{\"name\":\"actions.capability.AUDIO_OUTPUT\"}]}],\"requestType\":\"SIMULATOR\"}'",
      "assistantToAgentJson": "{\"user\":{\"userId\":\"ABwppHGZMM6CHA-JcPkrCzVpkgGv953hFvVdAGAEGOWQSETGxFO18zXyIbXrhHAlw63M9Gz7dKcFxn3fIGKd2sw\",\"locale\":\"fr-CA\",\"lastSeen\":\"2019-04-14T21:27:04Z\",\"userStorage\":\"{\\\"data\\\":{}}\"},\"conversation\":{\"conversationId\":\"ABwppHHYGJV-sVySdFxJJtWlUtpt3qL6HyB3fIi0N-ose5aUNUagVlhJsKIAcY3cmofXWo8nfTeDQLLMp0Ji-AU\",\"type\":\"ACTIVE\",\"conversationToken\":\"{}\"},\"inputs\":[{\"intent\":\"actions.intent.TEXT\",\"rawInputs\":[{\"inputType\":\"KEYBOARD\",\"query\":\"image\"}],\"arguments\":[{\"name\":\"text\",\"rawText\":\"image\",\"textValue\":\"image\"}]}],\"surface\":{\"capabilities\":[{\"name\":\"actions.capability.WEB_BROWSER\"},{\"name\":\"actions.capability.SCREEN_OUTPUT\"},{\"name\":\"actions.capability.ACCOUNT_LINKING\"},{\"name\":\"actions.capability.MEDIA_RESPONSE_AUDIO\"},{\"name\":\"actions.capability.AUDIO_OUTPUT\"}]},\"isInSandbox\":true,\"availableSurfaces\":[{\"capabilities\":[{\"name\":\"actions.capability.SCREEN_OUTPUT\"},{\"name\":\"actions.capability.WEB_BROWSER\"},{\"name\":\"actions.capability.AUDIO_OUTPUT\"}]}],\"requestType\":\"SIMULATOR\"}",
      "delegatedRequest": {
        "delegatedRequest": ""
      }
    },
    "agentToAssistantDebug": {
      "agentToAssistantJson": "{\"conversationToken\":\"{}\",\"expectUserResponse\":true,\"expectedInputs\":[{\"inputPrompt\":{\"initialPrompts\":[{\"textToSpeech\":\"[object Object]\"}],\"noInputPrompts\":[]},\"possibleIntents\":[{\"intent\":\"actions.intent.TEXT\"}]}]}",
      "delegatedResponse": {
        "delegatedResponse": ""
      }
    },
    "sharedDebugInfoList": []
  },
  "visualResponse": {
    "visualElementsList": [
      {
        "displayText": {
          "content": "[object Object]"
        }
      }
    ],
    "suggestionsList": [],
    "agentLogoUrl": "https://www.gstatic.com/voice/opa/partner_icons/generic_3p_avatar.png",
    "agentStyle": {
      "primaryColor": "",
      "fontFamily": "",
      "borderRadius": 0,
      "backgroundColor": "",
      "backgroundImageUrl": ""
    }
  },
  "clientError": 0,
  "is3pResponse": true,
  "clientOperationList": [
    {
      "operationType": 1,
      "micUpdatePayLoad": {
        "micMode": 1
      }
    }
  ],
  "projectName": ""
}

```

Can anybody help me?

---

<div class="post-metadata">

**Author:** ![mike67](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@mike67](https://discourse.nodered.org/u/mike67)\
**Post date:** [15 April 2019 20:39 UTC](https://discourse.nodered.org/t/google-action-response-with-an-image-basic-card/10145/2 "2019-04-15T20:39:36Z")

</div>

Hi.  
Nobody can help me on this problem?  
Isn't the description of my problem clear enough?  
Do i have to add some new elements?  
Thanks

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [15 April 2019 21:12 UTC](https://discourse.nodered.org/t/google-action-response-with-an-image-basic-card/10145/3 "2019-04-15T21:12:55Z")

</div>

It could well be that no one has done what you are trying to do. You might just be a ground breaker.

---

<div class="post-metadata">

**Author:** ![prisoner](https://avatars.discourse-cdn.com/v4/letter/p/c2a13f/32.png) [@prisoner](https://discourse.nodered.org/u/prisoner)\
**Post date:** [16 April 2019 13:20 UTC](https://discourse.nodered.org/t/google-action-response-with-an-image-basic-card/10145/4 "2019-04-16T13:20:17Z")

</div>

I'm not familiar with node-RED, but the `[object Object]` part suggests that you're not actually sending the JSON, but rather sending the `toString()` version of the JavaScript containing the reply. The JSON itself isn't the problem - it is how you're sending it. Without seeing the code that you're using to send it, there isn't much more I can suggest.

---

<div class="post-metadata">

**Author:** ![mike67](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@mike67](https://discourse.nodered.org/u/mike67)\
**Post date:** [16 April 2019 14:31 UTC](https://discourse.nodered.org/t/google-action-response-with-an-image-basic-card/10145/5 "2019-04-16T14:31:32Z")

</div>

Look under V

---

<div class="post-metadata">

**Author:** ![mike67](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@mike67](https://discourse.nodered.org/u/mike67)\
**Post date:** [16 April 2019 14:35 UTC](https://discourse.nodered.org/t/google-action-response-with-an-image-basic-card/10145/6 "2019-04-16T14:35:09Z")

</div>

look under V

---

<div class="post-metadata">

**Author:** ![mike67](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@mike67](https://discourse.nodered.org/u/mike67)\
**Post date:** [16 April 2019 14:40 UTC](https://discourse.nodered.org/t/google-action-response-with-an-image-basic-card/10145/7 "2019-04-16T14:40:06Z")

</div>

Hello

Here is the Flow ise to send the  
response. (attched fle). The code is inside the 'image' node.

But I don't know what other part of  
code you need to look at the problem.

Can anyone tell me what other part of  
code would be usefull to find the problem, and where i can find it?

I also attach a wireshark capture, maybe  
this can help. And also the screenshot of the iPhone.

Here are the steps :

- 1 : I connect to the action, with  
'parler avec l'automate'.

- 2 : Then, I tell 'image' so that the  
node 'image' is triggered

- 3 Then, I tell 'numero' so that I  
can receive a random number

- 4 finally, I terminate the conversation  
by saying 'au revoir'.

I suppose you will be able to find these  
french words in the debug and wireshark too.

[FlowAndDebugForBasicCard.odt.txt](https://discourse.nodered.org/uploads/short-url/5Clczf3hpgqcQhvbXoTIu5hS1RT.txt) (30.3 KB)

[wireshark\_capture\_basic\_card.pcapng.txt](https://discourse.nodered.org/uploads/short-url/yo8axdCV7z7fJxnDAd3dia9ruX5.txt) (47.3 KB)

 ![](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/d/d7760441567bc6169ec5488d13faceb40249af28.jpeg)

---

<div class="post-metadata">

**Author:** ![mike67](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@mike67](https://discourse.nodered.org/u/mike67)\
**Post date:** [26 April 2019 22:20 UTC](https://discourse.nodered.org/t/google-action-response-with-an-image-basic-card/10145/8 "2019-04-26T22:20:21Z")

</div>

Up!  
No answer?  
Am i the first one who want to do such thing?
