# 创建模板

### 域名
* https://api.incsapp.com

### 请求路由
* /external/templates

### 请求方式
* **POST**

### 请求头
* Content-Type: application/json
* certification-code: f484bd42-4a0c-39d....

### 请求参数
#### 请求参数列表

|参数名|类型| 必填| 描述|
|-|-|-|-|
|name|string|是|模板名称，最大长度100
|language|string|是|语言code
|category|string|是|模板类别：MARKETING，UTILITY
|components|array|否|模板内容

#### 请求参数示例
```json
{
    "name": "test_api_2",
    "language": "en_US",
    "category": "MARKETING",
    "components": [
        {
            "type": "BODY",
            "text": "A API test template, first variable: {{1}}, second variable: {{2}}",
            "example": {
                "body_text": [
                    [1, 2]
                ]
            }
        },
        {
            "type": "FOOTER",
            "text": "Good night"
        }
    ]
}
```

### 响应
#### 成功响应示例
* 响应说明参见**模板资源说明**
```json
{
    "status": "success",
    "code": 200,
    "message": "",
    "data": {
        "template_id": "4166201267033543",
        "name": "test_api_2",
        "language": "en_US",
        "category": "MARKETING",
        "status": "REJECTED",
        "quality": "",
        "components": [
            {
                "type": "BODY",
                "text": "A API test template, first variable: {{1}}, second variable: {{2}}",
                "example": {
                    "body_text": [
                        [
                            1,
                            2
                        ]
                    ]
                }
            },
            {
                "type": "FOOTER",
                "text": "Good night"
            }
        ],
        "created_time": 1755076187,
        "updated_time": 1755076201,
        "status_updated_time": 0,
        "quality_updated_time": 0,
        "category_updated_time": 0
    },
    "error": {}
}
```
#### 失败响应示例
```json
{
    "status": "error",
    "code": 400,
    "message": "category require",
    "data": {},
    "error": {}
}
```