Design responses

Once you integrate your RBM agent with Dialogflow, use the Dialogflow Console to define how your Dialogflow agent understands and responds to users. You can design intents that map user input to specific responses. These intent responses can be plain text or they can leverage RBM's rich card and suggestion capabilities.

Prerequisites

The following content assumes that you've already done the following:

  • Enabled Dialogflow for your RBM agent
  • Created at least one intent for your Dialogflow agent

Creating an intent response

For your Dialogflow agent to respond to a user, you need to create an intent response.

  1. In the Dialogflow Console, select the Dialogflow agent that you integrated with your RBM agent.
  2. In the left navigation, choose Intents, then choose the intent you want to design a respose for.
  3. In the Responses section, click + and then click *RCS Business Messaging (RBM).
  4. Use the tabs to select which kind of response you want:

    • Default: plain text messages.
    • RCS Business Messaging (RBM): Rich cards, rich card carousels, and text messages with suggested replies and suggested actions.
  5. To add a standalone rich card, carousel, or text message with suggestions, click Add response, then choose from the list.

  6. Fill in the fields in the form.

    Standalone rich card intent response Rich card carousel intent response

  7. When you've defined your responses, save and test your intent.

Continuing a conversation with suggestions

When you use suggested actions or suggested replies to help guide a conversation, make sure that the postback data matches a training phrase for another intent. When a user taps a suggestion, RBM returns the postback data to Dialogflow as user input.

For example, if the user taps a suggested reply labeled "Learn more" and with postback data yes_learn_more, Dialogflow receives "yes_learn_more" as user input and uses it to find the next intent to respond with.

One-to-one mapping of user input to training phrases greatly increases the probability of matching the correct intent, so ideally your intents use your exact postback data as a training phrases.

Capturing intents without responding

In some cases, such as when a user taps a Dial suggested action or an Open URL suggested action, you don't want to immediately respond because it would interrupt their current task. However, user taps on suggested actions send postback data to Dialogflow, which matches the data to an intent and sends an associated response.

To capture postback data without immediately responding to it, create an intent with training phrases that match the postback data and delete all responses for the intent. Dialogflow matchs the postback data to the intent but can't respond because the intent doesn't have any defined responses.

Fulfillment

Beyond the designing responses in the Dialogflow Console, you can configure intents to contact your infrastructure via fulfillment. With fulfillment, you can customize Dialogflow's responses with information from your own databases or trigger other business logic.

When Dialogflow contacts your infrastructure, it includes the following information in the fulfillment request's payload.

Field Description
rbm_user_phone_number The user's phone number.
rbm_share_location_response The user's location, if they tapped the share

location suggested action.