Text messages
You can only send a text message up until 24 hours after receiving a message from the user. If you have not received a message from the user within this time, you will need to start a new conversation by sending a Template message.
Once you have the WhatsApp ID (
wa_id
discovered when checking the contact) for the user you want to message, use it to send a text message. Specify
text
in the type
field. A text message can be a maximum of 4096 characters long.post
https://waba.360dialog.io
/v1/messages
Send a text message
post
https://waba-v2.360dialog.io
/messages
Send a text message
WhatsApp allows some formatting in messages. To format all or part of a message, use these formatting symbols:
Formatting | Symbol | Example |
---|---|---|
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.To use
preview-url
with the 360dialog On-Premise hosting, it must be sent as a top-level object:Example:
{
"preview_url": true,
"to": "whatsapp-id",
"text": {
"body": "You have to check out this amazing messaging service https://www.whatsapp.com/"
}
When sending preview-url with Cloud API hosting, the
preview-url
should be inside the text object. Example:
"text": {// the text object
"preview_url": true,
"body": You have to check out this amazing messaging service https://www.whatsapp.com/"
}
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:
- 1.The business has sent a message template to the user.
- 2.The user initiates a conversation with a "click to chat" link.
- 3.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.
Last modified 12d ago