Updates: Check the release notes for new features and product updates.

Client libraries

The RBM client libraries make it easy to create RBM agents using Node.js, C#, Python, or Java.

Prerequisites

Before you get started, you need to do the following things:

Setup

  1. Download the First Agent Sample.

    Note: Sign in with your RBM Google account to access download links.

  2. Unzip the file on your local machine.

  3. Follow the instructions in the README to configure your RBM credentials.

Send messages

In the following examples, rbm_api_helper.js (not used for Python) assumes the file you are working from is one directory below the main app folder. You may need to adjust the location depending on your project’s configuration.

Tester invite

Until you have launched your agent, it can only communicate with invited test devices. The following code sends a tester invite to a device with a client library.

Node.js

Java

Python

C#

Capability check

Your agent can only communicate with RCS-enabled devices. You can check whether a device is RCS-enabled by checking the device’s capabilities. The following code checks the capability of a device with a client library.

Node.js

Java

Python

C#

Simple message

A simple message is made purely of text. The following code sends a simple text message to a device with a client library.

Node.js

Java

Python

C#

Message with suggested replies

Suggested replies help guide users through conversations with your agent. A simple message can include a collection of suggested replies and actions. The following code sends a simple text message with two suggested replies to a device with a client library.

Node.js

Java

Python

C#

Media message

The following code sends an image or video to a device with a client library.

Node.js

Java

Python

C#

Rich card

With a rich card, you can send a chunk of related information: title, description, image and up to 4 suggested replies or actions. The following code sends a rich card to a device with a client library.

Node.js

Java

Python

C#

Carousels string together multiple rich cards allowing a user to compare options and react individually. The following code sends a rich card carousel with two cards to a device with a client library.

Node.js

Java

Python

C#

Dial a number

The following code sends a Dial action to a device with a client library.

Node.js

Java

Python

C#

View a location

The following code sends a View location action to a device with a client library.

Node.js

Java

Python

C#

Share a location

The following code sends a Share location action to a device with a client library.

Node.js

Java

Python

C#

Open URL

The following code sends an Open URL action to a device with a client library.

Node.js

Java

Python

C#

Create a calendar event

The following code sends a Create calendar event action to a device with a client library.

Node.js

Java

Python

C#

Revoke messages

In the following example, rbm_api_helper.js (not used for Python) assumes the file you are working from is one directory below the main app folder. You may need to adjust the location depending on your project’s configuration.

The following code revokes an existing, undelivered message with a client library.

Node.js

Java

Python

C#

Send events

In the following examples, rbm_api_helper.js (not used for Python) assumes the file you are working from is one directory below the main app folder. You may need to adjust the location depending on your project’s configuration.

Read events

Read events let the user know that the agent received the message and instills confidence that the RBM platform delivered their message. The following code sends a read event to a device with a client library.

Node.js

Java

Python

C#

Typing events

Typing events let the user know that your agent is composing a message. The following code sends a typing event to a device with a client library.

Node.js

Java

Python

C#

Next steps

Take a look at the RBM agent best practices and samples to get to know the platform and what it can do.