Overview
This documentation describes how to send messages using the WhatsApp Business Platform
Messaging API
The 360dialog Messaging API enables businesses to send WhatsApp messages programmatically using the WhatsApp Business Platform.
Messages are sent via HTTPS requests to the 360dialog API, which communicates directly with Meta infrastructure. Messaging supports both business-initiated and user-initiated conversations.
Message Types
The WhatsApp API supports sending different types of messages, each requiring a specific JSON request body. All messages below are free-form and can only be sent within the customer service window. To send a message outside this window, a new conversation must be initiated using a Template message.
Message TypesCustomer 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.
Base URL
The default base URL for the Cloud API and MMAPI is https://waba-v2.360dialog.io
Messages Endpoint
POST https://waba-v2.360dialog.io/messages
To send any type of message using the WhatsApp API, use the messages endpoint.
MessagesMessage Templates
Refer to the seperate section about 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.
Bulk Messaging
There are two options for sending messages in bulk:
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.
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.
Receiving Messages
Messages on the WhatsApp Business Platform are delivered using webhooks. Through these webhooks, both incoming messages from users and message status notifications are sent in real time. If a webhook request fails or returns an HTTP status code other than 200, the platform retries delivery with increasing delays until it succeeds or a timeout is reached. This mechanism ensures reliable message reception and tracking via webhooks.
WebhooksTyping 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
Content-Type
application/json
D360-API-KEY
Your 360Dialog API key
Request Body
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?