Skip to main content

POST /messages/send

caution

After 24h without a reply from the customer, it is not possible to send regular messages, you'll need to use a Template message, see examples below.

Required Parameters

ParameterTypeDescription
toStringPhone number or platform identifier
fromStringChannel identifier (e.g. whatsapp)
typeMessageTypeType of message to be sent
contentMessageContentContent of the message

Optional Parameters

ParameterTypeDescription
template_uuidstringUnique identifier of the template message
optin_contactBooleanConfirmation that the contact has opted-in for receiving messages

Example Request

curl -X POST "https://api.callbell.eu/v1/messages/send" \
-H "Authorization: Bearer test_gshuPaZoeEG6ovbc8M79w0QyM" \
-H "Content-Type: application/json" \
-d '{
"to": "+31612345678",
"from": "whatsapp",
"type": "text",
"content": {
"text": "Hello!"
}
}'

Response

ParameterTypeDescription
messageMessageSendRequestThe message send request. The system will initially enqueue the message.

Example Response

response.json
{
"message": {
"uuid": "adf3d1216d4c4dcd908199d6700f2381",
"status": "enqueued"
}
}

Send Message with Media Attachments

You can use the API to send media messages containing images, documents, audio and video messages.

Is it also possible to add a caption when sending image attachments (see the example request below).

Send Image Attachment Example

curl -X POST "https://api.callbell.eu/v1/messages/send" \
-H "Authorization: Bearer test_gshuPaZoeEG6ovbc8M79w0QyM" \
-H "Content-Type: application/json" \
-d '{
"to": "+31612345678",
"from": "whatsapp",
"type": "image",
"content": {
"url": "https://example.com/my_image.jpeg"
}
}'

Send Image Attachment & Caption Example

curl -X POST "https://api.callbell.eu/v1/messages/send" \
-H "Authorization: Bearer test_gshuPaZoeEG6ovbc8M79w0QyM" \
-H "Content-Type: application/json" \
-d '{
"to": "+31612345678",
"from": "whatsapp",
"type": "image",
"content": {
"url": "https://example.com/my_image.jpeg",
"text: "This is my caption"
}
}'

Send Document Attachment Example

curl -X POST "https://api.callbell.eu/v1/messages/send" \
-H "Authorization: Bearer test_gshuPaZoeEG6ovbc8M79w0QyM" \
-H "Content-Type: application/json" \
-d '{
"to": "+31612345678",
"from": "whatsapp",
"type": "document",
"content": {
"url": "https://example.com/my_image.pdf"
}
}'

Send Audio Attachment Example

info

This is only available for accounts using the official WhatsApp Business API integration.

curl -X POST "https://api.callbell.eu/v1/messages/send" \
-H "Authorization: Bearer test_gshuPaZoeEG6ovbc8M79w0QyM" \
-H "Content-Type: application/json" \
-d '{
"to": "+31612345678",
"from": "whatsapp",
"type": "document",
"content": {
"url": "https://example.com/my_audio.mp3"
}
}'

Send Video Attachment Example

info

This is only available for accounts using the official WhatsApp Business API integration.

curl -X POST "https://api.callbell.eu/v1/messages/send" \
-H "Authorization: Bearer test_gshuPaZoeEG6ovbc8M79w0QyM" \
-H "Content-Type: application/json" \
-d '{
"to": "+31612345678",
"from": "whatsapp",
"type": "document",
"content": {
"url": "https://example.com/my_video.mp4"
}
}'

Send Template Messages

You can use the API to send an approved Template Message.

info

This is only available for accounts using the official WhatsApp Business API integration.

caution

In order to send template messages template_uuid and optin_contact must be present in the payload.

curl -X POST "https://api.callbell.eu/v1/messages/send" \
-H "Authorization: Bearer test_gshuPaZoeEG6ovbc8M79w0QyM" \
-H "Content-Type: application/json" \
-d '{
"to": "+31612345678",
"from": "whatsapp",
"type": "text",
"content": {
"text": "John Doe"
},
"template_uuid": "d980fb66fd5043d3ace1aa06ba044342",
"optin_contact": true
}'

In this context text refers to the placeholder of the template message, for example let's say you have a template message like this:

template_example
Hello {{1}}, this is a template message example

The placeholder replacement will be done with the value passed in the payload, so in this case it will be the following:

template_example
Hello John Doe, this is a template message example

Send Template Messages with Media Attachments

You can use the API to send an approved Template Message

info

This is only available for accounts using the official WhatsApp Business API integration.

caution

In order to send template messages template_uuid and optin_contact must be present in the payload.

If you have media template messages approved, you can send them by including a valid url of the media

Send Image Attachment

curl -X POST "https://api.callbell.eu/v1/messages/send" \
-H "Authorization: Bearer test_gshuPaZoeEG6ovbc8M79w0QyM" \
-H "Content-Type: application/json" \
-d '{
"to": "+31612345678",
"from": "whatsapp",
"type": "image",
"content": {
"text": "John Doe",
"url": "https://example.com/valid_image.jpeg"
},
"template_uuid": "d980fb66fd5043d3ace1aa06ba044342",
"optin_contact": true
}'

Send Document Attachment

curl -X POST "https://api.callbell.eu/v1/messages/send" \
-H "Authorization: Bearer test_gshuPaZoeEG6ovbc8M79w0QyM" \
-H "Content-Type: application/json" \
-d '{
"to": "+31612345678",
"from": "whatsapp",
"type": "document",
"content": {
"text": "John Doe",
"url": "https://example.com/valid_document.pdf"
},
"template_uuid": "d980fb66fd5043d3ace1aa06ba044342",
"optin_contact": true
}'

Send Video Attachment

curl -X POST "https://api.callbell.eu/v1/messages/send" \
-H "Authorization: Bearer test_gshuPaZoeEG6ovbc8M79w0QyM" \
-H "Content-Type: application/json" \
-d '{
"to": "+31612345678",
"from": "whatsapp",
"type": "video",
"content": {
"text": "John Doe",
"url": "https://example.com/valid_video.mp4"
},
"template_uuid": "d980fb66fd5043d3ace1aa06ba044342",
"optin_contact": true
}'
info

Use the Templates API to the get the template_uuids your templates.