Rich Messages

In the Response section, you can add tabs for some of our supported integrations. This allows you to define default or integration specific responses for these integrations. In each tab, you can add up to 10 of the same or different message types. The DEFAULT tab and the integration tabs offer different message types. The integration tabs allow you to add images, cards, quick replies in a quick and simple manner.

To add integration tabs, either enable respective integrations on the 'Integrations' page or click on the + sign next to the DEFAULT tab. To add message elements, click the ‘ADD MESSAGE CONTENT’ button.

Your agent’s response can consist of up to 10 sequential messages, that can be reordered in the UI. If you create intents via the /intents endpoint, the order of messages will correspond to the messages array elements order.

Types of Responses

Depending on the platform(s) to which you are integrating your agent, you can use different type of responses:

Type of message Currently supported platforms
Text response All platforms
Image One-click integrations for Facebook Messenger, Kik, Slack, Telegram, Viber
Card One-click integrations for Facebook Messenger, Kik, Slack, Telegram, Viber
Quick replies One-click integrations for Facebook Messenger, Kik, Slack, Telegram, Viber
Custom payload

Use the tabs below to explore examples of response types and their usage in integrations.

Text

Your agent can send up to 10 sequential text messages in response to a user input (assuming no other message types are defined in the intent).

To add a new line in the UI, press Shift+Enter. If you create intents via API, use `\n` in the intent object.

"messages": [        
{
            "type": 0,
            "speech": "Some text\nNext line"
            }
]

You can reference parameter values as described here.

Image

The image message type lets your agent send images in integrations for Facebook Messenger, Kik, Slack, Telegram, and Viber.

All you need to do is to store the image and provide the public URL in the response for the agent.

Card

Cards consist of an image, a card title, a card subtitle, and interactive buttons (for sending user queries or opening links).These elements can be combined depending the platform's requirements.

Quick Replies

Quick replies are displayed in messengers as clickable buttons with pre-defined user responses. When clicked, the button text is sent to the agent as a user query.

Requirements/Limitations:

  • One Quick reply element per intent
  • Maximum of 10 replies
  • 20 character limit per reply
Custom Payload

You can send custom payloads in the JSON format provided in the platforms documentation.

To send a custom payload to Facebook Messenger, Kik, Slack, and Telegram one-click integrations, use the following format:

{
  "facebook": { 
  },
  "kik": [{
  }],
  "slack": {
  },
  "telegram": {
  }
  "viber": {
  }
}
        

You can also send a custom payload to self-developed integrations. It won’t be processed by API.AI. You need to handle it in your own business logic.