For the complete documentation index, see llms.txt. This page is also available as Markdown.

消息Message

发送模板消息

请求接口地址

POST   https://api.innopaas.com/api/whatsapp/v3/msg/submit

请求参数

字段

数据类型

是否必填

描述

wabaId

String

Y

WhatsApp商业账户唯一标识

messageType

String

Y

消息内容类型:template:模板 (首次发送,必须使用模板消息来触达用户)以下类型:在用户回复后的24小时内,可以使用text:文本 image:图片video:视频audio:音频location:定位document:文档sticker:贴图contacts:联系人interactive:互动消息

uid

String

客户批次号,不超过32字符

sendNumber

String

发送号码,格式:国家码+手机号

recipientNumber

String

接收号码,格式:国家码+手机号多个号码使用逗号分隔,最多1000个号码

recipientBsUid

String

WhatsApp 用户ID,格式CN.238812787381273812

发送验证码时不能传此值,必须使用recipientNumber。

body

String

消息体,messageType=text时必填

language

String

消息语言(需要传语言缩写编码),详见 附1,Language Code ListmessageType=template时必填

templateName

String

模板名称。允许小写字母、数字、字符和下划线,必须唯一。messageType=template时必填

templateGroupId

String

模板组ID,当使用模板组发送时,必填

header

Object

模板的消息头信息。详见 HeaderDto

bodyParams

String[]

模板正文中有变量时必填

buttonParams

Object[]

模板按钮类型是动态链接时必填详见 ParameterDto

media

Object

详见媒体消息:media消息

location

Object

详见媒体消息:location消息

contacts

Object[]

详见媒体消息:contacts消息

interactive

Object

详见媒体消息:interactive消息

namedParams

Object[]

按变量名自定义变量,当模版的变量格式parameterFormat=named时使用。 格式: [ {"name":"变量名1","vakue":"值1"}, {"name":"变量名2","vakue":"值2"}, ]

HeaderDto

参数名
类型
是否必填
备注
示例

type

String

Y

媒体类型:text/image/video/document

image

caption

String

N

标题type不是text时有效

Caption for the Picture

paramValue

String

N

变量type=text时有效,仅支持一个变量

tig

ParameterDto

参数名
类型
是否必填
备注
示例

type

String

Y

固定text

text

value

String

N

变量值如果是按钮上的文字,不超过20个字符

chuanglan

验证码模板示例

营销模板示例

Response示例

多媒体消息

media 消息

当messageType为(image、video、audio、document)时,可以发送媒体消息。

字段

数据类型

是否必填

描述

link

String

是

资源访问地址,改地址必须可以外网访问

caption

String

否

标题或描述,当messageType=audio,该属性不能填写

filename

String

否

messageType=document时必填填

location 消息

当messageType为 location 时,可以发送位置消息。

字段

数据类型

是否必填

描述

latitude

String

是

纬度 eg:31.23593

longitude

String

是

经度 eg:31.23593

name

String

是

位置名称,Pizz Hut

address

String

是

地址xxxx Road No.666

contacts 消息

当messageType为 contacts 时,可以发送联系人消息。

字段

数据类型

是否必填

描述

name

Object[]

是

姓名

├─formattedName

String

是

全名

├─firstName

String

否

姓

├─lastName

String

否

名

├─middleName

String

否

中间名

├─suffix

String

否

前缀

├─prefix

String

否

后缀

phones

Object[]

否

手机号码

├─type

String

是

类型:HOME/WORK

├─phone

String

是

手机号码

├─waID

String

是

WhatsApp商业账户唯一标识

org

Object[]

否

组织/部门

├─company

String

是

公司名称

├─department

String

是

部门

├─title

String

是

职位

addresses

Object[]

否

地址

├─type

String

否

类型:HOME/WORK

├─street

String

否

街道信息:XX街道XX号

├─city

String

否

城市:北京

├─state

String

否

州缩写,Contact's State

├─zip

String

否

邮政编码:000001

├─country

String

否

国家

├─countryCode

String

否

国家码

birthday

String

否

生日

emails

Object[]

否

电子邮件

├─type

String

是

类型:HOME/WORK

├─email

String

是

邮箱地址xxxxx@gmail.com

urls

Object[]

否

网址

├─type

String

是

类型:HOME/WORK

├─url

String

是

网址 https://www.chuanglan.com/

当messageType为 interactive 时,可以发送交互消息。

字段

数据类型

是否必填

描述

type

String

是

互动消息类型:list/button/product/product_list

header

String

否

互动消息请求头:product_list 类型时候必要、 product类型不能设置header 其他类型可选详见:InteractiveHeader

├─type

媒体类型:text/image/video/document

├─link

媒体链接type不是text时必填

├─caption

标题type不是text时有效

├─paramValue

变量type=text时有效,仅支持一个变量

body

是

类型为product时可选,其他消息类型必需 详见:Body

├─text

文本内容

footer

否

页脚详见:Footer

├─text

文本内容

action

是

操作

├─catalogId

type=product/product_type时必填:链接到您的WhatsApp商业帐户的Facebook目录的唯一标识符。这个ID可以通过Commerce Manager检索

├─productRetailerId

type=product/product_type时必填: 产品在目录中的唯一标识符。单产品和多产品消息最多100个字符。

├─buttons

按钮对象: 详见:Button

├─button

按钮内容: type=list时必填,不能为空字符串

├─sections

清单消息(type=list)和多产品消息(type=product_list)必填。详见:Section

Button参数

字段

数据类型

是否必填

描述

type

String

是

按钮类型:当前可选值:reply

title

String

是

按钮标题:不能为空字符串、当前消息中必须唯一,支持表情符号,不支持markdown。最大长度:20个字符

id

String

是

按钮的唯一标识符。当用户单击按钮时,在webhook中返回此ID。最大长度:256个字符

sections参数

字段

数据类型

是否必填

描述

title

String

否

section标题:消息中超过一个section时候必填:最大不超过24字符

rows

String

否

消息类型为list时必填, 一个Row的list对象,最多为10个详见:Row

productItems

String

否

type=product_list时必填, 产品对象的数组。每个部分至少有1个产品,所有部分最多有30个产品。详见:ProductItem

Row参数

字段

数据类型

是否必填

描述

title

String

是

标题:最大长度24个字符

id

String

是

唯一Id标识,最大长度200个字符

description

String

否

描述

ProductItem参数

字段

数据类型

是否必填

描述

productRetailerId

String

是

产品在目录中的唯一标识符

发送 MMLite 消息

MMLite 需要授权MMLite API权限后才可以使用,并且仅支持发送模版营销消息

请求接口地址

请求参数

字段

数据类型

是否必填

描述

wabaId

String

WhatsApp商业账户唯一标识

messageType

String

消息内容类型:template:模板

uid

String

客户批次号,不超过32字符

sendNumber

String

发送号码,格式:国家码+手机号

recipientNumber

String

接收号码,格式:国家码+手机号多个号码使用逗号分隔,最多1000个号码

body

String

消息体,messageType=text时必填

language

String

消息语言(需要传语言缩写编码),详见 附1,Language Code ListmessageType=template时必填

templateName

String

模板名称。允许小写字母、数字、字符和下划线,必须唯一。messageType=template时必填

header

Object

模板的消息头信息。详见 HeaderDto

bodyParams

String[]

模板正文中有变量时必填

buttonParams

Object[]

模板按钮类型是动态链接时必填详见 ParameterDto

请求示例

响应示例

最后更新于