Rich Communication Services (RCS) is the next evolution of SMS messaging, bringing enhanced features like rich media, interactive buttons, typing indicators, and read receipts to standard messaging. Think of it as bringing modern messaging app capabilities to your default messaging app. Unlike SMS which is limited to basic text and MMS which can only handle simple media attachments, RCS enables a much richer messaging experience.
RCS Business Messaging (RBM) takes these enhanced messaging capabilities and makes them available to businesses. It allows companies to send interactive messages to their customers with features like:
It generally looks something like this:
To get started, create a directory for our project and navigate into it:
mkdir rcs-tutorial cd rcs-tutorial
Let's create a virtual environment and install the necessary packages:
python -m venv venv # Or python3
source venv/bin/activate
We should also create a main file and an .env
file to run our code:
touch main.py
touch .env
.env
file as PINNACLE_API_KEY
Now we should have an .env
file that looks like this:
PINNACLE_API_KEY=your_api_key_here
Before we can send messages, we need to create a client. I'm using the python-dotenv library to load the API key from the .env
file, so if you don't have it installed, run pip install python-dotenv
.
from rcs import Pinnacle
import os
We can create a main function to send a basic message:
def main() -> None:
client.send.rcs(
Now if we run this script, we should get a text from our RCS agent with the message "Hello, world!"
It's not too difficult! We just need to create a card with text and a media URL. Let's define a new function for sending that:
from rcs import Pinnacle, Card, SendRcsResponse
def send_media_message() -> SendRcsResponse:
Now we can call that function in our main function:
if __name__ == "__main__": send_media_message()
Now, I'm not going to show what this message looks like--you're just going to have to discover that for yourself!
Did you know you can add buttons to your texts? Well, with RCS, you can! And that's what we're going to do next.
Let's define a new function to send a message with buttons:
def send_card_with_buttons() -> SendRcsResponse: pass
To send a card with buttons, we need to create a card with a title, text, and a list of buttons. Each button needs a title, payload, and type. The title is just the text of the button, and the payload is the value that will be sent back when the button is clicked. You can find more information about the different types here. One thing to note is that currently on iOS 18.2, "trigger" buttons are rendered as quick replies.
def send_card_with_buttons() -> SendRcsResponse:
response: SendRcsResponse = client.send.rcs(
It should look something like this:
With RCS Business Messaging, you can also add quick replies to your messages, so it's easier for your customers to respond. It also can help automate responses to common questions. Let's define a new function to send a message with quick replies on top of our previous card with buttons:
def send_card_with_buttons_quick_replies() -> SendRcsResponse:
response: SendRcsResponse = client.send.rcs(
Now we can call that function in our main function:
if __name__ == "__main__": send_card_with_buttons_quick_replies()
And run the script: python main.py
It should look something like this:
When your customer clicks on a quick reply, the payload, like "WHAT_IS_RCS" or "WHAT_IS_PINNACLE", will be sent back to your RCS agent. You can listen for these payloads through a webhook and respond to your users! In a future tutorial, we'll go over how to set up a webhook to listen for these payloads.
Check out the next tutorial in this series here: How to receive and react to RCS Business Messages using Python
If you have any questions, feel free to reach out to me on X or reach us at founders@trypinnacle.app.
You can find the full code for this tutorial here.