# Send WhatsApp message templates

You can send WhatsApp message templates directly from Chat Flow using the [Send Template](https://guides.clickatell.com/flow/action-nodes/send-template) node. You can use this node in any of your workflows, but it is typically used in [dynamic API flows ](https://guides.clickatell.com/flow/workflow-management/create-new-flow/add-a-workflow)to initiate WhatsApp conversations with customers.&#x20;

{% hint style="success" %}
These WhatsApp template types are supported:

* Plain text templates.
* [Interactive templates with buttons](https://clickatell.gitbook.io/whatsapp-user-guide/channel-capabilities/whatsapp-message-templates/use-interactive-buttons-in-message-templates).
* [Media templates](https://guides.clickatell.com/whatsapp-channel/channel-capabilities/whatsapp-message-templates/use-media-in-message-templates).
  {% endhint %}

## **How to send WhatsApp message templates in Chat Flow**

Clickatell assists you in building out a **dynamic API workflow**. This workflow is not user-facing and gets triggered by an incoming payload. It allows you to initiate engagement with your customers by sending a pre-approved WhatsApp template (using the [*Send Template*](https://guides.clickatell.com/flow/action-nodes/send-template) node), prompting them to take action and trigger a standard workflow.

<figure><img src="https://content.gitbook.com/content/joAgInTNsBfDdfx1I23z/blobs/EvBGiSVs1k94hQBOqMla/image.png" alt=""><figcaption></figcaption></figure>

## Alternative method

You can also send WhatsApp message templates using the [*API Integration* node](https://guides.clickatell.com/flow/action-nodes/action-nodes-api-integration). This is a more technical and roundabout way of sending templates, and therefore we recommend using the method [above](#how-to-send-whatsapp-message-templates-in-chat-flow).

{% hint style="success" %}
These WhatsApp template types are supported:

* Plain text template.
* [Interactive template with buttons](https://clickatell.gitbook.io/whatsapp-user-guide/channel-capabilities/whatsapp-message-templates/use-interactive-buttons-in-message-templates).
  {% endhint %}

### Message template configuration

To configure the API integration for message templates:

1. In the *Configuration* section of the navigation, click *API Integration -> + N*ew *API*.

<figure><img src="https://content.gitbook.com/content/joAgInTNsBfDdfx1I23z/blobs/4MMLkt7ya4WviPGHHzae/API%20Int1.png" alt=""><figcaption></figcaption></figure>

2. Complete the fields to [set up an API integration](https://guides.clickatell.com/flow/configuration/api-integration):
   * Add a *Name* for your endpoint.
   * Enter the following *URL*: <https://platform.clickatell.com/v1/message>
   * Add the *Element Validation*, for example: HTTP\_Response\_Code.
   * Select "POST" as the *Method,* and *"*&#x61;pplication/json" as both the *Request Content-Type* and *Response Content-Type*.
   * Enter "Authorization" as the header *Key* (i.e., the API key for your integration that can be found by navigating to *My Workspaces ->API Integrations* in the Clickatell Portal), then enter the associated *Value*.

<figure><img src="https://content.gitbook.com/content/joAgInTNsBfDdfx1I23z/blobs/PQV822KU6dpWH819XiZZ/API%20integration%20plain%20text.png" alt=""><figcaption></figcaption></figure>

3. Save your changes.

{% hint style="info" %}
Once configured, your API integration will be available for selection from the *Name* drop-down when [adding an API Integration node](https://guides.clickatell.com/flow/action-nodes/action-nodes-api-integration).&#x20;
{% endhint %}

### API Integration node configuration

The images below show what the configuration of the *API Integration* node should look like for plain text and interactive templates.

#### **Plain text template**

<figure><img src="https://content.gitbook.com/content/joAgInTNsBfDdfx1I23z/blobs/6Rtj2RsuiKBMtTTDmCEZ/API%20int%203.png" alt=""><figcaption></figcaption></figure>

#### Plain text template body&#x20;

```json
{
  "messages": [
    {
      "to": "2799900001",
      "channel": "whatsapp",
      "template": {
        "templateName": "welcome_notification_demo",
        "body": {
          "parameters": {
            "1": "Parameter 1",
            "2": "Parameter 2"
          }
        }
      }
    }
  ]
}
```

#### Interactive template

<figure><img src="https://content.gitbook.com/content/joAgInTNsBfDdfx1I23z/blobs/9OEse9xSa1nFQiKppxFv/API%20int%204.png" alt=""><figcaption></figcaption></figure>

#### Interactive template body

```json
{
  "messages": [
    {
      "to": "2710000000",
      "channel": "whatsapp",
      "template": {
        "templateName": "welcome_text_button",
        "body": {
          "parameters": {
            "1": "Keanan"
          }
        },
        "buttons": {
          "suggestedResponse": {
              "postbackData": {
                "1": "{\"buttonPressed\":\"menu\"}"
              }
            }
        }
      }
    }
  ]
}
```

{% hint style="info" %}
When using interactive templates, remember to [**add the correct keyword**](https://guides.clickatell.com/flow/configuration/using-keywords) in the *Keywords* section. The keyword must be the same as the button shown on the interactive template, e.g., "buttonPressed":"menu".
{% endhint %}

### Workflow example

The example below displays a workflow in which:

1. The *Text Display* node is used to display a welcome message to the customer.&#x20;
2. An API call is then made to send the WhatsApp message template to the customer.
3. In response to the call, another *Text Display* node is used to inform the customer that the template was sent successfully.

<figure><img src="https://content.gitbook.com/content/joAgInTNsBfDdfx1I23z/blobs/vPxoxIC2l0sr0oKLGbkV/API%20int5.png" alt=""><figcaption></figcaption></figure>
