# Template message - document

## Send WhatsApp Message API

<mark style="color:green;">`POST`</mark> `http://api.koreroplatforms.com/v1/whatsapp/send`

#### Headers

| Name     | Type   | Description |
| -------- | ------ | ----------- |
| api\_key | string | API Key     |

#### Request Body

| Name            | Type   | Description                                           |
| --------------- | ------ | ----------------------------------------------------- |
| from            | string | The WhatsApp number associated with your WABA account |
| to              | string | Recipient mobile number                               |
| type            | string | pass value as 'template'                              |
| template        | object |                                                       |
| template\_id    | string | The template ID provided on the user panel            |
| header          | string | The object to pass the document information           |
| type            | string | pass value as 'document'                              |
| document        | object |                                                       |
| accessory\_url  | string | Pass the URL which hosts the document file            |
| filename        | string | The name of the file to be displayed to the recipient |
| body            | object |                                                       |
| type            | string | pass value as 'text'                                  |
| personalization | string | The array of personalized values                      |

{% tabs %}
{% tab title="200 Cake successfully retrieved." %}

```
{
    "timestamp": "2021-05-19T11:01:22.0Z",
    "status": "success",
    "request_id": "5ef1eda4-9cd1-42d2-bf3f-4661e4e6f7bc",
    "recipients": [
        {
            "to": "919699112120",
            "message_id": "WA162140228225012"
        }
    ]
}
```

{% endtab %}

{% tab title="404 " %}

```
{
    "timestamp": "2021-05-19T11:14:12.571Z",
    "status": "failed",
    "request_id": "834d2c4e-a74c-4e82-94d1-cc5bc3a7b822",
    "errors": [
        {
            "description": "invalid template_id"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

### Sample Request Body

```
{
    "from": "919311815518",
    "to": "919699112120",
    "type": "template",
    "template": {
        "template_id": "201077",
        "header": {
            "type": "document",
            "document": {
                "accessory_url": "https://www.dbs.com/in/iwov-resources/pdf/forms-and-legal/form-15g.pdf",
                "filename":"form_15",
                "caption":"kingson"
            }
        },
        "body": {
            "type": "text",
            "personalization": ["Nitin"]
        }
    }
}

```


---

# 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://api.koreroplatforms.io/channel-api/whatsapp-api/two-way-whatsapp-message-api.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.
