Overview

This documentation describes how to send messages using the WhatsApp Business Platform

Message Types

You can use the API to send different types of messages. Each message type requires a specific JSON request body. Refer to the official WhatsApp documentation for the required parameters when building the request payload.

Message Types

Address messagesarrow-up-right allow you to easily request a delivery address from WhatsApp users.

Audio messagesarrow-up-right display an audio icon and a link to an audio file. When the WhatsApp user taps the icon, the WhatsApp client loads and plays the audio file.

Contacts messagesarrow-up-right allow you to send rich contact information directly to WhatsApp users, such as names, phone numbers, physical addresses, and email addresses.

Document messagesarrow-up-right display a document icon, linked to a document that a WhatsApp user can tap to download.

Image messagesarrow-up-right display a single image and an optional caption.

Interactive CTA URL button messagesarrow-up-right allow you to map any URL to a button, so you don’t have to include lengthy or obscure raw URLs in the message body.

Interactive voice call messagesarrow-up-right allow you to trigger WhatsApp call from users.

Interactive Flow messagesarrow-up-right allow you to send structured messages that are more natural or comfortable for your customers. For example, you can use WhatsApp Flows to book appointments, browse products, collect customer feedback, get new sales leads, or anything else.

Interactive Flow messages are documented in our WhatsApp Flowsarrow-up-right documentation set.

Interactive list messagesarrow-up-right allow you to present WhatsApp users with a list of options to choose from.

Interactive location request messagesarrow-up-right display body text and a send location button. When a WhatsApp user taps the button, a location sharing screen appears which the user can use to share their location.

Interactive reply buttonsarrow-up-right messages allow you to send up to three predefined replies for users to choose from.

Location messagesarrow-up-right allow you to send a location’s latitude and longitude coordinates to a WhatsApp user.

Sticker messagesarrow-up-right display animated or static sticker images in a WhatsApp message.

Text messagesarrow-up-right are messages containing only a text body and an optional link preview.

Template messagesarrow-up-right allow you to send marketing, utility, and authentication templates to WhatsApp users. Unlike all other message types, template messages do not require a 24-hour customer service window to be open between you and the message recipient before the message can be sent.

Video messagesarrow-up-right display a thumbnail preview of a video image with an optional caption. When the WhatsApp user taps the preview, it loads the video and displays it to the user.

Reaction messagesarrow-up-right are emoji-reactions that you can apply to a previous WhatsApp user message that you have received.

circle-info

Check out the Best practices on how to message end users.

Customer service windows

When a WhatsApp user sends a message or places a call, a 24-hour timer called a customer service window starts. If a window is already active, the timer refreshes.

While a customer service window is open, any type of message can be sent to the user. If no window is open, only template messages can be sent. Template messages are the only message type allowed outside of a customer service window.

Messages can only be sent to users who have opted in to receive communication from the business.

Known issue: In rare cases, a message may be received from a user but a response cannot be sent within the customer service window.

Send Text Message

circle-info

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 Body

Name
Type
Description

messaging_product*

string

Messaging service used for the request: Use "whatsapp"

text*

object

contains body field

type*

string

type of the message: text

recipient_type*

string

individual

A successful response includes a messages object with an ID for the newly created message.

Formatting in Text Messages

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';```

Sending URLs in Text Messages

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.

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:

If the end user did not initiate the conversation with you - you must use a Template message instead for a free-form message.

Message Templates

Please refer to our documentation on Message Templates, which includes the steps required to get your Templates approved, and the process for creating and deleting them.

We strongly advise uploading media intended to use in template messages and the usage of media ID instead of a URL:

  • Each WhatsApp Business Account can have up to 250 message templates (how many is determined by your plan). That means 250 message template names, and each of them can have multiple language translations.

    • For example, a message template called hello_world translated into two languages counts as a single message template in regards to this limit.

  • The message template name field is limited to 512 characters.

  • The message template content field is limited to 1024 characters.

  • There is no limit to the number of parameters allowed in a Message Template.

circle-info

360Dialog stores media files for 14 days after upload. Media files older than 14 days may be deleted by 360Dialog without prior notice.

Bulk Messaging

There are two options for sending messages in bulk:

  1. Use an Integration Partner

    Many Integration Partner applications provide built-in bulk messaging capabilities that allow template messages to be sent to multiple contacts without additional development.

  2. Develop a Custom Solution If development resources are available, a custom solution can be built to send template messages to a list of contacts using the API.

Message statuses

Received

The receive 'double check' on messages sent by the customer appears when the callback with the received status reaches the 360dialog Webhook.

The receive 'double check' on messages sent by the business appears when the customer’s WhatsApp app receives the message.

Read

The read double check on messages sent by the customer appears when the message is marked as read by the businessarrow-up-right.

The read double check on messages sent by the business appears when the customer’s WhatsApp app is open in the message.

How to mark a message as read

1

Make a POST request to /messages

The message_id used in this API call is the id provided in the Webhook Inbound Notification.

Parameters

Name
Description

messaging_product

Required. Use whatsapp

message_id

Required.

status

Required.

Updating status to read is applicable only for incoming messages.

2

Check the API Response

A successful response returns:

Typing indicators

Typing indicators allow a business integration to signal that a reply is being composed after an incoming message is received. When triggered, WhatsApp marks the message as read, then displays a typing indicator in the conversation until a response message is sent. If a response message is not sent within 25 seconds, the indicator is automatically dismissed.

Typing indicators are useful when additional processing time is required before sending a response, such as calling external services or performing complex business logic.

Send a typing indicator

POST https://waba-v2.360dialog.io/messages

To send a typing indicator, use the request URL, the following headers, and JSON body.

Headers

Name
Value

Content-Type

application/json

D360-API-KEY

Your 360Dialog API key

Request Body

Name
Type
Description

messaging_product*

string

Must be set to "whatsapp".

status*

string

The message must be marked "read" before displaying a typing indicator. Use "read".

message_id*

string

ID of the incoming message to mark as read and send a typing indicator for. Starts with "wamid.".

typing_indicator*

object

An object which contains a "type" key, whose value must be "text".

A successful request results in a "success": true response:

Last updated

Was this helpful?