# Overview

## WhatsApp API

The 360dialog WhastApp 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.&#x20;

All WhatsApp API endpoints can be found in our WhatsApp API reference:&#x20;

{% content-ref url="../messaging-api/api-reference" %}
[api-reference](https://docs.360dialog.com/docs/messaging-api/api-reference)
{% endcontent-ref %}

### 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.&#x20;

{% content-ref url="message-types" %}
[message-types](https://docs.360dialog.com/docs/messaging/message-types)
{% endcontent-ref %}

### 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.

### Base URL

The default base URL for the Cloud API and MMAPI is `https://waba-v2.360dialog.io`&#x20;

### Messages Endpoint

<mark style="color:orange;">`POST`</mark> `https://waba-v2.360dialog.io/messages`

To send any type of message using the WhatsApp API, use the messages endpoint.&#x20;

{% content-ref url="../messaging-api/api-reference/messages" %}
[messages](https://docs.360dialog.com/docs/messaging-api/api-reference/messages)
{% endcontent-ref %}

## Message 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.&#x20;
  * 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:

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.<br>
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.

## 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.

{% content-ref url="webhook" %}
[webhook](https://docs.360dialog.com/docs/messaging/webhook)
{% endcontent-ref %}

## Typing indicators

When a message webhook indicates a message received, businesses can use the `message.id` value to mark the message as read and display a typing indicator. This lets the WhatsApp user know that a response is being prepared. Displaying a typing indicator is recommended when a response may take a few seconds to send. Read more about typing indicators:

{% content-ref url="overview/typing-indicators" %}
[typing-indicators](https://docs.360dialog.com/docs/messaging/overview/typing-indicators)
{% endcontent-ref %}

### Opt-In

Businesses are required to obtain opt-in before messaging people on WhatsApp. \
Read more about obtaining otp-in:

{% content-ref url="overview/opt-in" %}
[opt-in](https://docs.360dialog.com/docs/messaging/overview/opt-in)
{% endcontent-ref %}
