Webhooks
Webhooks are user-defined HTTP callbacks that are triggered by specific events. Whenever that trigger event occurs, the data is collected and immediately sent to the Webhook URL through a notification (HTTP request).
There are two types of Webhooks:
- Event Webhook: Allows you to receive user events in real-time. This includes delivery notifications such as Sent, Delivered, Not Sent, Read, Clicked, and Failed.
- Incoming Webhook: Updates whenever the user sends a text message. It also provides context for replies to previous messages and supports various content types such as Text, Media, Video, Image, Document, Location, and so on.
Note: By default parameters have an empty string or empty array (as applicable) in case there is no data associated with the Webhook request.
Webhook Integration
To configure Webhooks, navigate to the CPaaS dashboard and click RCS > Settings > Webhook Integration.
You can add the following details for Webhook Integration:
- URL endpoint: You can configure up to three incoming Webhook endpoints and up to five event Webhook endpoints.
- Failure Alert System: You can add your email ID to receive alerts or notifications in case of any webhook failures.
Event Webhooks:
Sent Webhook
Sample for Sent Webhook Data
An example of the full JSON that would be POSTed to your Webhook URL is:
[
{
"callbackdata": "7890986",
"channel": "RCS",
"click_data": {},
"event_time": 1704876828,
"last_channel": "",
"message_id": "api-337-91920920929-3c9094b5cd72fdcaafbb633502afa672-1704876827",
"mobile": "91920920929",
"remarks": "",
"requestid": "f95e99645268169422abc9cd0ae3a8b7",
"status": "Sent",
"tags": [
"12"
],
"type": "Template"
}
]
Not Sent Webhook
Sample for Not Sent Webhook Data
An example of the full JSON that would be POSTed to your webhook URL is:
[
{
"message_id": "api-77865-919209209291-7ccfc842d1203d1f7f45cb5979e9c57b-1691766276",
"mobile": "919209209291",
"status": "Not sent",
"channel": "RCS",
"type": "Template",
"tags": [
"12"
],
"remarks": "Number is RCS disabled or Bot is not launched with the number's provider",
"requestid": "492b87ba7ce0332234767d7de1ec49f3",
"callbackdata": "7890986",
"last_channel": "",
"event_time": 1691766278
}
]
Delivered Webhook
Sample for Delivered Webhook Data
An example of the full JSON that would be POSTed to your webhook URL is:
[
{
"callbackdata": "7890986",
"channel": "RCS",
"click_data": {},
"event_time": 1704876833,
"last_channel": "",
"message_id": "api-337-919209209291-3c9094b5cd72fdcaafbb633502afa672-1704876827",
"mobile": "919209209291",
"remarks": "",
"requestid": "f95e99645268169422abc9cd0ae3a8b7",
"status": "Delivered",
"tags": [
"12"
],
"type": "Template"
}
]
Read Webhook
Sample for Read Webhook Data
An example of the full JSON that would be POSTed to your webhook URL is:
[
{
"callbackdata": "7890986",
"channel": "RCS",
"click_data": {},
"event_time": 1704877597,
"last_channel": "",
"message_id": "api-337-919209209291-4f3406fc8aede5feef7801bfb75cfb97-1704877442",
"mobile": "919209209291",
"remarks": "",
"requestid": "643988d1aee3de27700f105e16b928bf",
"status": "Read",
"tags": [
"12"
],
"type": "Template"
}
]
Clicked Webhook
Sample for Clicked Webhook Data
An example of the full JSON that would be POSTed to your webhook URL is:
[
{
"callbackdata": "7890986",
"channel": "RCS",
"click_data": {
"postbackData": "Thank you for visit",
"suggestionType": "url_action",
"text": "Visit Now akash",
"type": "ACTION"
},
"event_time": 1704877756,
"last_channel": "",
"message_id": "api-337-919209209291-417c614cf4ae2688c47c4098091f9d04-1704877390",
"mobile": "919209209291",
"remarks": "",
"requestid": "54713f490c2e5d4f639f5192961fb2ce",
"status": "Clicked",
"tags": [
"12"
],
"type": "Template"
}
]
Failed Webhook
Sample for Failed Webhook Data
An example of the full JSON that would be POSTed to your webhook URL is:
[
{
"message_id": "api-77865-919209209291-7ccfc842d1203d1f7f45cb5979e9c57b-1691766276",
"mobile": "919209209291",
"status": "Failed",
"channel": "RCS",
"type": "Template",
"tags": [
"12"
],
"remarks": "Number is RCS disabled or Bot is not launched with the number's provider",
"requestid": "492b87ba7ce0332234767d7de1ec49f3",
"callbackdata": "7890986",
"last_channel": "",
"event_time": 1691766278
}
]
Incoming Webhooks:
URL Click
Sample for URL Clicked Webhook Data
An example of the full JSON that would be POSTed to your webhook URL is:
[
{
"message_id": "MxYCqkrTseTPOSfw9lvlLBaw",
"from": "fG2uBk2yZaj3TkwN",
"from_name": "abhishekmaurya_h9mcvAK3",
"received_at": 1708673752001,
"message_type": "click",
"message_details": {
"suggestionResponse": {
"metadata": "{\"msgId\":\"api-337-918983190458-f1f39df91ec6b9e8e078267c7dc549a9-1708673518\",\"a2pMsgDate\":\"2024-02-23T07:32:01.816\",\"templateCode\":\"temp_new_promo_12345\",\"templateType\":\"rich_card\",\"suggestionType\":\"url_action\",\"suggestionIndex\":0}",
"postbackData": "Visit Now",
"text": "Visit Now",
"type": "ACTION"
}
},
"to": "+918983190458"
}
]
Dialer click
Sample for Dialer Clicked Webhook Data
An example of the full JSON that would be POSTed to your webhook URL is:
[
{
"callbackdata": "7890986",
"channel": "RCS",
"click_data": {
"postbackData": "Thank you for calling",
"suggestionType": "dialer_action",
"text": "Call Now",
"type": "ACTION"
},
"event_time": 1704877907,
"last_channel": "",
"message_id": "api-337-919209209291-417c614cf4ae2688c47c4098091f9d04-1704877390",
"mobile": "919209209291",
"remarks": "",
"requestid": "54713f490c2e5d4f639f5192961fb2ce",
"status": "Clicked",
"tags": [
"12"
],
"type": "Template"
}
]
Reply
Sample for Replied Webhook Data
An example of the full JSON that would be POSTed to your webhook URL is:
[
{
"callbackdata": "7890986",
"channel": "RCS",
"click_data": {
"postbackData": "Thank you for clicking",
"suggestionType": "reply",
"text": "Thank you",
"type": "REPLY"
},
"event_time": 1704878040,
"last_channel": "",
"message_id": "api-337-919209209291-417c614cf4ae2688c47c4098091f9d04-1704877390",
"mobile": "919209209291",
"remarks": "",
"requestid": "54713f490c2e5d4f639f5192961fb2ce",
"status": "Clicked",
"tags": [
"12"
],
"type": "Template"
}
]
Text message
Sample for Text Message Webhook Data
An example of the full JSON that would be POSTed to your webhook URL is:
[
{
"message_id": "MxDB2zvbOSQbKVMUsKCplu3w",
"from": "fG2uBk2yZaj3TkwN",
"from_name": "abhishekmaurya_h9mcvAK3",
"received_at": 1708675048204,
"message_type": "text",
"message_details": {
"text": "Hell"
},
"to": "+918983190458"
}
]
Image File
Sample for Image File Webhook Data
An example of the full JSON that would be POSTed to your webhook URL is:
[
{
"message_id": "MxQT995BvzTsqcpe-21oE0wA",
"from": "fG2uBk2yZaj3TkwN",
"from_name": "abhishekmaurya_h9mcvAK3",
"received_at": 1708675207299,
"message_type": "image",
"message_details": {
"userFile": {
"payload": {
"fileName": "1000058747.jpg",
"fileSizeBytes": 422085,
"fileUri": "https://rcs-user-content-ap.storage.googleapis.com/b11c1edd-e137-4a8f-8644-8ae2540ada25/878a23fde7837007d8d7a4965f42a0e7ecac823419163487c7d56aec6e46",
"mimeType": "image/jpeg"
},
"thumbnail": {
"fileSizeBytes": 9875,
"fileUri": "https://rcs-user-content-ap.storage.googleapis.com/d671bd2c-2969-4e39-90d1-2aa20d0d391b/f48ee3ed82e3fd1f0744db5ac0187cdc9bc58e3d8115f4d978e6fdf265d4",
"mimeType": "image/jpeg"
}
}
},
"to": "+918983190458"
}
]
Video File
Sample for Video File Webhook Data
An example of the full JSON that would be POSTed to your webhook URL is:
[
{
"message_id": "MxAy54yPx=QiOI9FMTzWpM4g",
"from": "fG2uBk2yZaj3TkwN",
"from_name": "abhishekmaurya_h9mcvAK3",
"received_at": 1708680651935,
"message_type": "video",
"message_details": {
"userFile": {
"payload": {
"fileName": "1000049921.mp4",
"fileSizeBytes": 4643821,
"fileUri": "https://rcs-user-content-ap.storage.googleapis.com/940dabfe-10ee-474a-82bb-f57b3552d93d/72fd10aa8964bae1fbba9d26ff865ea9c7bc482f990123054b75f187ddf4",
"mimeType": "video/mp4"
},
"thumbnail": {
"fileSizeBytes": 7492,
"fileUri": "https://rcs-user-content-ap.storage.googleapis.com/c1078d2b-550f-4cd0-888b-945f243346ed/d448c493f72dd7aa8223de04f4f8585f7cc58181c84426f2f8ac0aefc616",
"mimeType": "image/jpeg"
}
}
},
"to": "+918983190458"
}
]
Emojis
Sample for Emojis Webhook Data
An example of the full JSON that would be POSTed to your webhook URL is:
[
{
"message_id": "MxXiODXzJUR42jX=6ZeIAeqw",
"from": "fG2uBk2yZaj3TkwN",
"from_name": "abhishekmaurya_h9mcvAK3",
"received_at": 1708681750341,
"message_type": "text",
"message_details": {
"text": "😃😁😄😄😄😁😁🤐"
},
"to": "+918983190458"
}
]
GIF
Sample for GIF Webhook Data
An example of the full JSON that would be POSTed to your webhook URL is:
[
{
"message_id": "MxXKrq2MgYTbqsUfXzUwWYPg",
"from": "fG2uBk2yZaj3TkwN",
"from_name": "abhishekmaurya_h9mcvAK3",
"received_at": 1708682136369,
"message_type": "image",
"message_details": {
"userFile": {
"payload": {
"fileName": "6960641278663366875.gif",
"fileSizeBytes": 822303,
"fileUri": "https://rcs-user-content-ap.storage.googleapis.com/45cda97c-c294-4526-95c0-ed94b793b068/c11d20abe9c4b1923ddbea885c9d3251eb19f10de88053a2af0b7313abd5",
"mimeType": "image/gif"
}
}
},
"to": "+918983190458"
}
]
Sticker
Sample Sticker Webhook Data
An example of the full JSON that would be POSTed to your webhook URL is:
[
{
"message_id": "MxhKEgbl1iR96k9dlpbSYAmQ",
"from": "fG2uBk2yZaj3TkwN",
"from_name": "abhishekmaurya_h9mcvAK3",
"received_at": 1708682613996,
"message_type": "image",
"message_details": {
"userFile": {
"payload": {
"fileName": "3702800892363579243.png",
"fileSizeBytes": 13125,
"fileUri": "https://rcs-user-content-ap.storage.googleapis.com/d1b84f41-914f-470c-959c-7cddbc893546/b28c3d49d2c3cab893ed86eb029692acf05665b894240a2ce6b0e15dfd7f",
"mimeType": "image/png"
},
"thumbnail": {
"fileSizeBytes": 10100,
"fileUri": "https://rcs-user-content-ap.storage.googleapis.com/8115c463-50d4-4941-8472-292eac661f15/a1e043f8eaed8693c571f94bd0aebc80b30402eacf256d9a295048e1a846",
"mimeType": "image/jpeg"
}
}
},
"to": "+918983190458"
}
]
Audio File
Sample Audio File Webhook Data
An example of the full JSON that would be POSTed to your webhook URL is:
[
{
"message_id": "MxZ1GbicGSQ1-Y0v1Ykhc5jQ",
"from": "fG2uBk2yZaj3TkwN",
"from_name": "abhishekmaurya_h9mcvAK3",
"received_at": 1708683532677,
"message_type": "audio",
"message_details": {
"userFile": {
"payload": {
"fileName": "2469599764544536230.m4a",
"fileSizeBytes": 28096,
"fileUri": "https://rcs-user-content-ap.storage.googleapis.com/2e54b9df-37f2-4243-82e7-234327870012/06e8a2e0fbbb6f904f515ba5331c652a3ec04412f815f02eaf58daa73aca",
"mimeType": "audio/mp4"
}
}
},
"to": "+918983190458"
}
]
PDF File
Sample PDF File Webhook Data
An example of the full JSON that would be POSTed to your webhook URL is:
[
{
"message_id": "MxSYhAOHBiSfWJIqNhjL4Taw",
"from": "fG2uBk2yZaj3TkwN",
"from_name": "abhishekmaurya_h9mcvAK3",
"received_at": 1708684413874,
"message_type": "application",
"message_details": {
"userFile": {
"payload": {
"fileName": "PL-9102053591.pdf",
"fileSizeBytes": 88583,
"fileUri": "https://rcs-user-content-ap.storage.googleapis.com/bf37ac44-7098-442f-a260-2284f68c7872/9ce51647bb96b92c381ca37a9f501f549249677bf4764588696f29c4acc4",
"mimeType": "application/pdf"
}
}
},
"to": "+918983190458"
}
]
Text File
Sample Text File Webhook Data
An example of the full JSON that would be POSTed to your webhook URL is:
[
{
"message_id": "Mx9bsAlq3vSfaNRYBpRMU7Og",
"from": "fG2uBk2yZaj3TkwN",
"from_name": "abhishekmaurya_h9mcvAK3",
"received_at": 1708684526506,
"message_type": "text",
"message_details": {
"userFile": {
"payload": {
"fileName": "HdfcLogs_20_june_23.txt",
"fileSizeBytes": 273968,
"fileUri": "https://rcs-user-content-ap.storage.googleapis.com/423c5fb8-6fbe-4ffd-a930-fb946dce468b/74b76567713cf411602166bf1d6400b191afd9eedfc5467951446e44b2ee",
"mimeType": "text/plain"
}
}
},
"to": "+918983190458"
}
]
XLSX File
Sample XLSX File Webhook Data
An example of the full JSON that would be POSTed to your webhook URL is:
[
{
"message_id": "Mxg5wr5-4PSRy7HgMu2VvodQ",
"from": "fG2uBk2yZaj3TkwN",
"from_name": "abhishekmaurya_h9mcvAK3",
"received_at": 1708684649781,
"message_type": "application",
"message_details": {
"userFile": {
"payload": {
"fileName": "sqltableformock.xlsx",
"fileSizeBytes": 12291,
"fileUri": "https://rcs-user-content-ap.storage.googleapis.com/87a50064-afa1-47b7-8553-43d4320b8f70/82f19722d9795674c5c1ed43602b0bb640b237e5a6f92f42b012d3f0b3d5",
"mimeType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
}
}
},
"to": "+918983190458"
}
]
Word File
Sample Word File Webhook Data
An example of the full JSON that would be POSTed to your webhook URL is:
[
{
"message_id": "MxkpDvH3PJR7CJDh1gZ9jl4w",
"from": "fG2uBk2yZaj3TkwN",
"from_name": "abhishekmaurya_h9mcvAK3",
"received_at": 1708684719054,
"message_type": "application",
"message_details": {
"userFile": {
"payload": {
"fileName": "Form11Revised - current dt.040121 (2).docx",
"fileSizeBytes": 11203,
"fileUri": "https://rcs-user-content-ap.storage.googleapis.com/b03417f9-d59a-469a-b1e4-de3ca27c07b0/d7d2fb177014c5dc386de7e055fdcaa193abe8c12e8ab85ecbbca5934ec5",
"mimeType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
}
}
},
"to": "+918983190458"
}
]
Java File
Sample Java File Webhook Data
An example of the full JSON that would be POSTed to your webhook URL is:
[
{
"message_id": "MxA2pVZPMSQW2Xcz16LFFxiQ",
"from": "fG2uBk2yZaj3TkwN",
"from_name": "abhishekmaurya_h9mcvAK3",
"received_at": 1708685047935,
"message_type": "text",
"message_details": {
"userFile": {
"payload": {
"fileName": "global2.java",
"fileSizeBytes": 299,
"fileUri": "https://rcs-user-content-ap.storage.googleapis.com/0a8890e4-22d9-4198-b49e-990c3dbef1fa/ab460e6ef05a648e3c5475ab3df0f979f5bfe669efab1bfe7be05daf335b",
"mimeType": "text/x-java"
}
}
},
"to": "+918983190458"
}
]
Location
Sample Location Webhook Data
An example of the full JSON that would be POSTed to your webhook URL is:
[
{
"message_id": "MxF5mGBQsfQpygOdyLGeVkZw",
"from": "fG2uBk2yZaj3TkwN",
"from_name": "abhishekmaurya_h9mcvAK3",
"received_at": 1708685490505,
"message_type": "location",
"message_details": {
"location": {
"latitude": 46.2760738253062,
"longitude": 10.312510281801224
}
},
"to": "+918983190458"
}
]
Contact as a File type
Sample Contact File Webhook Data
An example of the full JSON that would be POSTed to your webhook URL is:
[
{
"message_id": "MxsNby9QVrT8y7wGA0DNGGKA",
"from": "fG2uBk2yZaj3TkwN",
"from_name": "abhishekmaurya_h9mcvAK3",
"received_at": 1708685558205,
"message_type": "text",
"message_details": {
"userFile": {
"payload": {
"fileName": "915028588023226308.vcf",
"fileSizeBytes": 77,
"fileUri": "https://rcs-user-content-ap.storage.googleapis.com/e7f29d01-0c10-4a8a-8af0-a4ae96491914/55098f208e35214388d2becfa3633fa52cc81abb64948fea0549b70df84e",
"mimeType": "text/x-vcard"
}
}
},
"to": "+918983190458"
}
]
Contact as a Text type
Sample Contact Text Webhook Data
An example of the full JSON that would be POSTed to your webhook URL is:
[
{
"message_id": "Mxff1kVthpTPCfEXOABYEWeA",
"from": "fG2uBk2yZaj3TkwN",
"from_name": "abhishekmaurya_h9mcvAK3",
"received_at": 1708685816004,
"message_type": "text",
"message_details": {
"text": " Akansha Waghmare\n[Mobile] 9109109109\n[Mobile] 9202992029"
},
"to": "+918983190728"
}
]
Updated about 14 hours ago
