Send messages with one single API across multiple channels.
HTTP Method
This API uses the POST method.
API Endpoint
The base URLs for this API is https://cpass-deflector.netcorecloud.net/messages/send.
Request Headers
Authentication details are required to access the API. Ensure you include the necessary tokens or credentials in your request headers.
| Header Name | Type | Description | Example | Required? |
|---|---|---|---|---|
api-key | String | API key for authentication | 41a1de35948f915f64907ced9eed4f00 | Yes |
Content-Type | String | JSON format for the request payload. | application/json | Yes |
Notes
- Ensure that the API key provided in the header is valid.
- The phone number should be in the international format without the "+" sign.
- The attributes for templates should match the placeholders defined in the template.
Request Body
All necessary parameters should be passed in the request body in JSON format.
| Parameter | Data Type | Required | Description |
|---|---|---|---|
to | Array | Yes | List of recipients for the message. Each entry contains the recipient’s phone number. |
to.phoneNumber | String | Yes | Recipient’s mobile number in international format, without the + symbol. |
callbackData | String | No | Custom reference value returned in callbacks to help identify the request. |
tags | Array | No | Tags used to categorize messages for tracking, analytics, or reporting. |
whatsapp | Object | No | WhatsApp-specific message configuration. Required if WhatsApp is included in the flow. |
whatsapp.message | Array | Yes | List of WhatsApp message objects to be sent to the recipient. |
whatsapp.message.x-apiheader | String | Yes | Unique request identifier used for tracking and idempotency. |
whatsapp.message.message_type | String | Yes | Type of WhatsApp message. Currently supports template. |
whatsapp.message.recipient_type | String | Yes | Specifies the recipient type. Supported value is individual. |
whatsapp.message.type_template | Array | Yes | Defines the WhatsApp template configuration. |
whatsapp.message.type_template.name | String | Yes | Name of the approved WhatsApp message template. |
whatsapp.message.type_template.attributes | Array | Yes | Values mapped to the template placeholders, provided in the defined order. |
whatsapp.message.type_template.language.locale | String | Yes | Language code for the template, for example en. |
whatsapp.message.type_template.language.policy | String | Yes | Language selection policy, typically deterministic. |
rcs | Object | No | RCS-specific message configuration. Required if RCS is included in the flow. |
rcs.content | Object | Yes | Defines the RCS message payload. |
rcs.content.type | String | Yes | Type of RCS message. Supported value is template. |
rcs.content.templateCode | String | Yes | Unique identifier of the approved RCS template. |
rcs.content.attributes | Object | Yes | Key-value pairs mapped to the RCS template placeholders. |
sms | Object | No | SMS-specific message configuration. Required if SMS is included in the flow. |
sms.From | String | Yes | Sender ID displayed to the recipient. |
sms.Text | String | Yes | Plain text content of the SMS message. |
flow | Array | Yes | Defines the delivery order or simultaneous delivery across channels. |
flow.channel | String | Yes | Channel used for message delivery. Supported values are WhatsApp, RCS, and SMS. |
Request Body Structure
[
{
"to": [
{
"phoneNumber": "string"
}
],
"callbackData": "string",
"tags": ["string"],
"whatsapp": {
"message": [
{
"x-apiheader": "string",
"message_type": "template",
"recipient_type": "individual",
"type_template": [
{
"name": "string",
"attributes": ["string"],
"language": {
"locale": "string",
"policy": "string"
}
}
]
}
]
},
"rcs": {
"content": {
"type": "template",
"templateCode": "string",
"attributes": {
"key": "value"
}
}
},
"sms": {
"From": "string",
"Text": "string"
},
"flow": [
[
{
"channel": "string"
}
]
]
}
]
Example Request
curl --location 'https://cpass-deflector.netcorecloud.net/messages/send' \
--header 'Content-Type: application/json' \
--header 'api_key: <API_KEY>' \
--data '[
{
"to": [
{
"phoneNumber": "917499081814"
}
],
"callbackData": "7890986",
"tags": ["welcome"],
"whatsapp": {
"message": [
{
"x-apiheader": "xpi-12345-7319798",
"message_type": "template",
"recipient_type": "individual",
"type_template": [
{
"name": "new_client_welcome",
"attributes": [
"https://www.netcorecloud.com/"
],
"language": {
"locale": "en",
"policy": "deterministic"
}
}
]
}
]
},
"rcs": {
"content": {
"type": "template",
"templateCode": "Verification_temp",
"attributes": {
"FIRSTNAME": "Akash"
}
}
},
"sms": {
"From": "NETCRE",
"Text": "STN IS OK NC ALRT"
},
"flow": [
[
{ "channel": "RCS" }
],
[
{ "channel": "WhatsApp" }
],
[
{ "channel": "SMS" }
]
]
}
]'
Response
The response will include details about the status of the message sending process. Ensure to handle the response to check for any errors or confirmation of message delivery.
{
"messageId": "<ACK-MSG-ID>"
}
Use Case
Simultaneous Broadcast
- First Attempt: Simultaneous Broadcast
The message will be sent simultaneously through all specified channels: RCS, WhatsApp, and SMS.
By following this flow, the system will ensure that the message is sent via RCS, WhatsApp, and SMS at the same time.
- Each channel attempts to deliver the message independently.
- If the message is successfully delivered via any one of the
channels, it may be considered delivered.
"flow": [
[
{
"channel": "RCS"
},
{
"channel": "WhatsApp"
},
{
"channel": "SMS"
}
]
]
