Message objects

Default message objects

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

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 API.AI 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 replies 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 response

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.
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"
    },
    "platform": "google",
    "subtitle": "AoG Card Subtitle",
    "title": "AoG Card Title",
    "type": "basic_card"
  }
]

List response

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.
- 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"
        },
        "optionInfo": {
          "key": "itemOne",
          "synonyms": [
            "thing one",
            "object one"
          ]
        },
        "title": "Item One"
      },
      {
        "description": "Item Two Description",
        "image": {
          "url": "http://imageTwoUrl.com"
        },
        "optionInfo": {
          "key": "itemTwo",
          "synonyms": [
            "thing two",
            "object two"
          ]
        },
        "title": "Item Two"
      }
    ],
    "platform": "google",
    "title": "Title",
    "type": "list_card"
  }
]

Suggestion Chip response

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.
- 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"
        },
        "optionInfo": {
          "key": "itemOne",
          "synonyms": [
            "thing one",
            "object one"
          ]
        },
        "title": "Option One Title"
      },
      {
        "description": "Option Two Description",
        "image": {
          "url": "http://imageTwoUrl.com"
        },
        "optionInfo": {
          "key": "itemTwo",
          "synonyms": [
            "thing two",
            "object two"
          ]
        },
        "title": "Option Two Title"
      }
    ],
    "platform": "google",
    "type": "carousel_card"
  }
]
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://imageUrl.com"
  }
]