> For the complete documentation index, see [llms.txt](https://help.pickyassist.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.pickyassist.com/api-documentation-v2/whatsapp-template-api/template-request-api.md).

# Template Request API

Below is the Sample Template Request API Request & Response for requesting new WhatsApp Templates.

{% hint style="warning" %}
To use this API your project must be enabled with WhatsApp Business Account.
{% endhint %}

## Request URL

Method : **`POST`**

#### Requesting Templates

```
https://pickyassist.com/app/api/v2/template-request
```

#### Fetching Template Statuss&#x20;

```
https://pickyassist.com/app/api/v2/template-status
```

## Request URL (V4)

Method : **`POST`**

#### Requesting Templates

```
https://app.pickyassist.com/api/v2/template-request
```

#### Fetching Template Status&#x20;

```
https://app.pickyassist.com/api/v2/template-status
```

## Sample Request - Text Template

```javascript
{ 
   "token":"782a357a2c11f54b83fd1a017f05eb6794",
   "name":"order_confirmation",
    "application":121,
   "message_type":1,
   "category":2,
   "sample_message":["sample value of {{1}}","sample value of {{2}}","sample value of {{3}}"],
   "messages":[ 
      { 
         "message":"Your order {{1}} for a total of {{2}} is confirmed. The expected delivery is {{3}}.",
         "language":"en",
         "header":"test header Optional",
	 "footer":"test Optional"
      }
   ]
}
```

### Sample Response

{% hint style="warning" %}
You need to save the **"template\_id"** and should be used when sending WhatsApp Template Messages
{% endhint %}

```javascript
{ 
   "template_id":"XY6479",
   "template_status":1,
   "status":100,
   "message":"Success"
}
```

## Sample Request - Text Templates with Multiple Languages&#x20;

```javascript
{
  "token": "782a357a2c87687a11f54b83fd1a017f05eb6794",
  "name": "welcome",
  "message_type": 1,
  "application": 121,
  "category": 10,
  "sample_message": ["sample value of {{1}}"],
  "messages": [
    {
      "message": "Hello {{1}}, Welcome to Pickyassist",
      "language": "en",
      "header": "test header Optional",
      "footer": "test Optional"
    },
    {
      "message": "Bonjour {{1}}, Bienvenue chez Pickyassist",
      "language": "fr",
      "header": "test header Optional",
      "footer": "test Optional"
    }
  ]
}
```

## Sample Media Template Request - Image

```javascript
{ 
   "token":"782a357a2c87687a11f54b83fd1a017f05eb6794",
   "name":"welcome_message",
   "application":121,
   "message_type":2,
   "category":10,
   "sample_url":"https://pickyassist.com/en/img/product/telephony.png",
   "sample_message":["Diana"],
   "messages":[ 
      { 
         "message":"Hello {{1}}, Welcome to Picky Assist",
         "language":"en",
         "header":"Message from Picky Assist Team",
         "footer":"test Optional"
      }
   ]
}
```

## Sample Media Template Request - Image with Dynamic Header

{% hint style="info" %}
Kindly note that if you are passing dynamic header value then while sending the message you must pass the value of the dynamic variable, only one dynamic value is supported in the header
{% endhint %}

```json
{ 
   "token":"782a357a2c87687a11f54b83fd1a017f05eb6794",
   "name":"welcome_message",
   "application":121,
   "message_type":2,
   "category":10,
   "sample_url":"https://pickyassist.com/en/img/product/telephony.png",
   "sample_message":["Diana"],
   "sample_header":"Picky Assist",
   "messages":[ 
      { 
         "message":"Hello {{1}}, Welcome to Picky Assist",
         "language":"en",
         "header":"Message from {{1}}",
         "footer":"test Optional"
      }
   ]
}
```

## Sample Media Template Request - Document

```javascript
{
  "token": "782a357a2c87687a11f54b83fd1a017f05eb6794",
  "name": "welcome_message",
  "application": 121,
  "message_type": 2,
  "category": 10,
  "sample_url": "https://pickyassist.com/en/img/product/document.pdf",
  "sample_message": ["Diana"],
  "messages": [
    {
      "message": "Hello {{1}}, Please read the guidelines",
      "language": "en",
      "header": "ADMISSION Details",
      "footer": "test footer"
    }
  ]
}

```

## Sample Request - WhatsApp Interactive Button - Quick Replies with Text Message

{% hint style="info" %}
Please mind the template button position , the button will be shown to the user as per the order it's requested.

Once the template is approves it's not possible to change the order of the buttons.
{% endhint %}

```javascript
{
	"token": "{{token}}",
	"name": "TEMPLATE-NAME",
	"application":121,
	"message_type": 2,
	"category": 4,
	"sample_message":["{{1}}","{{2}}","{{3}}","{{4}}","{{5}}"],
	"messages": [
    	{
        	"message": "Hello {{1}}\\n\\nYour appointment for {{2}} with {{3}} is {{4}} on {{5}} Please confirm by clicking the below button\\n\\nThanks\\n{{6}}",
        	"language": "en",
        	"buttons": [
            	{
                	"type": 1,
                	"text": "Confirm"
            	},
            	{
                	"type": 1,
                	"text": "Cancel"
            	},
            	{
                	"type": 1,
                	"text": "Not Sure"
            	}
        	]
    	}
	]
}

```

### Template API Request - Interactive Buttons URL & Phone Number

```javascript
{
	"token": "{{token}}",
	"name": "delivery_out_button",
	"application":121,
	"message_type": 1,
	"category": 4,
	"sample_message":["Danny", "Burger XL"],
	"messages": [
    	{
        	"message": "Hello {{1}}\n\nYour order {{2}} is out for delivery.",
        	"language": "en",
        	"buttons": [
                {
                	"type": 2,
                	"text": "Track Package ",
                	"url": "https://bridgerbot.com/app/api/wa/buttons/{{1}}}",
                        "sample_button_value":"EA454FFGQ21"
            	},
                {
                	"type": 3,
                	"text": "Call Support",
                	"phone_number": "+13026445173"
            	}
            	
                
        	]
    	}
	]
}

```

### Template API Request - Interactive Buttons - URL

{% hint style="info" %}
Only one dynamic variable is allowed and its should be at the end of the URL and from April 19th 2022 onwards dynamic variable is optional

**Not possible to change the URL once its approved**
{% endhint %}

```javascript
{
	"token": "{{token}}",
	"name": "order_shipped_button",
	"application":121,
	"message_type": 2,
	"category": 4,
	"sample_message":["{{1}}","{{2}}","{{3}}","{{4}}","{{5}}","{{6}}"],
	"messages": [
    	{
        	"message": "Hello {{1}}\n\nYour order {{2}} has been shipped through {{3}} on {{4}} and tracking number is {{5}}.\n\nThanks\n{{6}}",
        	"language": "en",
        	"buttons": [
            	{
                	"type": 2,
                	"text": "Track Order",
                	"url": "https://pickyassist.com/t/{{1}]",
                "sample_button_value":"EA454FFGQ21"
            	}
        	]
    	}
	]
}

```

## Sample Request - Add New Language

You can add new language to an existing template by passing the template id along with new language contents, **please note there is no option to edit an existing template.**

{% hint style="info" %}
**Please note if you have passed header and footer for the primary template then you must pass the same for all languages**&#x20;
{% endhint %}

```javascript
{
    "token": "768b6b220c702c77225236",
    "template_id": "PV10560",
    "application":121,
    "message": "Ciao {{1}}, \n\nIl tuo ordine {{2}} è stato annullato {{3}}\n\nGrazie\n{{4}}",
    "language": "it"
    "header": "header optional",
    "footer": "footer optional"
}
```

### Sample Response

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

## Catalog Template

{% hint style="info" %}
Footer - optional parameter. All others are required\
Catalog is available only for marketing category \[category id 13]
{% endhint %}

```javascript
{ 
   "token":""{{token}}",
   "name":"welcome_message",
   "application":121,
    "category":13,
   "sample_message":["Diana"],
   “template_type”:”CATALOG”,
   “template_sub_type”:”CATALOG”,
   "messages":[ 
      { 
         "message":"Hello {{1}}, Welcome to Picky Assist",
         "language":"en",
          "footer":"test Optional"
      }
   ]
}

```

## Multi Product Messsage (MPM)

```javascript
{ 
   "token":""{{token}}",
   "name":"abandoned_cart",
   "application":121,
   "category":13,
   "sample_message":["10OFF"],
  "sample_header":"Picky",
   “template_type”:”CATALOG”,
   “template_sub_type”:”MPM”,
   "messages":[ 
      { 
         "message":"Forget something, {{1}}?",
         "Language":"en",
         "header": "Looks like you left these items in your cart, still interested? Use code {{1}} to get 10% off!",
          "footer":"test Optional"
      }
   ]
}

```

{% hint style="info" %}

* Message and header are mandatory
* Footer is optional
* MPM is available only for marketing category \[category id - 13]
  {% endhint %}

## Media Carousel

It is necessary to define the exact number of product cards (minimum 2 and maximum 10) upon template creation. An approved template can only be used to send the same number of cards as defined during its creation. If any card in the carousel includes a card body text, then all cards must include a card body text to ensure consistent card heights.

{% hint style="info" %}
It is necessary to define the exact number of product cards (minimum 2 and maximum 10) upon template creation. An approved template can only be used to send the same number of cards as defined during its creation. If any card in the carousel includes a card body text, then all cards must include a card body text to ensure consistent card heights.
{% endhint %}

```javascript
{ 
   "token":""{{token}}",
   "name":"welcome_message",
   "application":121,
    "category":13,
   "sample_message":["Diana"],
   “template_type”:”CAROUSEL",
    "sample_url":"https://pickyassist.com/en/img/product/telephony.png",
    "messages":[ 
      { 
         "message":"Hello {{1}}, Welcome to Picky Assist",
         "language":"en",
          
  "cards": [
    [	
      {
        "type": "header",
        "format": "image"
        }
      },
      {
        "type": "body",
        "text": "card body67 {{1}} ",
        "example": {"c1" }
      },
      {
        "type": "buttons",
        "buttons": [
          {
            "type": 1,
            "text": "yes"
          },
          {
            "type": 2,
            "text": "view website",
            "url": "https://app.pickyassist.com/dashboard/{{1}}",
            "sample_button_value": "test"
          }
        ]
      }
    ],
    [
      {
        "type": "header",
        "format": "image"        
     }
      },
      {
        "type": "body",
        "text": "card 2 {{1}} ",
        "example": {"c2"}
      },
      {
        "type": "buttons",
        "buttons": [
          {
            "type": 1,
            "text": "yes"
          },
          {
            "type": 2,
            "text": "view website",
            "url": "https://app.pickyassist.com/{{1}}",
            "sample_button_value": "dfsdaf"
          }
        ]
      }
    ]
  ]


      }
   ]
}
```

{% hint style="info" %}

* Cards - minimum 2 & maximum 10
* Only one media url need to be send as a sample url
* Supported header types : image / video
* Maximum 2 buttons are supported and Button combinations can be a mix of quick reply buttons, phone number buttons, and URL buttons.
* Carousel is available only for marketing category \[category id 13]<br>
  {% endhint %}

## Product Carousel

Carousel templates support up to 10 product cards, composed of message body text, a product image, product title, product price, and a single View button or URL button. All cards defined on a template must have the same components.

It is only necessary to define two product cards upon template creation. An approved template with two product cards can be used to send up to 10 cards in a template message.

```javascript
{ 
   "token":""{{token}}",
   "name":"welcome_message",
   "application":121,
    "category":13,
   "sample_message":["Diana"],
   “template_type”:”PRODUCT_CAROUSEL”,
    "sample_url":"https://pickyassist.com/en/img/product/telephony.png",
    "messages":[ 
      { 
         "message":"Hello {{1}}, Welcome to Picky Assist",
         "language":"en",
          
  "cards": [
[
{
"type":"header", 
"format":"product"
},
{
"type":"buttons",
"buttons": [{"type":"8","text":"View"}]
}
],
	[
{
"type":"header", 
"format":"product"
},
{
"type":"buttons",
"buttons": [{"type":"8","text":"View"}]
}
]
]

      }
   ]
}
```

{% hint style="info" %}

* Only one button is supported with each card and the button can be a ‘View’ button, or a url button.
* Carousel is available only for marketing category \[category id 13]
  {% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.pickyassist.com/api-documentation-v2/whatsapp-template-api/template-request-api.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
