Set up failover from RCS to SMS
Sometimes, when you send Rich communication services (RCS) messages to end users, the message might not be delivered for various reasons. Example: The end user's device or network does not support RCS, the end user does not have an active internet connection, or there are network issues.
In such cases, to ensure that the end user receives the message, use another channel as the failover. SMS is the most reliable channel because it does not require an internet connection and is compatible with all types of mobile devices. This is why SMS is often used as the failover channel to guarantee message delivery.
This tutorial shows how to set up failover from RCS to SMS. Customize the example to meet your specific use case and requirements.
Products and channels
Prerequisites
-
Infobip account with the following enabled:
- RCS
- SMS
If you do not have an account, create a free trial account and select RCS and SMS channels on the welcome screen.
-
Infobip API key with the following scopes:
rcs:message:send
sms:message:send
For information about creating an API key with the required scope, refer to API authorization.
-
HTTP client: This tutorial uses curl. Alternatively, you can choose the official Infobip SDK for the required programming language.
-
RCS agent or sender: If you want to configure a custom RCS sender, contact your Infobip account manager.
-
SMS sender: If you are in the free trial period, you can use Infobip's test sender, ServiceSMS.
If you want to configure a custom SMS sender, request either a new number or an alphanumeric sender through either your Infobip account (opens in a new tab) or the Infobip Numbers (opens in a new tab) API.
-
Destination: A phone number to which RCS and SMS messages are sent.
If the RCS agent is not launched, you can only send to safelisted phone numbers.
Implementation over the Infobip web interface
-
On the Infobip web interface (opens in a new tab), go to Moments > Broadcasts.
-
Select Create new broadcast.
-
Select RCS as the channel.
-
Choose the Recipients and select a Sender.
-
In the Content section, create a Text message that includes a URL.
Example: For news about CPaaS in Infobip, go to https://www.infobip.com/news/infobip-is-one-of-the-top-cpaas-providers-in-metrigys-cpaas-metrirank-report.
-
Enable Failover to SMS.
-
Select a Sender.
-
In the Message section, copy the message from the RCS Content section.
-
(Optional) Configure other fields as required.
-
Name your broadcast.
-
Select Continue to preview.
-
Verify the content in the preview page.
-
Select Launch.
Implementation over API
-
Create an API request (opens in a new tab) to send RCS messages.
curlcurl -X POST https://api.infobip.com/rcs/2/messages \ -H 'Authorization: App {YOUR_API_KEY}' \ -H 'Content-Type: application/json' \ { "messages": [ { "sender": "{YOUR_RCS_SENDER}", "destinations": [ { "to": "{YOUR_DESTINATION}" } ], "content": { "text": "For news about CPaaS in Infobip, go to https://www.infobip.com/news/infobip-is-one-of-the-top-cpaas-providers-in-metrigys-cpaas-metrirank-report", "suggestions": [ { "text": "Find more", "postbackData": "more", "type": "REPLY" } ], "type": "TEXT" } } ] }
-
In the API request, configure the SMS failover.
curlcurl -X POST https://api.infobip.com//rcs/2/messages \ -H 'Authorization: App {YOUR_API_KEY}' \ -H 'Content-Type: application/json' \ { "messages": [ { "sender": "{YOUR_RCS_SENDER}", "destinations": [ { "to": "{YOUR_DESTINATION}" } ], "options": { "validityPeriod": { "amount": 5, "timeUnit": "SECONDS" }, "deliveryTimeWindow": { "days": [ "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY" ], "from": { "hour": 2, "minute": 0 }, "to": { "hour": 23, "minute": 59 } }, "campaignReferenceId": "Example campaign id", "smsFailover": { "sender": "{YOUR_SMS_SENDER}", "text": "For news about CPaaS in Infobip, go to https://www.infobip.com/news/infobip-is-one-of-the-top-cpaas-providers-in-metrigys-cpaas-metrirank-report", "validityPeriod": { "amount": 48, "timeUnit": "HOURS" } } } } ] }
Additional resources
- RCS API reference (opens in a new tab) documentation.
- RCS documentation.
- SMS documentation.
- Broadcast documentation.
- Response status and error codes documentation.
- Broadcast (opens in a new tab) on the Infobip web interface.
- Infobip SDK documentation.