We’ve changed our name! API.AI is now Dialogflow. Learn more here.

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. 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, and quick replies.

To add integration tabs, either enable the 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, you can 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

Use the tabs below to explore examples of response types and their usage. You can see example code for these message types in our /intents reference.

Text

Text responses are available in all platforms. 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 the API, use `\n` in the intent object.

You can reference parameter values as described here.

Image

The image message type lets your agent send images in integrations for Facebook Messenger, Kik, LINE, Skype, 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": {
  },
  "line": {
  },
  "skype": {
  },
  "slack": {
  },
  "telegram": {
  }
  "viber": {
  }
}
        

You can also send a custom payload to self-developed integrations. It won’t be processed by Dialogflow, so you'll need to handle it in your own business logic.

See the integration's developer docs for more information: