Invoke API
Invoke Examples
This is an example of an RCS message that sends both text and media in the message.
{
"endUser": {
"phoneNumber": "12065551234",
"mobileOperatorId": "77"
},
"variables": {
"request": {
"rcs": {
"text": {
"message": "Hello customer!"
},
"media": {
"fileUrl": "https://www.myurl.com/myfile.jpg",
"mimeType": "image/jpeg",
"fileSize": 12367,
"suggestions": [
{
"action": {
"displayText": "Check out my website!",
"urlAction": {
"url": "http://www.mysite.com"
}
}
}
]
}
},
"sms": {
"messageContent": "Hello customer! Check out my website, http://www.mysite.com!"
}
}
}
}
This is an example of a single RCS Rich Card that uses the action and reply elements as suggestions.
{
"endUser":{
"phoneNumber": "12065551234",
"mobileOperatorId": "77"
},
"variables":{
"request":{
"rcs": {
"richCard": {
"cardOrientation": "HORIZONTAL",
"cards": [
{
"title": "My Website!",
"media": {
"fileUrl": "https://www.myurl.com/myfile.jpg",
"mimeType": "image/jpeg",
"fileSize": 12367
},
"suggestions": [
{
"action": {
"displayText": "Check out my website!",
"urlAction": {
"url": "http://www.mysite.com"
}
}
},
{
"reply": {
"displayText": "Reply now!"
}
}
]
}
]
}
},
"sms":{
"messageContent": "Hello customer! Check out my website, http://www.mysite.com!"
}
}
}
}
This is an example of a message with multiple cards and suggestions in a carousel.
{
"endUser":{
"phoneNumber": "12065551234",
"mobileOperatorId": "77"
},
"variables":{
"request":{
"rcs": {
"richCard": {
"cardWidth": "SMALL",
"cards": [
{
"title": "My Website!",
"media": {
"fileUrl": "https://www.myurl.com/myfile.jpg",
"mimeType": "image/jpeg",
"fileSize": 12367
},
"suggestions": [
{
"action": {
"displayText": "Check out my website!",
"urlAction": {
"url": "http://www.mysite.com"
}
}
}
]
},
{
"title": "Place call!",
"media": {
"fileUrl": "https://www.myurl.com/mythirdfile.mp4",
"mimeType": "video/mp4",
"fileSize": 42367
},
"suggestions": [
{
"action": {
"displayText": "Call this number!",
"dialAction": {
"phoneNumber": "+12223334444"
}
}
}
]
},
{
"title": "Location Nearby!",
"media": {
"fileUrl": "https://www.myurl.com/mylastfile.jpg",
"mimeType": "image/jpeg",
"fileSize": 12367
},
"suggestions": [
{
"action": {
"displayText": "Store near you!",
"locationAction": {
"latitude": "+47",
"longitude": "+122"
}
}
}
]
},
{
"title": "Calendar!",
"media": {
"fileUrl": "https://www.myurl.com/mysecondfile.jpg",
"mimeType": "image/jpeg",
"fileSize": 12367
},
"suggestions": [
{
"action": {
"displayText": "Put it on your calendar!",
"calendarAction": {
"startTime": "2018-01-02T15:01:23.045123456Z",
"endTime": "2018-01-03T15:01:23.045123456Z",
"title": "This is the appointment title",
"description": "This is a description of the appointment"
}
}
}
]
}
]
}
},
"sms":{
"messageContent": "Hello customer! Check out my website, http://www.mysite.com!"
}
}
}
}
This is an example of an RCS message that shows the use of the order parameter. Here the order of the displayed RCS type is organized by the id parameter. Each type is assigned an id, and that id is passed in the messageOrder field of the order object. This is the order then displayed on the recipient's handset.
{
"endUser": {
"phoneNumber": "12065551234",
"mobileOperatorId": "77"
},
"variables": {
"request": {
"rcs": {
"text": {
"message": "Hello customer!",
"id": "text1",
"suggestions": [
{
"action": {
"displayText": "Check out my website!",
"urlAction": {
"url": "http://www.mysite.com"
}
}
}
]
},
"media": {
"fileUrl": "https://www.myurl.com/myfile.jpg",
"mimeType": "image/jpeg",
"fileSize": 12367,
"id": "media1"
},
"order": {
"messageOrder" : ["media1", "text1"]
}
},
"sms": {
"messageContent": "Hello customer! Check out my website, http://www.mysite.com!"
}
}
}
}
This is an example of an RCS message that uses customerData in both a reply and an action. Because customerData is associated with these suggestions, when a user taps the reply to dial the phone number, customerData returns information to the sender that the particular reply was tapped; when the user taps an action for accessing a website, the customerData parameter in the action section returns information to the sender that the particular action was tapped.
{
"endUser":{
"phoneNumber": "12065551234",
"mobileOperatorId": "77"
},
"variables":{
"request":{
"rcs": {
"richCard": {
"cardOrientation": "HORIZONTAL",
"cards": [
{
"title": "My Website!",
"media": {
"fileUrl": "https://www.myurl.com/myfile.jpg",
"mimeType": "image/jpeg",
"fileSize": 12367
},
"suggestions": [
{
"action": {
"displayText": "Check out my website!",
"customerData": "UserClickOnWebsite",
"urlAction": {
"url": "http://www.mysite.com"
}
}
},
{
"reply": {
"displayText": "Reply now!",
"customerData": "{\"buttonText\":\"Reply Now!\",\"sugestionChipId\":\"EXAMPLEID-001\",\"phoneNumber\":\"12065551234\"}"
}
}
]
}
]
}
},
"sms":{
"messageContent": "Hello customer! Check out my website, http://www.mysite.com!"
}
}
}
}