# Template Status API

This API enables you to Fetch WhatsApp Templates & it's Status

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

## Template Status API

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

This API allows you to get the status of WhatsApp template

## Request URL (V4)

Method : **`POST`**

#### Requesting Templates

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

#### Fetching Template Statuss&#x20;

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

#### Request Body

| Name         | Type   | Description                                                                                                           |
| ------------ | ------ | --------------------------------------------------------------------------------------------------------------------- |
| token        | string | Your API Token                                                                                                        |
| template\_id | string | Pass the template Id you have to query the status, if you pass blank then it will fetch all templates in your project |

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

```javascript
{ 
   "template_id":"YG7203",
   "template_name":"welcome_message",
   "template_status":"1",
   "message_type":"2",
   "category":"10",
   "footer":"test footer",
   "template_message":[ 
      { 
         "message":"Hello {{1}}, Welcome to Pickyassist",
         "language":"en"
      }
   ],
   "status":100,
   "message":"Success"
}
```

{% endtab %}
{% endtabs %}

## Response Variables&#x20;

| Variable          | Description                                                                                                                                                                                                                                                                                                                                                           |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| template\_id      | Alpha numeric unique template id , this template id need to pass when sending templated messages                                                                                                                                                                                                                                                                      |
| template\_status  | <p>Status of the Templates, </p><p></p><p>1 = Pending Review </p><p>2 = WA Pending Review</p><p>3 = Approved</p><p>4 = Rejected</p>                                                                                                                                                                                                                                   |
| category          | <p>Category of the template</p><p></p><p>1 = ACCOUNT\_UPDATE </p><p>2 = PAYMENT\_UPDATE </p><p>3 = PERSONAL\_FINANCE\_UPDATE </p><p>4 = SHIPPING\_UPDATE </p><p>5 = RESERVATION\_UPDATE </p><p>6 = ISSUE\_RESOLUTION </p><p>7 = APPOINTMENT\_UPDATE </p><p>8 = TRANSPORTATION\_UPDATE </p><p>9 = TICKET\_UPDATE </p><p>10 = ALERT\_UPDATE </p><p>11 = AUTO\_REPLY</p> |
| message\_type     | <p>Message type</p><p>1 = Text </p><p>2 = Image (.jpg, .jpeg, .png) </p><p>3 = Document (.pdf)</p>                                                                                                                                                                                                                                                                    |
| header            | Header text of the template only applicable for document templates                                                                                                                                                                                                                                                                                                    |
| footer            | Footer of the template only applicable for media templates                                                                                                                                                                                                                                                                                                            |
| template\_name    | Name of the template you requested                                                                                                                                                                                                                                                                                                                                    |
| templates         | This is an array presents only if you are not passing the template id                                                                                                                                                                                                                                                                                                 |
| template\_message | <p>This is an array which gives template message and language </p><p><br>message = template message<br>language = language of the template</p><p></p>                                                                                                                                                                                                                 |
| status            | <p><strong>100=>’Success’,</strong><br>401=>Authentication Failed<br>801=>Official WhatsApp Account Not Active<br>405=>API Is Not Active For This Plan<br>804=>Invalid Template ID</p><p>817=>No Templates Found</p><p></p><p><a href="../references/status-and-error-codes">Refer Complete Status & Error Code Here</a></p>                                          |
| message           | Detailed Status Message (description of any error message)                                                                                                                                                                                                                                                                                                            |

## Sample Request - With Template ID

```javascript
{ 
   "token":"782a357a2c87654b83fd1a017f05eb6794",
   "template_id":"YG7203"
}
```

### Sample Response

```javascript
{ 
   "template_id":"YG7203",
   "template_name":"welcome_message",
   "template_status":"1",
   "message_type":"2",
   "category":"10",
   "footer":"test footer",
   "template_message":[ 
      { 
         "message":"Hello {{1}}, Welcome to Pickyassist",
         "language":"en"
      }
   ],
   "status":100,
   "message":"Success"
}
```

## Sample Request - Listing All Templates&#x20;

```javascript
{ 
   "token":"782a357a2c876874b83fd1a017f05eb6794"
}
```

### Sample Response

```javascript
{ 
   "status":100,
   "message":"Success",
   "templates":[ 
      { 
         "template_id":"WY5408",
         "template_name":"order_delivery",
         "template_status":"2",
         "message_type":"3",
         "category":"2",
         "header":"Order_Summary",
         "footer":"test footer",
         "template_message":[ 
            { 
               "message":"Your order {{1}} for a total of {{2}} is confirmed. The expected delivery is {{3}}.",
               "language":"en"
            }
         ]
      },
      { 
         "template_id":"PG6840",
         "template_name":"welcome",
         "template_status":"1",
         "message_type":"2",
         "category":"10",
         "footer":"test footer",
         "template_message":[ 
            { 
               "message":"Hello {{1}}, Welcome to Pickyassist",
               "language":"en"
            },
            { 
               "message":"Bonjour {{1}}, Bienvenue chez Pickyassist",
               "language":"fr"
            }
         ]
      }
   ]
}
```
