获取模板列表

请求方式

GET /whatsapp/templates HTTP/1.1
Host: https://{your-domain}/api/open/v1

请求头

字段类型注释
X-API-Keystring必填,API 密钥

请求参数

字段类型注释
waba_idstring是,WABA 账户 ID
template_idstring否,模板 ID
pageint否,页码,默认 1
limitint否,每页条数,默认 10
fieldsstring否,指定返回字段

可用 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
  }
}

字段类型注释
idstring模板 ID
namestring模板名称
statusstring模板状态
categorystring模板分类
languagestring语言
parameter_formatstring参数格式
message_send_ttl_secondsint消息发送有效期(秒)
is_primary_device_delivery_onlybool是否仅主设备投递
quality_scoreobject质量评分
sourcestring来源
componentsarray模板组件列表
totalint总记录数
per_pageint每页条数
current_pageint当前页码