post https://example.com/v1/businesses//send/messages
API to send a message to recipient on target channel, i.e. WhatsApp, SMS
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
:
{
"sender": {
"id": "+14151111234",
"channelType": "whatsapp"
},
"recipient": {
"id": "+16044441111",
"channelType": "whatsapp"
},
"message": {
"attachments": [
{
"type": "document",
"url": "https://cdn.connectly.ai/26fa/26fa1308-d328-41c9-a6a1-d5f4225a3768"
}
]
}
}