Skip to content

WhatsApp API getTemplate

GiuFLim edited this page Dec 1, 2022 · 18 revisions

模板信息查询

通过API查询WhatsApp应用下的单个号码绑定的消息模板

  • URL:https://api2.nxcloud.com/api/wa/getTemplate
  • Method:POST
  • Content-Type:application/json
  • 需要鉴权:

鉴权机制

鉴权规则请参考地址:API接口调用约定

请求参数

header参数:

参数名 类型 必选 示例值 说明
accessKey String fmexxx3ki 用户身份标识
ts String 1655710885431 当前请求的时间戳(单位是毫秒),牛信服务端允许用户端请求最大时间误差为60秒
bizType String 2 WhatsApp业务类型,取固定值“2”
action String getPhone WhatsApp业务操作,取固定值“getPhone”
sign String 6e95xxx826 API入参参数签名,签名算法

body参数:

参数名 类型 必选 示例值 说明
appkey String 牛信云WhatsApp应用的appkey
business_phone String 86158xxx1795 商户的WhatsApp号码列表,需要带国码,多个号码以“, ”分隔。如185xxx99,861xxx24
messaging_product String whatsapp 发送消息的通道,应用于WhatsApp消息的发送时,值必须为“whatsapp”
after String 向后分页游标值
before String 向前分页游标值
limit integer 每页模板数量 (为空 limit则默认值为20)
name String 模板名称(会返回同名的不同语言模板)

请求示例

body(application/json) 参数:

{
    "business_phone": "185xxx99",
    "appkey": "jh42xxxd434",
    "messaging_product": "whatsapp"
}

响应参数

参数名 类型 说明
code Integer 结果编码
data JsonObject 请求结果
message String 请求结果说明
  • data JsonObject参数:
参数名 类型 说明
data array[templateInfo object] 模板信息数组
paging object 分页信息
  • templateInfo object参数:
参数名 类型 说明
id string 模板ID
category string 模板类型
language string 模板语言
name string 模板名称
status string 审核状态枚举
枚举值:
APPROVED: 使用中 IN_APPEAL: 已提出上诉
PENDING: 待处理 REJECTED: 已拒绝
PENDING_DELETION: 待删除 DELETED: 已删除
DISABLED: 不可用 PAUSED: 暂时停用 LIMIT_EXCEEDED: 超出限制
rejected_reason string 拒绝原因
quality_score object 模板质量
components array[component object] 模板组件
  • quality_score object参数: 参数名 | 类型 | 说明 -- | -- | -- score| string | 模板质量枚举
    枚举值:
    GREEN: 高 YELLOW: 中
    RED: 低 UNKNOWN: 质量待定

  • component object参数:

参数名 类型 说明
type string <组件类型,取值包括:HEADER, BODY, FOOTER, BUTTONSxmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"
xmlns="http://www.w3.org/TR/REC-html40">
<style> </style>

组件类型,取值包括:HEADER, BODY, FOOTER, BUTTONS

简介

短信

语音

云呼叫中心(NXLink)

云呼叫中心(AI自动外呼)

Flash Call

短链

邮件验证码

DID号码

通用

号码检测

WhatsApp

Viber

Zalo ZNS

Super Message API

隐私号(旧)

PNS

坐席(旧版)

AI Agent

Clone this wiki locally