请求方式
GET /whatsapp/templates HTTP/1.1
Host: https://{your-domain}/api/open/v1
请求头
| 字段 | 类型 | 注释 |
| X-API-Key | string | 必填,API 密钥 |
请求参数
| 字段 | 类型 | 注释 |
| waba_id | string | 是,WABA 账户 ID |
| template_id | string | 否,模板 ID |
| page | int | 否,页码,默认 1 |
| limit | int | 否,每页条数,默认 10 |
| fields | string | 否,指定返回字段 |
可用 fields 字段:id, name, status, category, language, parameter_format, components, previous_category, sub_category, message_send_ttl_seconds, is_primary_device_delivery_only, is_sms_fallback_enabled, quality_score, health_status, source, rejected_reason, library_template_name, bid_spec, correct_category, cta_url_link_tracking_opted_out, degrees_of_freedom_spec, display_format, last_updated_time
返回的结果
{
“code”: 1,
“msg”: “OK”,
“data”: {
“data”: {
“0”: {
“id”: “960321963707594”,
“name”: “subsidy”,
“status”: “APPROVED”,
“category”: “MARKETING”,
“language”: “zh_CN”,
“parameter_format”: “NAMED”,
“message_send_ttl_seconds”: 86400,
“is_primary_device_delivery_only”: false,
“quality_score”: {“score”: “UNKNOWN”, “date”: 1784204376},
“source”: “manual”,
“components”: {
“0”: {“type”: “HEADER”, “format”: “IMAGE”, “example”: {“header_handle”: [“https://…”]}},
“1”: {“type”: “BODY”, “text”: “【河北省卫健委】您的{{subsidy_name}}已成功发送…”}
}
}
},
“total”: 7,
“per_page”: 10,
“current_page”: 1
}
}
| 字段 | 类型 | 注释 |
| id | string | 模板 ID |
| name | string | 模板名称 |
| status | string | 模板状态 |
| category | string | 模板分类 |
| language | string | 语言 |
| parameter_format | string | 参数格式 |
| message_send_ttl_seconds | int | 消息发送有效期(秒) |
| is_primary_device_delivery_only | bool | 是否仅主设备投递 |
| quality_score | object | 质量评分 |
| source | string | 来源 |
| components | array | 模板组件列表 |
| total | int | 总记录数 |
| per_page | int | 每页条数 |
| current_page | int | 当前页码 |