Deflector Send Message API

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 NameTypeDescriptionExampleRequired?
api-keyStringAPI key for authentication41a1de35948f915f64907ced9eed4f00Yes
Content-Type StringJSON format for the request payload.application/jsonYes

📘

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.

ParameterData TypeRequiredDescription
toArrayYesList of recipients for the message. Each entry contains the recipient’s phone number.
to.phoneNumberStringYesRecipient’s mobile number in international format, without the + symbol.
callbackDataStringNoCustom reference value returned in callbacks to help identify the request.
tagsArrayNoTags used to categorize messages for tracking, analytics, or reporting.
whatsappObjectNoWhatsApp-specific message configuration. Required if WhatsApp is included in the flow.
whatsapp.messageArrayYesList of WhatsApp message objects to be sent to the recipient.
whatsapp.message.x-apiheaderStringYesUnique request identifier used for tracking and idempotency.
whatsapp.message.message_typeStringYesType of WhatsApp message. Currently supports template.
whatsapp.message.recipient_typeStringYesSpecifies the recipient type. Supported value is individual.
whatsapp.message.type_templateArrayYesDefines the WhatsApp template configuration.
whatsapp.message.type_template.nameStringYesName of the approved WhatsApp message template.
whatsapp.message.type_template.attributesArrayYesValues mapped to the template placeholders, provided in the defined order.
whatsapp.message.type_template.language.localeStringYesLanguage code for the template, for example en.
whatsapp.message.type_template.language.policyStringYesLanguage selection policy, typically deterministic.
rcsObjectNoRCS-specific message configuration. Required if RCS is included in the flow.
rcs.contentObjectYesDefines the RCS message payload.
rcs.content.typeStringYesType of RCS message. Supported value is template.
rcs.content.templateCodeStringYesUnique identifier of the approved RCS template.
rcs.content.attributesObjectYesKey-value pairs mapped to the RCS template placeholders.
smsObjectNoSMS-specific message configuration. Required if SMS is included in the flow.
sms.FromStringYesSender ID displayed to the recipient.
sms.TextStringYesPlain text content of the SMS message.
flowArrayYesDefines the delivery order or simultaneous delivery across channels.
flow.channelStringYesChannel 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

  1. 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.

  1. Each channel attempts to deliver the message independently.
  2. If the message is successfully delivered via any one of the
    channels, it may be considered delivered.
"flow": [
  [
    {
      "channel": "RCS"
    },
    {
      "channel": "WhatsApp"
    },
    {
      "channel": "SMS"
    }
  ]
]