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/v1.1/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.
scheduled_time(Xml) / scheduledTime(Json)date-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.
scheduled_timedate-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 customer/user.
scheduled_time(Xml) / scheduledTime(Json)date-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.
scheduled_time(Xml) / scheduledTime(Json)date-timeISO standard date and time of scheduling the message.

Example request body (JSON)

{
    "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 request body (XML)

<root>
    <sms>
        <to>8971345617</to>
        <body>Testing body 1</body>
    </sms>
</root>
<root>
    <email>
        <to>[email protected]</to>
        <from>[email protected]</from>
        <subject>OTP</subject>
        <body>OTP to verify is 999999.</body>
        <scheduled_time>2024-02-22T00:25:06+05:30</scheduled_time>
    </email>
</root>
<root>
    <whatsappMessage>
        <receiver>919442450602</receiver>
        <template>OTP body</template>
        <scheduled_time>2024-02-22T00:25:06+05:30</scheduled_time>
    </whatsappMessage>
</root>
<root>
    <zaloMessage>
        <receiver>919442450602</receiver>
        <template>OTP body</template>
        <scheduled_time>2024-02-22T00:25:06+05:30</scheduled_time>
    </zaloMessage>
</root>

Response (JSON)

{
    "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": []
        }
    ]
}

Response (XML)

<response>
    <status>
        <message>Success</message>
        <code>200</code>
        <success>true</success>
        <totalCount>1</totalCount>
        <successCount>1</successCount>
    </status>
    <messages>
        <smsData>
            <sms>
                <status>Queued</status>
                <nsAdminId>1706734307814</nsAdminId>
                <sender></sender>
                <to>918971345617</to>
                <body>Testing body 1</body>
                <scheduledTime>2024-02-26 14:59:49</scheduledTime>
            </sms>
        </smsData>
    </messages>
</response>
<response>
    <status>
        <message>Success</message>
        <code>200</code>
        <success>true</success>
        <totalCount>1</totalCount>
        <successCount>1</successCount>
    </status>
    <emails>
        <emailData>
            <email>
                <from>[email protected]</from>
                <to>[email protected]</to>
                <cc></cc>
                <bcc></bcc>
                <subject>OTP</subject>
                <scheduledTime>2024-02-22 00:25:06</scheduledTime>
            </email>
        </emailData>
    </emails>
</response>
<response>
    <status>
        <message>Success</message>
        <code>200</code>
        <success>true</success>
        <totalCount>1</totalCount>
        <successCount>1</successCount>
    </status>
    <whatsapp>
        <whatsappData>
            <whatsappMessage>
                <template>OTP body</template>
                <receiver>919442450602</receiver>
                <scheduledTime>2024-02-22 00:25:06</scheduledTime>
            </whatsappMessage>
        </whatsappData>
    </whatsapp>
</response>
<response>
    <status>
        <message>Success</message>
        <code>200</code>
        <success>true</success>
        <totalCount>1</totalCount>
        <successCount>1</successCount>
    </status>
    <zalo>
        <zaloData>
            <zaloMessage>
                <template>OTP body</template>
                <receiver>919442450602</receiver>
                <scheduledTime>2024-02-22 00:25:06</scheduledTime>
            </zaloMessage>
        </zaloData>
    </zalo>
</response>
Language
Authorization
Basic
base64
:
URL
Click Try It! to start a request and see the response here!