Send session message
API to send a message to recipient on target channel, i.e. WhatsApp, SMS
If you are trying to send a WhatsApp message and the number you are messaging has not messaged you within the last 24 hours, you will need to send a pre approved template message. See here for details.
API to send a message to recipient on target channel, i.e. WhatsApp, SMS
POST
/v1/businesses/{businessId}/send/messages
API to send a message to recipient on target channel, i.e. WhatsApp, SMS
Path Parameters
Name | Type | Description |
---|---|---|
businessId* | String |
Request Body
Name | Type | Description |
---|---|---|
sender | externalmessageChannelIdentifier | { "id": "YOUR_BUSINESS_PHONE_NUMBER", "channelType": "whatsapp" } |
recepient* | externalmessageChannelIdentifier | { "id": "RECIPIENT_ID", "channelType": "whatsapp" } |
message* | externalmessageMessage | { "text": "Hello, this is a test message!" } See documentation below for more examples |
campaignName | String | Campaign name |
24 hour WhatsApp restriction
If the recipient has not initiated the conversation first within the last 24 hours you CAN NOT send the messages to them. In this case, you MUST use templated message API /v1/businesses/{businessId}/send/whatsapp_templated_messages
.
Generally, you use
/v1/businesses/{businessId}/send/messages
to reply to the customers who already messaged you first.You use
/v1/businesses/{businessId}/send/whatsapp_templated_messages
to initiate with the customer first.
Select the WhatsApp number you want to send from
The endpoint supports an optional sender field in the body. If you have multiple WhatsApp phone numbers with Connectly you can choose which one you want to send the message from. The payload needs to contain the optional sender
object specifying the phone number in the id
section and channelType
as whatsapp
:
Send a message with an attachment
You can include an attachment to the message. Currently, only a single attachment is supported.
Image Attachment Message
Video Attachment Message
Audio Attachment Message
Document Attachment Message
Send location message
Send interactive list message
Use list_message
to send a WhatsApp interactive list message. For more information, see WhatsApp documentation.
Send interactive reply buttons message
Use reply_button_message
to send interactive reply button message. For more information, see WhatsApp documentation.
Header Media
Both list and quick reply messages use the same header parameter structure. Here is an example of an image header:
This is an example of a document header with a filename:
Last updated