Message objects

Message objects include plain speech and text responses, as well as rich responses. This page goes over how these show up in your response JSON to user queries.

Default message objects

Default message objects are the platform-agnostic defaults provided in the console.

Text response

This is the standard text response used in the Default tab of the Response section of an intent.

Name Type Description
speech String Agent's text reply.
type Number 0 for the a Text response message type.

Sample response

"messages": [
  {
    "speech": "Text response",
    "type": 0
  }
]

Custom payload message object

Name Type Description
payload Object Developer defined JSON, sent without modifications.
type Number 4 for the Custom payload message type.

One-click integration message objects

These objects correspond to message types for one-click integrations that support rich messages. See message objects for Actions on Google below.

Text response

Name Type Description
platform String Specifies the platform:
  • "facebook"
  • "kik"
  • "line
  • "skype"
  • "slack"
  • "telegram"
  • "viber"
speech String Agent's text reply.
type Number 0 for the Text response message type.

Sample response

"messages": [
  {
    "platform": "facebook",
    "speech": "Text response",
    "type": 0
  }
]

Image message object

Name Type Description
imageUrl String Public URL to the image file.
platform String Specifies the platform:
  • "facebook"
  • "kik"
  • "line
  • "skype"
  • "slack"
  • "telegram"
  • "viber"
type Number 3 for the Image message type.

Sample response

"messages": [
  {
    "imageUrl": "http://urltoimage.com",
    "platform": "facebook",
    "type": 3
  }
]

Card message object

Name Type Description
buttons Array Array of objects corresponding to card buttons.
- text String Button text.
- postback String A text sent back to Dialogflow or a URL to open.
imageUrl String Public URL to the image file.
platform String Specifies the platform:
  • "facebook"
  • "kik"
  • "line
  • "skype"
  • "slack"
  • "telegram"
  • "viber"
subtitle String Card subtitle.
title String Card title.
type Number 1 for the Card message type.

Sample response

"messages": [
  {
    "buttons": [
      {
        "postback": "Card Link URL or text",
        "text": "Card Link Title"
      }
    ],
    "imageUrl": "http://urltoimage.com",
    "platform": "facebook",
    "subtitle": "Card Subtitle",
    "title": "Card Title",
    "type": 1
  }
]

Quick reply message object

Name Type Description
platform String Specifies the platform:
  • "facebook"
  • "kik"
  • "line
  • "skype"
  • "slack"
  • "telegram"
  • "viber"
replies Array Array of strings corresponding to quick replies.
title String Quick replies title. Required for the Facebook Messenger, Kik, and Telegram one-click integrations.
type Number 2 for the Quick replies message type.

Sample response

"messages": [
  {
    "platform": "facebook",
    "replies": [
      "Quick reply 1",
      "Quick reply 2",
      "Quick reply 3"
    ],
    "title": "Quick Reply Title",
    "type": 2
  }
]

Custom payload message object

Name Type Description
type Number 4 for the Custom payload message type.
platform String Specifies the platform:
  • "facebook"
  • "kik"
  • "line
  • "skype"
  • "slack"
  • "telegram"
  • "viber"
payload Object Developer defined JSON. It is sent without modifications.

Actions on Google message objects

These message objects are specific to the Actions on Google integration.

Simple response

Name Type Description
displayText String Text displayed when Customize audio output is used.
platform String "google"
textToSpeech String Agent's text and spoken reply.
type String "simple_response"

Sample response

"messages": [
  {
    "displayText": "Text response",
    "platform": "google",
    "textToSpeech": "Audio response",
    "type": "simple_response"
  }
]

Basic card

Name Type Description
buttons Array List of external links.
- openUrlAction Object for clickable link.
-- url String URL for link.
- title String Link title.
formattedText String The description for the card.
image The image for the card.
- url String Public URL to image.
- accessibilityText String Image description for screen readers.
platform String "google"
subtitle String The subtitle for the card.
title String The title for the card.
type String "basic_card"

Sample response

"messages": [
  {
    "buttons": [
      {
        "openUrlAction": {
          "url": "https://linkUrl.com"
        },
        "title": "AoG Card Link title"
      }
    ],
    "formattedText": "AoG Card Description",
    "image": {
      "url": "http://imageUrl.com"
      "accessibilityText": "Image description for screen readers"
    },
    "platform": "google",
    "subtitle": "AoG Card Subtitle",
    "title": "AoG Card Title",
    "type": "basic_card"
  }
]

Table card

Name Type Description
title String Overall title of the table. Must be set if subtitle is set. You can customize the font family and color.
subtitle String Subtitle for the table.
image Image associated with the table.
- url String Public URL to image.
- accessibilityText String Image description for screen readers.
Row

Row data of the table. Consists of an array of Cell objects and a divider_after property, which indicates whether there should be a divider after the row.

The first 3 rows are guaranteed to be shown, but others might not appear on certain surfaces.

Please test with the simulator to see which rows will be shown for a given surface. On surfaces that support the WEB_BROWSER capability, you can point the user to a web page with more data.

ColumnProperties

Header and alignment for a column. Consists of a header property (representing the header text for a column) and a horizontal_alignment property (of type HorizontalAlignment).

Cell

Describes a cell in a row. Each cell contains a string representing a text value. You can customize the text in the cell.

Button Array

A button object that usually appears at the bottom of a card. A table card can have only have 1 button. You can customize the button color.

HorizontalAlignment

Horizontal alignment of content within the cell. Values can be LEADING, CENTER, or TRAILING. If unspecified, content will be aligned to the leading edge of the cell.

Sample response

{
  "tableCard": {
    "title": "AoG Table Card title",
    "subtitle": "AoG Table Card subtitle",
    "image": {
      "url": "",
      "accessibilityText": "Image description for screen readers"
    },
    "columnProperties": [
      {
        "header": "Header 1"
      },
      {
        "header": "Header 2",
        "horizontalAlignment": "CENTER"
      },
      {
        "header": "Header 3",
        "horizontalAlignment": "CENTER"
      }
    ],
    "rows": [
      {
        "cells": [
          {
            "text": "Cell A1"
          },
          {
            "text": "Cell A2"
          },
          {
            "text": "Cell A3"
          },
          "dividerAfter": true
        ]
      },
      {
        "cells": [
          {
            "text": "Cell B1"
          },
          {
            "text": "Cell B2"
          },
          {
            "text": "Cell B3"
          }
        ]
      },
      {
        "cells": [
          {
            "text": "Cell C1"
          },
          {
            "text": "Cell C2"
          },
          {
            "text": "Cell C3"
          }
        ]
      }
    ],
    "buttons": [
      {
        "title": "Button title",
        "openUrlAction": {
          "url": ""
        }
      }
    ]
  }
}

List

Name Type Description
items Array Item objects in the list
- description String Description of the list item.
- image The image for the list item.
-- url String Public URL to image.
-- accessibilityText String Image description for screen readers.
- optionInfo Object for options of list item.
-- key String Unique string ID for this option.
-- synonyms Array Synonyms that can be used by the user to indicate this option if they do not use the key.
- title String Title of the list item.
platform String "google"
title String The title of the list.
type String "list_card"

Sample response

"messages": [
  {
    "items": [
      {
        "description": "Item One Description",
        "image": {
          "url": "http://imageOneUrl.com"
          "accessibilityText": "Image description for screen readers"
        },
        "optionInfo": {
          "key": "itemOne",
          "synonyms": [
            "thing one",
            "object one"
          ]
        },
        "title": "Item One"
      },
      {
        "description": "Item Two Description",
        "image": {
          "url": "http://imageTwoUrl.com"
          "accessibilityText": "Image description for screen readers"
        },
        "optionInfo": {
          "key": "itemTwo",
          "synonyms": [
            "thing two",
            "object two"
          ]
        },
        "title": "Item Two"
      }
    ],
    "platform": "google",
    "title": "Title",
    "type": "list_card"
  }
]

Suggestion chip

Name Type Description
platform String "google"
suggestions Array of strings Object for suggestion chip options.
- title String The displayed text for the chip.
type String "suggestion_chips"

Sample response

"messages": [
  {
    "platform": "google",
    "suggestions": [
      {
        "title": "Chip One"
      },
      {
        "title": "Chip Two"
      }
    ],
    "type": "suggestion_chips"
  }
]
Name Type Description
items Array Individual card options.
- description String Description of the card.
- image Image for card.
-- url String Public URL to image.
-- accessibilityText String Image description for screen readers.
- optionInfo Object for options of card.
-- key String Unique string ID for this option.
-- synonyms Array Synonyms that can be used by the user to indicate this option if they do not use the key.
- title String Title of the card.
platform String "google"
type String "carousel_card"

Sample response

"messages": [
  {
    "items": [
      {
        "description": "Option One Description",
        "image": {
          "url": "http://imageOneUrl.com"
          "accessibilityText": "Image description for screen readers"
        },
        "optionInfo": {
          "key": "itemOne",
          "synonyms": [
            "thing one",
            "object one"
          ]
        },
        "title": "Option One Title"
      },
      {
        "description": "Option Two Description",
        "image": {
          "url": "http://imageTwoUrl.com"
          "accessibilityText": "Image description for screen readers"
        },
        "optionInfo": {
          "key": "itemTwo",
          "synonyms": [
            "thing two",
            "object two"
          ]
        },
        "title": "Option Two Title"
      }
    ],
    "platform": "google",
    "type": "carousel_card"
  }
]
Name Type Description
items Array Individual browse card options.
- title String Title of the browse card.
- description String Description of the card.
- footer String Browse card footer text.
- image Image for card.
-- url String Public URL to image.
-- accessibilityText String Image description for screen readers.
- optionInfo Object for options of card.
-- key String Unique string ID for this option.
-- synonyms Array Synonyms that can be used by the user to indicate this option if they do not use the key.
platform String "google"
type String "carousel_card"

Sample response

"messages": [
  {
    "items": [
      {
        "carouselBrowse": {
          "items": [
            {
              "title": "Option one title",
              "description": "Option one description",
              "footer": "Option one footer",
              "image": {
                "url": "http://imageOneUrl.com",
                "accessibilityText": "Image description for screen readers"
              },
              "openUrlAction": {
                "url": "https://optionOneUrl"
              }
            },
            {
              "title": "Option two title",
              "description": "Option two description",
              "footer": "Option two footer",
              "image": {
                "url": "http://imageTwoUrl.com",
                "accessibilityText": "Image description for screen readers"
              },
              "openUrlAction": {
                "url": "https://optionTwoUrl"
              }
            },
          ]
        }
      }
    ]
  }
]
Name Type Description
destinationName String Link title.
platform String "google"
type String "link_out_chip"
url String Link URL.

Sample response

"messages": [
  {
    "destinationName": "Destination Name",
    "platform": "google",
    "type": "link_out_chip",
    "url": "http://Url.com"
  }
]

Media content

Name Type Description
type String "media_content"
platform String "google"
mediaType String "AUDIO"
mediaObjects Object
- name String Title of the media content.
- description String Description of the media content.
- largeImage Object
-- url String Public URL to image.
-- accessibilityText String Image description for screen readers.
- contentUrl String URL to media. See the Actions docs for more info.

Sample response

"messages": [
  {
    "type": "media_content",
    "platform": "google",
    "mediaType": "AUDIO",
    "mediaObjects": [
      {
        "name": "Media content card title",
        "description": "Media content card description",
        "largeImage": {
          "url": "http://imageUrl.com",
          "accessibilityText": "Image description for screen readers"
        },
        "contentUrl": "https://urlToMediaFile.com"
      }
    ]
  }
]

Payload

Name Type Description
type String "custom_payload"
platform String "google" for Actions on Google specific responses.
payload Object Developer defined JSON, sent with modifications.

Sample response

{
  "platform": "google",
  "type": "custom_payload",
  "payload": {
    "google": {
      "expectUserResponse": true,
      "isSsml": false,
      "noInputPrompts": [],
      "richResponse": {
        "items": [
          {
            "simpleResponse": {
              "displayText": "hi",
              "textToSpeech": "hello"
            }
          }
        ],
        "suggestions": [
          {
            "title": "Say this"
          },
          {
            "title": "or this"
          }
        ]
      },
      "systemIntent": {
        "data": {
          "@type": "type.googleapis.com/google.actions.v2.OptionValueSpec",
          "listSelect": {
            "items": [
              {
                "optionInfo": {
                  "key": "key1",
                  "synonyms": [
                    "key one"
                  ]
                },
                "title": "must not be empty"
              },
              {
                "optionInfo": {
                  "key": "key2",
                  "synonyms": [
                    "key two"
                  ]
                },
                "title": "must not be empty, but unique, for some reason"
              }
            ]
          }
        },
        "intent": "actions.intent.OPTION"
      }
    }
  }
}