消息Message

发送模板消息

请求接口地址

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

请求参数

字段

数据类型

是否必填

描述

wabaId

String

WhatsApp商业账户唯一标识

messageType

String

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

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

media

Object

详见媒体消息:media消息

location

Object

详见媒体消息:location消息

contacts

Object[]

详见媒体消息:contacts消息

interactive

Object

详见媒体消息:interactive消息

验证码模板示例

营销模板示例

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

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

请求示例

响应示例

最后更新于