Integrate Google RBM (Rich Communication Services Business Messaging) in Dialogflow

What is RCS business messaging or Google RBM?

RCS (Rich Communication Services) Business Messaging or RBM is a next-generation SMS protocol (upgraded SMS services) that supports “Rich Responses”. RCS is a communication protocol based on advanced message services, supported and promoted by GSMA and Google. With RBM, people and businesses can communicate with more interactive mobile experiences due to the “Rich Responses” right to the default messaging app.

Note : Rich Responses means you can send High-resolution images, videos, Structured messages with buttons and scrolls, quick replies, Payment requests, Calendar events, etc.

(Picture Courtesy: https://www.gsma.com/futurenetworks/)

Why is RCS Business Messages or RBM important?

We are all aware of SMS (Short Message Services) which is also based on “GSMA Communication Protocol”. Also, we are aware of social messaging applications like WhatsApp, Facebook, Twitter etc., that works on “Internet Protocol”. Almost all these social messaging applications support “rich responses”, while previously “SMS protocol” didn’t support rich responses, with SMS one can send only text messages. Now with advanced “SMS protocol (RCS)” conversations are more seamless and messaging has more useful chat features.

Recently GSMA issued a white paper in which they talk about how “Vodafone, Deutsche Telekom, Telefonica, KDDI, AT&T and China Mobile and other various mobile operators work towards a fully enabled network for RBM” (it means that we don’t need “internet connection” for rich responses features in future). RCS Business Messaging as an upgrade to A2P(Application to Person) SMS Messaging and has features that it can provide an opportunity to mobile operators to enhance their businesses to offer new capabilities and shares by new business paradigms such as AI, chatbots and in-chat search.

Recently Google announced RCS chats as an Android’s primary texting platform with “Jibe Platform”. As per the given information in Jibe.google.com almost 86% of smartphones will be RCS-enabled by 2020. By aligning on a “universal RCS profile”, mobile operators will now be able to deploy a consistent RCS implementation, feature set, and configuration. Features such as group chat, high-resolution photos, video sharing, read receipts, and more, will now become part of the operator messaging experience, enhancing the experience of over 4 billion SMS users worldwide. Mobile operators can deploy their own infrastructure, or they have the option to use the Jibe Platform from Google, which supports the universal RCS profile.

Dialogflow Support for RBM:

Dialogflow platform also provides RCS Business Messaging (RBM) to create rich responses for Chatbot Agents in support of Google RBM. Currently, Rich cards like Standalone Card and Carousel Card and also simple responses are supported for RBM. But right now there is no option given in the platform to test RBM responses. Let’s see the examples to add RBM rich responses in Dialogflow.

Below steps shows how to add Rich responses for RBM, and then how to check the JSON payload for the same:

1. First, click on https://dialogflow.com/ and Sign up using your Google ID. Select your agent or create a new agent in Dialogflow.

2. After that create an intent and give name as per your requirement. Here we create an intent named “Products” for the agent “PserviceBOT”.

3. Now scroll down the Intent Page, you will see the “Responses” section, to add the responses. In Responses, you will see the “Add button (+ symbol)”, click on it and from the drop-down list select the “RCS Business Messaging (RBM)” as shown in the image.

4. On selecting RBM you can see the below options on your screen.  Now, click on “ADD RESPONSES”, you will find responses like “Standalone Rich Card, Carousel Rich Card and Simple Responses” for RBM.

5. Select your responses for the RBM. Here we have selected Simple Responses and StandAlone Card for the “Products” intent.

6. Now fill up the details of the card. Here in the card there are two kinds of Orientation: Horizontal and Vertical. When you select the Horizontal Orientation, it also asks to select the thumbnail alignment LEFT or RIGHT. Now, add the image URL. After adding the Image URL it asks for the Image Size only in the Vertical Orientation. Save the Card if you don’t want to add suggestions.

7. Now we will see how to add Suggestions in the Standalone Rich Card. Click on “Add suggestion”, select an action from the drop-down list. Here we select “open URL” action. Now add “suggestion text, postback URL and the required URL” inside suggestion box. Save the responses.

8. As discussed earlier, right now there is no way to check response in dialogflow , but we can see the JSON payload when we test intent responses. To see the JSON payload first enter training phrases to the right-hand side of the intent response tester. After that click on DIAGNOSTIC INFO as shown in the screenshot below.

9. By clicking on DIAGNOSTIC INFO you will see the below screen, click on COPY RAW RESPONSE and save it in a text file or word file, somehow if you don’t find the RBM response in the DIAGNOSTIC INFO then in the below steps we have also mentioned the other way to fetch that.

10. In the below image you can see the JSON response. You can find “rbmText” and “rbmStandaloneRichCard” responses in “fulfillmentMessages” of the JSON payload for the RCS based Messaging.

11. You can also find response payload in the history of Agent Conversation. From the left-hand side menu, select History, now you can see the screen as shown below. Click on “products” as we have entered this current phrase for the response. You will have your own phrases at this place.

12. After clicking on “products” you will see the log as shown in the below image. Now click on the “three vertical Dots” symbol, this will open the drop-down list shown as on screen. Select the “Raw interaction log” from the list and copy that log by clicking on the “copy” button.

13. We saved JSON payload in google word file. In the below image you can see that the platform is “GOOGLE_RBM”. You can also see “rbmText” and “rbmStandaloneCard” content inside the JSON payload.

14. Let’s see how to add the “carousel card” response and check it’s JSON payload for the RBM. Go back to the Intent select the RCS BUSINESS MESSAGING(RBM), now click on the “ADD RESPONSES” button, from the list select “Carousel Rich card” and you will find below details about the card to fill up. You need to add details for at least two cards.

15. To make a Carousel card, first select the card width, after that add card details. Adding suggestions in the Carousel Card is the same as “Standalone Rich Card”. Now click on the “SAVE” button to save the changes.

16. Now follow steps number 11 and 12 to copy JSON payload. In the response you will see the platform named “GOOGLE_RBM” and “rbmCarouselRichCard” and its contents with two titles.


Below is the JSON you can copy paste in your Payload.

{
  "queryText": "products",
  "parameters": {},
  "fulfillmentMessages": [
    {
      "platform": "GOOGLE_RBM",
      "lang": "en",
      "rbmText": {
        "text": "Hello!! This is Simple Responses for RBM..."
      }
    },
    {
      "platform": "GOOGLE_RBM",
      "lang": "en",
      "rbmStandaloneRichCard": {
        "cardOrientation": "HORIZONTAL",
        "thumbnailImageAlignment": "LEFT",
        "cardContent": {
          "title": "SmartPhones2",
          "description": "Mobiles of Apple",
          "media": {
            "fileUri": "https://st1.bgr.in/wp-content/uploads/2012/04/413cd4531b82d2060404b792cc1faa28_375x500_1.jpg",
            "height": "MEDIUM"
          }
        }
      }
    },
    {
      "platform": "GOOGLE_RBM",
      "lang": "en",
      "rbmCarouselRichCard": {
        "cardWidth": "MEDIUM",
        "cardContents": [
          {
            "title": "Mobiles of Apple",
            "description": "features of apple x11",
            "media": {
              "fileUri": "https://i.gadgets360cdn.com/large/iPhone_11_leak_1567592736336.jpg?output-quality=80&output-format=webp",
              "height": "SHORT"
            }
          },
          {
            "title": "Mobile of One Plus",
            "description": "features of One plus 7T",
            "media": {
              "fileUri": "https://i.gadgets360cdn.com/products/large/1556971214_635_oneplus_7_pro.jpg?downsize=*:180&output-quality=80",
              "height": "TALL"
            }
          }
        ]
      }
    },
    {
      "text": {
        "text": [
          ""
        ]
      },
      "lang": "en"
    }
  ],
  "intent": {
    "id": "e8fb7df4-f16d-4c12-bce0-eb8952aaa1ea",
    "displayName": "Products",
    "priority": 500000,
    "messages": [
      {
        "platform": "GOOGLE_RBM",
        "lang": "en",
        "rbmText": {
          "text": "Hello!! This is Simple Responses for RBM..."
        }
      },
      {
        "platform": "GOOGLE_RBM",
        "lang": "en",
        "rbmStandaloneRichCard": {
          "cardOrientation": "HORIZONTAL",
          "thumbnailImageAlignment": "LEFT",
          "cardContent": {
            "title": "SmartPhones2",
            "description": "Mobiles of Apple",
            "media": {
              "fileUri": "https://st1.bgr.in/wp-content/uploads/2012/04/413cd4531b82d2060404b792cc1faa28_375x500_1.jpg",
              "height": "MEDIUM"
            }
          }
        }
      },
      {
        "platform": "GOOGLE_RBM",
        "lang": "en",
        "rbmCarouselRichCard": {
          "cardWidth": "MEDIUM",
          "cardContents": [
            {
              "title": "Mobiles of Apple",
              "description": "features of apple x11",
              "media": {
                "fileUri": "https://i.gadgets360cdn.com/large/iPhone_11_leak_1567592736336.jpg?output-quality=80&output-format=webp",
                "height": "SHORT"
              }
            },
            {
              "title": "Mobile of One Plus",
              "description": "features of One plus 7T",
              "media": {
                "fileUri": "https://i.gadgets360cdn.com/products/large/1556971214_635_oneplus_7_pro.jpg?downsize=*:180&output-quality=80",
                "height": "TALL"
              }
            }
          ]
        }
      },
      {
        "text": {},
        "lang": "en"
      }
    ]
  },
  "intentDetectionConfidence": 1,
  "languageCode": "en",
  "slotfillingMetadata": {
    "allRequiredParamsPresent": true
  },
  "id": "6fee9846-2134-4bcc-8049-eae78d6c311c-ce609cdc",
  "sessionId": "4ea1dd02-3ed9-a8ed-53de-f188a45c38de",
  "timestamp": "2020-02-04T12:13:02.695Z",
  "source": "agent",
  "webhookStatus": {
    "webhookEnabledForAgent": true
  },
  "agentEnvironmentId": {
    "agentId": "b13a9ce2-7e67-490c-b724-a4b9a8224f9a",
    "cloudProjectId": "united-coil-252911"
  }
}

Hope this tutorial would be helpful for you to integrate Google RBM in your project. If you have any query or confusion, then please post it in comments below.

Categories: Chatbots Development Dialogflow Dialogflow Tutorial

2 Replies to “Integrate Google RBM (Rich Communication Services Business Messaging) in Dialogflow”

  1. Do we have Google RCS API’s available to integrate with Java Application?

    1. Hello Srinivas,
      No, we don’t have the RCS API’s available for Java application. If you want to develop something, then please send your requirement at letstalk@pragnakalp.com .

Leave a Reply

Your email address will not be published.

You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*