# Sending WhatsApp Template Text Messages

This API allows you to send WhatsApp Messages after 24 hours window. You can make use of this API to send Bulk Personalised Messages by passing the dynamic variables in multi dimensional array.

{% hint style="info" %}
**Example**\
\
Your order `{{1}}` for a total of `{{2}`} is confirmed. The expected delivery is `{{3}}`

In order to send the above message you need to pass only the exact value of {{1}}, {{2}}. {{3}} in the **"template\_globalmessage" or "template\_message"** variable as array and WhatsApp will construct the message with the value you passed and sends the message.\
\
&#x20;*i.e you dont need to pass the entire message body or structure in order to send a template message.*
{% endhint %}

## Sending WhatsApp Template Text Messages

<mark style="color:green;">`POST`</mark> `https://pickyassist.com/app/api/v2/push`

### Request URL (V4)

Method : **`POST`**

```
https://app.pickyassist.com/api/v2/push
```

#### Request Body

| Name                    | Type   | Description                                                                                                                                                                                                                                                                                                                                 |
| ----------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| token                   | string | Your API Token for Authentication                                                                                                                                                                                                                                                                                                           |
| application             | number | <p>8 = WhatsApp Official Account</p><p>121 = WhatsApp Official Managed<br>101 = WhatsApp Cloud API<br><br><strong>If you have connected multiple channels or using WhatsApp Cloud api then please get the channel id from your project under Settings -></strong> <a href="https://pickyassist.com/app/settings/channels">Channels </a></p> |
| template\_id            | string | Template ID of the approved template                                                                                                                                                                                                                                                                                                        |
| template\_globalmessage | array  | <p>You need to pass only the dynamic variable value in array "template\_message"<br><br><strong>Don't pass your entire message structure here</strong></p>                                                                                                                                                                                  |
| language                | string | Pass the language of the template message, by passing multiple languages you able to send same message in different languages                                                                                                                                                                                                               |
| globalmedia             | string | URL from we need to fetch the media , if specified this media will be send to all users.                                                                                                                                                                                                                                                    |
| template\_header        | string | Header applicable only for sending documents (only pdf supports now) Maximum 60 Characters                                                                                                                                                                                                                                                  |
| data                    | array  | This is a multi dimensional array through which used to send personalised bulk messages using single API request                                                                                                                                                                                                                            |
| number                  | number | WhatsApp Mobile Number with country code without 0 or + prefix                                                                                                                                                                                                                                                                              |
| template\_message       | array  | <p>This is an array through which you need to pass the value of the dynamic variable in your template.<br><br><strong>Please note you only need to pass the value of the dynamic variable as per the order its approved.</strong></p>                                                                                                       |
| language                | string | Pass the language of the template message                                                                                                                                                                                                                                                                                                   |
| media                   | string | You can pass media url if you want to send dynamic media to each number, if the media is static then we highly recommend to pass the URL via "globalmedia" variable                                                                                                                                                                         |
| template\_header        | string | Header is currently applicable only for documents (currently only PDF) , you can pass customised PDF name as header and maximum character limit is 60.                                                                                                                                                                                      |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "status": 100,
  "push_id": "34",
  "message": "Success"
}
```

{% endtab %}
{% endtabs %}

## Sample Request Body JSON for Sending Personalised Text Message

```javascript
{ 
   "token":"782a357a2c87687a11f54b83fd1a017f05eb6794",
   "application":8,
   "template_id":"VG7935",
   "data":[ 
      { 
         "number":"919444444444",
         "template_message":[ 
            "abc",
            "111",
            "222",
            "333",
            "Picky"
         ],
         "language":"en"
      },
      { 
         "number":"1439900889900",
         "template_message":[ 
            "xyz",
            "101",
            "202",
            "303",
            "Picky"
         ],
         "language":"en"
      }
   ]
}
```

## Sample Request Body JSON for Sending Personalised Text Message with Dynamic Header

Please note this is applicable only if you have requested the template with Dynamic header, it's possible to pass the dynamic variable value globally or dynamically for each mobile number, below is the example of passing template header value globally i.e same for all messages.

```javascript
{ 
   "token":"782a357a2c87687a11f54b83fd1a017f05eb6794",
   "application":8,
   "template_id":"VG7935",
   "template_header":["123"],
   "data":[ 
      { 
         "number":"919444444444",
         "template_message":[ 
            "abc",
            "111",
            "222",
            "333",
            "Picky"
         ],
         "language":"en"
      },
      { 
         "number":"1439900889900",
         "template_message":[ 
            "xyz",
            "101",
            "202",
            "303",
            "Picky"
         ],
         "language":"en"
      }
   ]
}
```

{% hint style="success" %}
**Sending message with dynamic header for each mobile number , below method helps you to pass header dynamic variable differently for each mobile number**&#x20;
{% endhint %}

```json
{ 
   "token":"782a357a2c87687a11f54b83fd1a017f05eb6794",
   "application":8,
   "template_id":"VG7935",
   "data":[ 
      { 
         "number":"919444444444",
         "template_header":["123"],
         "template_message":[ 
            "abc",
            "111",
            "222",
            "333",
            "Picky"
         ],
         "language":"en"
      },
      { 
         "number":"1439900889900",
         "template_header":["123"],
         "template_message":[ 
            "xyz",
            "101",
            "202",
            "303",
            "Picky"
         ],
         "language":"en"
      }
   ]
}
```

## Sample Request Body JSON for Sending Bulk Text Message

```javascript
{ 
   "token":"782a357a2c87687a11f54b83fd1a017f05eb6794",
   "application":8,
   "template_id":"VG7935",
   "template_globalmessage":[ 
            "abc",
            "111",
            "222",
            "333",
            "Picky"
         ],
   "language":"en",
   "data": [
        {
            "number": "93432434343"
        },
        {
            "number": "13374125202"
        }
    ]
}
```

## Sample Response

```javascript
{
  "status": 100,
  "push_id": "34",
  "message": "Success"
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.pickyassist.com/api-documentation-v2/push-api/sending-whatsapp-template-messages/sending-whatsapp-template-text-messages.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
