RCS Messaging Service

RCS Messaging Service

{
	"channels": [{
		"name": "rcs",
		"from": "700969ca-0cb2-11ec-a2cxxxx", //Agent ID
        "meta" : {
            "foreign_id":"your-custom-id"
        }
	}]
	"recipient": {
		"group_id": "{segment_id}",
		"to": ["91XXXXXX", "91XXXXXX"]
	}
}

Example Response

{
  "status": "OK",
  "message": "Message Queued successfully",
  "data": [
    {
      "id": "a418d672-9781-4d97-b517-a56f7d95ad8a",
      "channel": "rcs",
      "from": "700969ca-0cb2-11ec-a2cxxxx",
      "to": "9190199xxxxx",
      "credits": 1,
      "created_at": "2021-06-18T14:48:06.886358Z",
      "status": "queued",
      "foreign_id": "your-message-id"
    }
  ]
}

PARAMETERS

Name Description type Required
channels This block contains information realted messaging channel N/A Yes
name Name of Messaging Channel. `whatsapp rcs ip_message`
from RCS Agent Reference ID string Yes
recipient This block contains contacts information related to channel N/A Yes
group_id Segment id which contain list of phone numbers string or array Yes if to param not present
to Receiver mobile numbers : text array Yes, if group_id not present

Note : The recipient block inside channel is related to particular communication channel and it is optional. The outside recipient channel contain common recipients for every channel.

HTTP Methods

It will support only POST requests.

API Endpoint

https://eu.cpaas.bics.com/api/v2/

Note: Few elements in the endpoint may change from service to service.

{endpoint}rcs/message/send

Example Request With Text Messgae

cURL - cURL
curl --location --globoff '{endpoint}api/v2/rcs/message/send' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
    "channels": [
        {
            "name": "rcs",
            "from": "{channel.rcs.from}"
        }
    ],
    "recipient": {
        "to": [
            "{receiver}"
        ]
    },
    "message": {
        "type": "text",
        "payload": {
            "text": "This is a simple text message from rcs channel"
        }
    }
}'

PARAMETERS

Name Description Limits Required
payload Messaage Payload section N/A Yes
to Destination mobile number with country code NA Yes
text Message Content you want to send Max 4096 Characters Yes

Using Media Message you can send image, audio, video and document files to your customers.

{endpoint}rcs/message/send

Example Request With Image Messgae

cURL - cURL
curl --location --globoff '{endpoint}api/v2/rcs/message/send' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
    "channels": [
        {
            "name": "rcs",
            "from": "{channel.rcs.from}"
        }
    ],
    "recipient": {
        "to": [
            "{receiver}"
        ]
    },
    "message": {
        "type": "image",
        "payload": {
            "url": "https://picsum.photos/id/237/200/300",
            "caption": "some caption for document",
            "filename": "Sample Image file"
        }
    }
}'

PARAMETERS

Name Description Limits Required
payload Messaage Payload section N/A Yes
to Destination mobile number with country code NA Yes
type Media types supported image/jpeg, image/jpg, image/gif, image/png, video/h263, video/m4v, video/mp4, video/mpeg, video/mpeg4, video/webm NA Yes
url Publicly available Image/ Media URL Max 100 MB Yes

API Endpoint

https://eu.cpaas.bics.com/api/v2/

Note: Few elements in the endpoint may change from service to service.

We can send interactive messages like suggested replies and suggested actions using this api.

Suggested replies[text] have a maximum of 25 characters.

{endpoint}rcs/message/send

Example Request With Interactive Choice Messgae

The following code sends text with two suggested replies

cURL - cURL
curl --location --globoff '{endpoint}api/v2/rcs/message/send' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
	"channels": [{
		"name": "rcs",
		"from": "{channel.rcs.from}"
	}],
	"recipient": {
		"to": "{receiver}"
	},
	"message": {
		"type": "interactive",
		"payload": {
      "category" : "",
			"header": {
				"type": "text",
				"payload": {
					"text": "header text"
				}
			},
			"body": {
				"type": "text",
				"payload": {
					"text": "Please select one of the reply:"
				}
			},
			"footer": {
				"type": "text",
				"payload": {
					"text": "header text"
				}
			},
			"choices": [
				{
					"type": "text",
					"payload": {
						"text": "Click Here For Yes",
						"id": "unique-id",
						"content": "Yes"
					}
				},
				{
					"type": "text",
					"payload": {
						"text": "Click Here For No",
						"id": "unique-id",
						"content": "No"
					}
				}
			]
		}
	}
}'

PARAMETERS

Name Description Limits Required
header Optional N/A No
body this block contains acutal content for the message N/A Yes
footer Optional N/A No
choices this block contains actions for suggestions of the message N/A Yes
text this parameter holds suggested reply text Max 25 Chars. Yes
content this parameter holds suggested reply text’s identification for your reference N/A Yes

Example Request with suggested actions:

The following code sends text with two suggested actions

curl -X POST \
  '{endpoint}rcs/message/send' \
  -H 'authorization: Bearer d9e1cac3812186b353c5022xxxxx' \
  -H 'content-type: application/json' \
  -d '{
	"channels": [{
		"name": "rcs",
		"from": "700969ca-0cb2-11ec-a2cxxxx"
	}],
	"recipient": {
		"to": "91XXXXXX"
	},
	"message": {
		"type": "interactive",
		"payload": {
      "category" : "",
			"header": {
				"type": "text",
				"payload": {
					"text": "header text"
				}
			},
			"body": {
				"type": "text",
				"payload": {
					"text": "header text"
				}
			},
			"footer": {
				"type": "text",
				"payload": {
					"text": "header text"
				}
			},
			"choices": [
				{
					"type": "location",
					"payload": {
						"longitude": 12.912985,
            "latitude": 77.599505,
            "name": "Company Pvt Ltd",
            "address": "JP Nagar, Mini forest"
					}
				},
				{
					"type": "calendar",
					"payload": {
						"title": "Add to Calendar",
						"event": {
                "date": "2020-01-31",
                "time": "23:30",
                "title": "Title of the event",
                "description": "Description of the event"
            },
						"id": "unique-id"
					}
				}
			]
		}
	}
}'

PARAMETERS

Name Description Limits Required
header Optional N/A No
body this block contains acutal content for the message N/A Yes
footer Optional N/A No
choices this block contains actions for suggestions of the message N/A Yes
latitude The latitude in degrees. must be in the range [-90.0, +90.0] Yes
longitude The longitude in degrees. must be in the range [-180.0, +180.0] Yes
calender creates user’s calender event upon click N/A Yes

API Endpoint

https://eu.cpaas.bics.com/api/v2/

Note: Few elements in the endpoint may change from service to service.

We can send RichRCard Message using below API.

{endpoint}rcs/message/send

Example Request With Card Messgae

cURL - cURL
curl --location --globoff '{endpoint}api/v2/rcs/message/send' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
	"channels": [{
		"name": "rcs",
		"from": "{channel.rcs.from}"
	}],
	"recipient": {
		"to": "{receiver}"
	},
	"message": {
        "type": "card",
		"payload": {
			"title": "This is the card title Oct 20",
			"description": "Have you heard of BICS Cpass ?",
			"body": {
                "type": "image",
                "payload": {
                    "url": "https://picsum.photos/id/237/200/300",
                    "caption": "Do you know about BICS RCS Service?",
                    "filename": "",
                    "height": "TALL"
                }
			},
            "choices": [
				{
					"type": "reply",
					"payload": {
						"text": "Click Here For Yes",
						"id": "unique-id",
						"content":"yes"
					}
				},
				{
					"type": "reply",
					"payload": {
						"text": "Click Here For No",
						"id": "unique-id",
						"content":"no"
					}
				}
			]
		}
	}
}'

PARAMETERS

Name Description Limits Required
type Type of the message Ex: “card” NA Yes
payload Actual message data NA Yes
title Title of the card NA Yes
description Description of the card NA Yes
body This section contains media file information NA Yes
body.payload.height Height of the card SHORT [112 DP], MEDIUM [168 DP], TALL[264 DP] Yes
choices This section contains choices for selection Max of 4 choices No

Carousels may contain a minimum of two and a maximum of ten rich cards.

API Endpoint

https://eu.cpaas.bics.com/api/v2/

Note: Few elements in the endpoint may change from service to service.

We can send Carousel using below API.

{endpoint}rcs/message/send
cURL - cURL
curl --location --globoff '{endpoint}api/v2/rcs/message/send' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
   "channels": [{
      "name": "rcs",
      "from": "{channel.rcs.from}"
   }],
   "recipient": {
      "to": "{receiver}"
   },
   "message": {
        "type": "carousel",
      "payload": [{
         "title": "This is the card title",
         "description": "This is the card description",
            "choices": [
            {
               "type": "reply",
               "payload": {
                  "text": "Click Here For No",
                  "content": "send No"
               }
            }
         ],
         "body": {
                "type": "image",
                "payload": {
                    "url": "https://mobtexting.com/assets/images/mob-logo.png",
                    "caption": "This is the Header",
                    "filename": "",
                    "height": "MEDIUM"
                }
         }
      },
      {
         "title": "This is the card title2",
         "description": "This is the card description",
         "choices": [
            {
               "type": "reply",
               "payload": {
                  "text": "Click Here For Yes",
                  "content": "send Yes"
               }
            }
         ],
         "body": {
             "type": "image",
             "payload": {
                 "url": "https://mobtexting.com/assets/images/sms-home.png",
                 "caption": "This is the Header2",
                 "height": "MEDIUM"
             }
         }
      }]
   }
}'

PARAMETERS

Name Description Limits Required
type Type of the message Ex: “carousel” NA Yes
payload Actual message data NA Yes
title Title of the card Max of 200 chars Yes
description Description of the card Max of 200 chars Yes
body This section contains media file information NA Yes
choices This section contains choices for selection Max of 4 choices No
body.payload.height Height of the card SHORT [112 DP], MEDIUM [168 DP], TALL[264 DP] Yes

Note: TALL cannot be used for rich card carousels when the card width is set to SMALL