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

# Template (Asynchronous)

## Create template

**Request API address**

```
POST    https://api.innopaas.com/api/whatsapp/v3/template/submit
```

#### &#x20;**Request parameters**

<table data-header-hidden><thead><tr><th width="243.87109375"></th><th width="111.06640625"></th><th width="70.15234375"></th><th width="342.91796875"></th></tr></thead><tbody><tr><td>Field</td><td>Data type</td><td>Required</td><td>Description</td></tr><tr><td>wabaId</td><td>String</td><td>Yes</td><td>Unique identifier of the WhatsApp business account</td></tr><tr><td>name</td><td>String</td><td>Yes</td><td>Template name: (eg:limited_time_offer_tuscan_getaway_2023) composed of lowercase letters, numbers, and underscores, field limit is 512 characters.</td></tr><tr><td>category</td><td>String</td><td>Yes</td><td>Template type: 1-MARKETING,2-AUTHENTICATION,3-UTILITY</td></tr><tr><td>messageLanguage</td><td>String</td><td>Yes</td><td>Template-supported language, (<strong>Language abbreviation code needs to be passed</strong>)Please refer to Appendix 1</td></tr><tr><td>headerType</td><td>Integer</td><td>Yes</td><td>Whether multimedia is supported, default 1, 1:None, 2:Text, 3:Image, 4:Video, 5:Document</td></tr><tr><td>caption</td><td>String</td><td>No</td><td><strong>Header content:</strong>Field limited to characters (for multimedia templates, this field is empty), dynamic parameter format {{1}}</td></tr><tr><td>messageBody</td><td>String</td><td>No</td><td><strong>Body content:</strong>Field limited to 1024 characters. Dynamic parameter format {{1}}{{2}}, inserted in order from front to back</td></tr><tr><td>footer</td><td>String</td><td>No</td><td><strong>Footer content:</strong>Field limited to 60 characters (for AUTHENTICATION templates, this field indicates the expiration time, optional, expiration time limited to within 90 minutes)</td></tr><tr><td>safetyAdvice</td><td>Integer</td><td>No</td><td>Whether to add safety advice to the AUTHENTICATION template (0: do not add, 1: add), optional. If not added, display: *{{1}}* is your verification code. After adding, display: *{{1}}* is your verification code. For safety, please do not share this verification code.</td></tr><tr><td>buttons</td><td>Object[]</td><td>No</td><td>The total number of buttons does not exceed 10</td></tr><tr><td>├─actionType<br></td><td>String</td><td><br></td><td>Button type 1-quick reply,2-visit website,3-call phone number,4-copy code(category is 2),5-auto fill (category is 2)</td></tr><tr><td>├─label</td><td>String</td><td><br></td><td>Button text</td></tr><tr><td>├─ phoneArea</td><td>String</td><td><br></td><td>Phone area code (eg:86)</td></tr><tr><td>├─ phone</td><td>String</td><td><br></td><td>Phone number (eg:18877776666)</td></tr><tr><td>├─packageName</td><td>String</td><td><br></td><td><strong>Application package name</strong><br>Template type is:AUTHENTICATION,<br><mark style="color:$danger;">actionType=5</mark> Required when</td></tr><tr><td>├─sigNatureHash</td><td>String</td><td><br></td><td><strong>Application hash</strong><br>Template type is:AUTHENTICATION,<br><mark style="color:$danger;">actionType=5</mark>Required when</td></tr><tr><td>├─ autoFill</td><td>String</td><td><br></td><td><strong>Auto fill</strong><br>Template type is:AUTHENTICATION,<br><mark style="color:$danger;">actionType=5</mark>Required when</td></tr><tr><td>├─ zeroTapTermsAccepted</td><td>boolean</td><td></td><td><strong>Accept fill terms</strong><br>Template type is:AUTHENTICATION,<br><mark style="color:$danger;">actionType=5</mark>Required when<code>true</code></td></tr><tr><td>├─ targetUrl</td><td>String</td><td><br></td><td>Website URL access (eg："<a href="https://www.chuanglan.com/">https://www.chuanglan.com/</a>{{1}}") only supports one dynamic parameter, format {{1}}</td></tr><tr><td>├─buttonExample</td><td>Array</td><td><br></td><td>Button variable example (eg："buttonExample": ["<a href="https://www.chuanglan.com/whatsApp">https://www.chuanglan.com/whatsApp</a>"]) required when the URL contains variables; the variable content must be a complete URL</td></tr><tr><td>headerExample</td><td>Objec</td><td>No</td><td><br></td></tr><tr><td>├─ header_handle</td><td>Array</td><td><br></td><td>Multimedia template variable (eg："header_handle": ["4::axxxx"]) For multimedia templates, fill in the handle returned when the file is uploaded</td></tr><tr><td>├─ header_link</td><td>String</td><td></td><td>Resource address URL, must be accessible from the external network,<mark style="color:$danger;">Choose one of header_link and header_handle; when header_link is not empty, header_handle will be replaced</mark></td></tr><tr><td>├─ header_text</td><td>Array</td><td><br></td><td>Plain text template variable (eg："header_text": ["创蓝云智"]) Text dynamic parameter template variable, the number of dynamic parameters is limited to 1</td></tr><tr><td>bodyExample</td><td>Object</td><td>No</td><td><br></td></tr><tr><td>├─ body_text</td><td>Array</td><td><br></td><td>body variable (eg: "body_text":[["variable1","variable2"]]) The example variables correspond to the variables in order, variable {{1}} corresponds to variable1, and so on</td></tr></tbody></table>

#### **Request example**

```json
{
    "name": "transland_marketing_promotion_6",
    "category": "1",
    "messageLanguage": "zh_CN",
    "headerType":2,
    "caption": "Transland API Account {{1}} Opened",
    "messageBody": "Dear customer {{1}}，your SMS API account {{2}} is avaliable, please rember the secret of this account. The secret is sent via email.",
    "footer": "Have a nice sms experience.",
    "buttonType":2,
    "headerExample": {
        "header_text": [
            "II2024089"
        ]
    },
    "bodyExample": {
        "body_text": [
            [
                "Tom",
                "II2024089"
            ]
        ]
    },
    "wabaId": "121009624329108",
    "buttons": [
        {
            "actionType": 1,
            "label": "Call Us",
            "phone": "+8615121041046"
        },
        {
            "actionType": 2,
            "label": "Websit",
            "targetUrl": "https://www.chuanglan.com/{{1}}",
            "buttonExample": [
                "https://www.chuanglan.com/document"
            ]
        }
    ]
}
```

#### **Response example**

```json

{
    "code": "0",
    "message": "Success",
    "data": "1399631517488334"
}
```

## Update template

#### **Request API address**

```
POST     https://api.innopaas.com/api/whatsapp/v3/template/update
```

#### **Request parameters**

<table data-header-hidden><thead><tr><th width="167.71484375"></th><th width="118.70703125"></th><th width="91.27734375"></th><th></th></tr></thead><tbody><tr><td>Field</td><td>Data type</td><td>Required</td><td>Description</td></tr><tr><td>templateId</td><td>String</td><td>Yes</td><td>Template ID</td></tr><tr><td>wabaId</td><td>String</td><td><del>Yes</del></td><td>Unique identifier of the WhatsApp business account</td></tr><tr><td>name</td><td>String</td><td>Yes</td><td>Template name: (eg:limited_time_offer_tuscan_getaway_2023) composed of lowercase letters, numbers, and underscores, field limit is 512 characters.</td></tr><tr><td>category</td><td>String</td><td>Yes</td><td>Template type: 1-MARKETING,2-AUTHENTICATION,3-UTILITY</td></tr><tr><td>messageLanguage</td><td>String</td><td>Yes</td><td>Template-supported language:(<strong>Language abbreviation code needs to be passed</strong>)Please refer to Appendix 1</td></tr><tr><td>headerType</td><td>Integer</td><td>Yes</td><td>Whether multimedia is supported, default 1, 1:None, 2:Text, 3:Image, 4:Video, 5:Document</td></tr><tr><td>caption</td><td>String</td><td>No</td><td><strong>Header content:</strong>Field limited to characters (for multimedia templates, this field is empty), dynamic parameter format {{1}}</td></tr><tr><td>messageBody</td><td>String</td><td>No</td><td><strong>Body content:</strong>Field limited to 1024 characters. Dynamic parameter format {{1}}{{2}}, inserted in order from front to back</td></tr><tr><td>footer</td><td>String</td><td>No</td><td><strong>Footer content:</strong>Field limited to 60 characters (for AUTHENTICATION templates, this field indicates the expiration time, optional, expiration time limited to within 90 minutes)</td></tr><tr><td>safetyAdvice</td><td>Integer</td><td>No</td><td>Whether to add safety advice to the AUTHENTICATION template (0: do not add, 1: add), optional. If not added, display: *{{1}}* is your verification code. After adding, display: *{{1}}* is your verification code. For safety, please do not share this verification code.</td></tr><tr><td>buttons</td><td>Object[]</td><td>No</td><td>The total number of buttons does not exceed 10</td></tr><tr><td>├─actionType</td><td>String</td><td><br></td><td>Button type 1-quick reply,2-visit website,3-call phone number,4-copy code(category is 2),5-auto fill (category is 2)</td></tr><tr><td>├─label</td><td>String</td><td><br></td><td>Button text</td></tr><tr><td>├─ phoneArea</td><td>String</td><td><br></td><td>Phone area code (eg:86)</td></tr><tr><td>├─ phone</td><td>String</td><td><br></td><td>Phone number (eg:18877776666)</td></tr><tr><td>├─packageName</td><td>String</td><td><br></td><td><strong>Application package name,</strong>Template type is AUTHENTICATION, optional</td></tr><tr><td>├─signatureHash</td><td>String</td><td><br></td><td><strong>Application hash,</strong>Template type is AUTHENTICATION, optional</td></tr><tr><td>├─ autoFill</td><td>String</td><td><br></td><td><strong>Auto fill,</strong>Template type is AUTHENTICATION, optional</td></tr><tr><td>├─ targetUrl</td><td>String</td><td><br></td><td>Website URL access (eg："<a href="https://www.chuanglan.com/">https://www.chuanglan.com/</a>{{1}}") only supports one dynamic parameter, format {{1}}</td></tr><tr><td>├─buttonExample</td><td>Array</td><td><br></td><td>Button variable example (eg："buttonExample": ["<a href="https://www.chuanglan.com/whatsApp">https://www.chuanglan.com/whatsApp</a>"]) required when the URL contains variables; the variable content must be a complete URL</td></tr><tr><td>headerExample</td><td>Object[]</td><td>No</td><td><br></td></tr><tr><td>├─ header_handle</td><td>Array</td><td><br></td><td>Multimedia template variable (eg："header_handle": ["4::axxxx"]) For multimedia templates, fill in the handle returned when the file is uploaded</td></tr><tr><td>├─ header_link</td><td>String</td><td></td><td>Resource address URL, must be accessible from the external network,<mark style="color:$danger;">Choose one of header_link and header_handle; when header_link is not empty, header_handle will be replaced</mark></td></tr><tr><td>├─ header_text</td><td>Array</td><td><br></td><td>Plain text template variable (eg："header_text": ["创蓝云智"]) Text dynamic parameter template variable, the number of dynamic parameters is limited to 1</td></tr><tr><td>bodyExample</td><td>Object[]</td><td>No</td><td><br></td></tr><tr><td>├─ body_text</td><td>Array</td><td><br></td><td>body variable (eg: "body_text":[["variable1","variable2"]]) The example variables correspond to the variables in order, variable {{1}} corresponds to variable1, and so on</td></tr></tbody></table>

#### **Request example**

```json

{   "templateId":"123123123123213",
    "name": "transland_marketing_promotion_6",
    "category": "1",
    "messageLanguage": "zh_CN",
    "headerType":2,
    "caption": "Transland API Account {{1}} Opened",
    "messageBody": "Dear customer {{1}}，your SMS API account {{2}} is avaliable, please rember the secret of this account. The secret is sent via email.",
    "footer": "Have a nice sms experience.",
    "buttonType":2,
    "headerExample": {
        "header_text": [
            "II2024089"
        ]
    },
    "bodyExample": {
        "body_text": [
            [
                "Tom",
                "II2024089"
            ]
        ]
    },
    "wabaId": "121009624329108",
    "buttons": [
        {
            "actionType": 1,
            "label": "Call Us",
            "phone": "+8615121041046"
        },
        {
            "actionType": 2,
            "label": "Websit",
            "targetUrl": "https://www.chuanglan.com/{{1}}",
            "buttonExample": [
                "https://www.chuanglan.com/document"
            ]
        }
    ]
}
```

#### **Response example**

```json

{
    "code": "0",
    "message": "Success",
    "data": "1399631517488334"
}
```

## Template list

#### **Request API address**

```
POST    https://api.innopaas.com/api/whatsapp/v3/template/list
```

#### Request parameters

| Field           | Data type | Required | Description                                                               |
| --------------- | --------- | -------- | ------------------------------------------------------------------------- |
| page            | Integer   | Yes      | Page number                                                               |
| size            | Integer   | Yes      | Number of entries returned per page                                       |
| wabaId          | String    | Yes      | Unique identifier of the WhatsApp business account                        |
| name            | String    | No       | Template name                                                             |
| templateId      | String    | No       | Template ID                                                               |
| category        | list      | No       | Template type 1-MARKETING,2-AUTHENTICATION,3-UTILITY                      |
| messageLanguage | list      | No       | Template language (eg:en)                                                 |
| auditStatus     | list      | No       | Template status 1: Pending, 2: Approved 3: Rejected 4: Paused 5: Disabled |

#### Request example code

```json
{
    "page":1,
    "size":100
    "name": "transland_marketing_promotion_01"
    "wabaId": "100853739759190"
}

```

#### Response example

```json

{
    "code": "0",
    "message": "Success",
    "data": {
        "total": 1,
        "pages": 1,
        "list": [
            {
                "updateDate": "2023-10-16 19:09:45",
                "bodyExample": {
                    "body_text": [
                        [
                            "Tom",
                            "II2024089"
                        ]
                    ]
                },
                "buttons": [
                    {
                        "actionType": 3,
                        "phone": "15121041046",
                        "phoneArea": "86",
                        "label": "Call Us"
                    },
                    {
                        "actionType": 2,
                        "buttonExample": [
                            "\"https://www.chuanglan.com/document\""
                        ],
                        "label": "Websit",
                        "targetUrl": "https://www.chuanglan.com/{{1}}"
                    }
                ],
                "messageBody": "Dear customer {{1}}，your SMS API account {{2}} is avaliable, please rember the secret of this account. The secret is sent via email.",
                "footer": "Have a nice sms experience.",
                "messageLanguage": "zh_CN",
                "caption": "Transland API Account {{1}} Opened",
                "updateUser": "",
                "source": 1,
                "delFlag": 0,
                "templateId": "FCFD7669C142497684F090203F88AE98",
                "customerName": "CXQTest20230426",
                "sid": "634562468792622",
                "headerExample": {
                    "header_text": [
                        "II2024089"
                    ]
                },
                "wabaId": "wabaId",
                "name": "transland_marketing_promotion_01",
                "auditStatus": 2,
                "headerType": 2,
                "createUser": "",
                "id": 194,
                "category": 1,
                "createDate": "2023-10-16 19:09:45",
                "safetyAdvice": 0
            }
        ]
    }
}

```

## Delete template

**Request API address**

```
POST https://api.innopaas.com/api/whatsapp/v3/template/delete
```

**API description:**

Request parameters

<table><thead><tr><th width="111">Name</th><th width="104">Type</th><th width="80">Required</th><th>Remarks</th><th>Other information</th></tr></thead><tbody><tr><td>wabaId</td><td>string</td><td>Required</td><td>Unique identifier of the WhatsApp business account</td><td></td></tr><tr><td>id</td><td>integer</td><td></td><td>Template primary key ID</td><td>At least one of id/templateId must be passed</td></tr><tr><td>templateId</td><td>string</td><td></td><td>Template ID</td><td>At least one of id/templateId must be passed</td></tr></tbody></table>

Return parameters

<table><thead><tr><th>Name</th><th>Type</th><th>Required</th><th>Default value</th><th width="98">Remarks</th><th>Other information</th></tr></thead><tbody><tr><td>code</td><td>integer</td><td>Required</td><td></td><td></td><td>0: Success<br>Others: Failure</td></tr><tr><td>data</td><td>object</td><td>Required</td><td></td><td></td><td></td></tr><tr><td>message</td><td>string</td><td>Required</td><td></td><td></td><td></td></tr></tbody></table>

<br>
