Text messages
Last updated
Was this helpful?
Last updated
Was this helpful?
To send text messages, specify text
in the type
field. A text message can be a maximum of 4096 characters long.
POST
https://waba-v2.360dialog.io/messages
To send a message, use the request URL and the following body parameters.
Request example
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "PHONE_NUMBER",
"type": "text",
"text": {
"body": "Hello, dear customer!"
}
}
recipient_type
string
individual
to
string
wa_id
of the contact you want to message
type
string
text
text
object
contains body field
messaging_product
string
Required only for Cloud API.
Messaging service used for the request. Use "whatsapp"
.
context
object
An object containing the ID of a previous message you are replying to. For example:
{"message_id":"MESSAGE_ID"}
Cloud API only.
A successful response includes a messages
object with an ID for the newly created message.
WhatsApp allows some formatting in messages. To format all or part of a message, use these formatting symbols:
Bold
Asterisk (*)
Your total is *$10.50*.
Italics
Underscore (_)
Welcome to _WhatsApp_!
Strike-through
Tilde (~)
This is ~better~ best!
Code
Three backticks (```)
```print 'Hello World';```
By default, the mobile WhatsApp application recognizes URLs and makes them clickable. To include a URL preview, include "preview_url": true
and make sure the URL begins with http://
or https://
. A hostname is required, IP addresses are not matched.
When sending preview-url with Cloud API hosting, the preview-url
should be inside the text object.
Example:
The majority of the time when you send a URL, whether with a preview or not, the receiver of the message will see a URL that they can click on.
URL previews are only rendered after one of the following has happened:
The business has sent a message template to the user.
The user initiates a conversation with a "click to chat" link.
The user adds the business phone number to their address book and initiates a conversation.
If the end user did not initiate the conversation with you - you must use a Template message instead.
To use preview-url
with the 360dialog On-Premise hosting, it must be sent as a top-level object:
Example:
Recipients will not see a contextual bubble if:
replying with a template message ("type":"template"
)
replying with an image, video, PTT, or audio, and the recipient is on KaiOS
These are known bugs which Meta is addressing. We will keep you updated on this matter.
Sample request:
A successful response includes an object with an identifier prefixed with wamid
. Use the ID listed after wamid
to track your message status.
Note: if the previous message is more than 30 days old or doesn't correspond to any message in the conversation, the message will be sent normally instead of as a reply.
Sample response:
As announced in November 2023, Meta is transitioning to a fully Cloud-hosted WhatsApp Business Platform and will stop supporting On-Premise API in October 2025. Starting from On-Premise client v2.53, all new feature updates will be exclusively delivered to Cloud API. While the On-Premise API client will receive quarterly releases, they will focus solely on bug fixes and security patches.
POST
https://waba.360dialog.io/v1/messages
To send a message, use the request URL and the following body parameters.
Request example
{
"recipient_type": "individual",
"to": "wa_id",
"type": "text",
"text": {
"body": "Hello, dear customer!"
}
}
recipient_type
string
individual
to*
string
wa_id of the contact you want to message
type
string
text
text
object
contains body field
A successful response includes a messages
object with an ID for the newly created message.
Required if any message in the conversation.
You can send any message as a reply to a previous message in a conversation by including the previous message's ID in the object. The recipient will receive the new message along with a contextual bubble that displays the previous message's content.