Send communication message

This API allows you to send communication message using SMS/WhatsApp/Zalo or Email as a communication channel.

👍

Note

For detailed information about our APIs and for hands-on testing, refer documentation in API overview and step-by-step guide on making your first API call in Make your first API call .

Prerequisites

  • Authentication: Basic or OAuth authentication details
  • Access group resource: WRITE access to Communication access group resource

Resource information

URI/communications/sendMessage?channel={channel}
HTTP methodPOST
Rate limit

API endpoint example

`https://eu.api.capillarytech.com/v2/communications/sendMessage?channel=sms

Path parameter

ParameterDatatypeDescription
channelEnumThe communication channel. The supported values are sms, whatsapp, email and zalo. The values are not case-sensitive. Default value-sms.

Request Body Parameters (SMS)

ParameterDatatypeDescription
sms*array-objDetails of the SMS to send. Pass each SMS in a separate object.
to*stringMobile number of the recipient.
body*stringMessage content to be sent.
scheduledTimedate-timeDate and time of sending in ISO standard format.
senderstringSender ID from which the message has to go (sender IDs configured for the respective OU). If not passed, the default sender ID of the org is considered.

Request body (Email)

ParameterDatatypeDescription
email*array-objComplete details of the email to send.
to*stringRecipient’s email ID.
ccstringEmail ID to be included in CC
bccstringEmail IDs to included in BCC.
from*stringEmail ID of the sender.
subject*stringSubject of the email.
body*stringBody of the email.
attachmentsobjDetails of the attachment used in the email.
attachmentarray-objDetails of each attachment in email.
file_namestringName of the attached file.
file_typestringType of the file (file format).
file_datastringEncoded data of the attachment.
file_encoding_typestringEncoding type of the attachment provided in fileData. Required for all base64 encoded image formats such as JPG, PNG, JPEG, and GIF. This is not required for other file types like TXT, and PDF which are not base64 encoded.
scheduledTimedate-timeISO standard date and time of scheduling the email.

Request body (WhatsApp)

ParameterDatatypeDescription
whatsappMessage*array-objDetails of the WhatsApp message to send. Pass each WhatsApp message in a separate object.
receiver*stringMobile number of the recipient.
template*stringMessage content to be sent. This is the content that will be communicated to the user.
scheduledTimedate-timeISO standard date and time of scheduling the message.

Request body (Zalo)

ParameterDatatypeDescription
zaloMessage*array-objDetails of the Zalo message to send. Pass each Zalo message in a separate object.
receiver*stringMobile number of the recipient.
template*stringMessage content to be sent. This is the content that will be communicated to the user.
scheduledTimedate-timeISO standard date and time of scheduling the message.

Example request body

{
    "root": {
        "sms": [
            {
                "to": "919591471711",
                "body": "747977-is the OTP for company X. Valid for 15 minutes. flob0a0BiPA",
                "scheduledTime": "2024-02-22T00:25:06+05:30"
            },
            {
                "to": "919591471711",
                "body": "821341 is the OTP for company Y. Valid for 15 minutes. flob0a0BiPA",
                "scheduledTime": "2024-02-22T09:25:06+05:30"
            }
        ]
    }
}
{
  "root": {
    "email": [
      {
        "to": "[email protected]",
        "cc": "",
        "bcc": "",
        "from": "[email protected]",
        "subject": "Testingemail",
        "scheduledTime": "2024-02-22T00:25:06+05:30"
      }
    ]
  }
}
{
  "root": {
    "whatsappMessage": [
      {
        "receiver": "919591471711",
        "template": "747977 is the OTP for Go+. Valid for 15 minutes. f1obOaOBiPA",
        "scheduledTime": "2024-02-22T00:25:06+05:30"
      }
    ]
  }
}
{
  "root": {
    "zaloMessage": [
      {
        "receiver": "919591471711",
        "template": "747977 is the OTP for Go+. Valid for 15 minutes. f1obOaOBiPA",
        "scheduledTime": "2024-02-22T00:25:06+05:30"
      }
    ]
  }
}

Example response

{
    "status": {
        "count": 2,
        "statusCode": {
            "status": true,
            "message": "Success",
            "code": 200
        },
        "successCount": 2,
        "warnings": [],
        "warningsAsStatusCode": [],
        "message": "Success",
        "code": 200,
        "success": true
    },
    "smsList": [
        {
            "sms": {
                "to": "9919591471711",
                "body": "821341 is the OTP for company Y. Valid for 15 minutes. flob0a0BiPA",
                "scheduledTime": "2024-02-22T00:25:06+05:30",
                "sender": ""
            },
            "errors": [],
            "warnings": []
        },
        {
            "sms": {
                "to": "9919591471711",
                "body": "747977 is the OTP for Shell Go+. Valid for 15 minutes. f1obOaOBiPA",
                "scheduledTime": "2024-02-22T09:25:06+05:30",
                "sender": ""
            },
            "errors": [],
            "warnings": []
        }
    ]
}
{
    "status": {
        "count": 1,
        "statusCode": {
            "status": true,
            "message": "Success",
            "code": 200
        },
        "successCount": 1,
        "warnings": [],
        "warningsAsStatusCode": [],
        "message": "Success",
        "code": 200,
        "success": true
    },
    "emails": [
        {
            "email": {
                "to": "[email protected]",
                "body": "",
                "scheduledTime": "2024-02-26T14:46:31+05:30",
                "cc": "",
                "bcc": "",
                "from": "[email protected]",
                "subject": "Testingemail",
                "fileHandler": [],
                "attachments": [],
                "labelOfSender": "Inventory",
                "senderEmail": "[email protected]",
                "replyToEmail": "[email protected]"
            },
            "errors": [],
            "warnings": []
        }
    ]
}
{
    "status": {
        "count": 1,
        "statusCode": {
            "status": true,
            "message": "Success",
            "code": 200
        },
        "successCount": 1,
        "warnings": [],
        "warningsAsStatusCode": [],
        "message": "Success",
        "code": 200,
        "success": true
    },
    "whatsapp": [
        {
            "whatsappMessage": {
                "scheduledTime": "2024-02-26T14:47:42+05:30",
                "template": "747977 is the OTP for Go+. Valid for 15 minutes. f1obOaOBiPA",
                "receiver": "919591471711"
            },
            "errors": [],
            "warnings": []
        }
    ]
}
{
    "status": {
        "count": 1,
        "statusCode": {
            "status": true,
            "message": "Success",
            "code": 200
        },
        "successCount": 1,
        "warnings": [],
        "warningsAsStatusCode": [],
        "message": "Success",
        "code": 200,
        "success": true
    },
    "zalo": [
        {
            "zaloMessage": {
                "scheduledTime": "2024-02-26T14:54:08+05:30",
                "receiver": "919591471711",
                "template": "747977 is the OTP for Go+. Valid for 15 minutes. f1obOaOBiPA"
            },
            "errors": [],
            "warnings": []
        }
    ]
}
Language
Credentials
Basic
base64
:
URL
Click Try It! to start a request and see the response here!