修改消息模板。只能修改未审核以及审核不通过的模板。
接口说明
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
请求参数
名称 | 类型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
Components | object [] | 是 | 消息模板组件列表。 说明
在 Category 为 AUTHENTICATION 时,Components 不允许出现 Type 为 HEADER 的节点,并且 Type 为 BODY/FOOTER 时,Text 内容为空,会自动生成内容。
| |
Type | string | 是 | 组件类型。
说明
| BODY |
Text | string | 否 | 所发送消息的文本。 说明
在 Category=AUTHENTICATION 中,此属性值为空。
| hello chatapp |
Format | string | 否 | 媒体资源类型。
| TEXT |
Url | string | 否 | 素材路径。 | https://img.tukuppt.com/png_preview/00/10/24/1GygxVK3F4.jpg |
Caption | string | 否 | 描述。 说明
当 Type 为 HEADER,且 Format 为IMAGE/DOCUMENT/VIDEO时可以增加描述。
| 这是一个视频 |
FileName | string | 否 | 文件名称。 说明
当 Type 为 HEADER,且 Format 为 DOCUMENT 时为文件指定文件名称。
| 视频 |
Buttons | object [] | 否 | 按钮列表,仅适用于 BUTTONS 组件。 说明
Whatsapp 按钮数量说明
| |
Type | string | 是 | 按钮类型。
说明
| PHONE_NUMBER |
Text | string | 否 | 按钮文本。 | phone-button-text |
PhoneNumber | string | 否 | 号码。 | +8613888887889 |
Url | string | 否 | 点击按钮后将访问的网址。 | https://www.website.com/ |
UrlType | string | 否 | 网址类型。
| dynamic |
SignatureHash | string | 否 | Whatsapp 模板,Category 为 AUTHENTICATION 且 Button Type 为 ONE_TAP 时必填,表示 Whatsapp 调起应用的签名 Hash 值。 | 29dkeke |
PackageName | string | 否 | Whatsapp 模板,Category 为 AUTHENTICATION 且 Button Type 为 ONE_TAP 时必填,表示 Whatsapp 调起应用的包名。 | com.demo |
AutofillText | string | 否 | Whatsapp 模板,Category 为 AUTHENTICATION 且 Button Type 为 ONE_TAP 时必填,Whatsap Autofill 操作的按钮文本。 | Autofill |
IsOptOut | boolean | 否 | Whatsapp 模板,在 Category 为 Marketing 且 Button type 为 QUICK_REPLY 时有效,表示按钮为营销退订按钮,客户如果点击了此按钮,并且在 ChatApp 已配置发送控制操作,则后续 Marketing 消息则不会发送到客户。 | false |
CouponCode | string | 否 | 优惠码值,只支持字母+数字,可以传入变量如$(couponCode),在发送时再传入优惠码 | 120293 |
FlowId | string | 否 | Flow ID。 | 664597077870605 |
FlowAction | string | 否 | flow 数据事件类型 枚举值:
| NAVIGATE |
NavigateScreen | string | 否 | 跳转屏 在 FlowAction=NAVIGATE 时必填 | |
ThumbUrl | string | 否 | Viber 带视频消息的缩略图。 | https://cdn.multiplymall.mobiapp.cloud/cloudcode/yc-165407506207478-165511576113195/20220905/ec5b9737-1507-4208-bb27-8da3958da961.jpg?x-oss-process=image/resize,w_100 |
Duration | integer | 否 | Viber 视频消息的视频时长,取值范围:0~600。 | 120 |
FileType | string | 否 | Viber 文件消息的文件类型。 | docx |
CodeExpirationMinutes | integer | 否 | Whatsapp AUTHENTICATION 模板验证码有效期(分钟),只在 Whatsapp 类型消息,Category 为 AUTHENTICATION 并且 Component Type 为 Footer 时有效(此信息显示在 Footer 位置)。 | 5 |
AddSecretRecommendation | boolean | 否 | Whatsapp 类型模板,Category 为 AUTHENTICATION 且 Component Type 为 Body 时有效,表示在 Body 上面显示不要将验证码信息提供给其它人的提示信息。 | false |
HasExpiration | boolean | 否 | 优惠码是否存在过期时间,在 type = LIMITED_TIME_OFFER 时使用。 | true |
Cards | object [] | 否 | Carousel 模板卡片列表 | |
CardComponents | object [] | 是 | Carousel 卡片中控件列表 | |
Type | string | 是 | 组件类型。取值:
| BODY |
Format | string | 否 | 媒体资源类型,在 Type = HEADER 时有效
| IMAGE |
Text | string | 否 | Carousel 卡片中 BODY 的内容 | Who is the very powerful team |
Url | string | 否 | 素材路径。 | https://alibaba.com/img.png |
Buttons | object [] | 否 | 按钮列表,仅适用于 BUTTONS 组件。Carousel 每个卡片最多只能有两个按钮。 | |
Text | string | 否 | 按钮文本。 | Call me |
Type | string | 是 | 按钮类型。
| PHONE_NUMBER |
Url | string | 否 | 点击按钮后将访问的网址。 | https://alibaba.com/xx |
UrlType | string | 否 | 网址类型。
| static |
PhoneNumber | string | 否 | 电话号码。 | +8613800 |
Language | string | 是 | 模板语言。 详细语言代码,请参见语言代码。 | en |
Example | object | 否 | 创建模板的示例。 | |
string | 否 | 变量例子。通过把 JSON 结构转成 String 的方式传入。 | {"textVariable":"text"} | |
CustWabaIddeprecated | string | 否 | ISV 客户 WabaId。 说明
过时的参数,请使用 CustSpaceId。
| 659216218162179 |
IsvCode | string | 否 | Isv 校验码,用于校验子账号是否由 ISV 授权。 | ksiekdki39ksks93939 |
TemplateCode | string | 是 | 消息模板编码。 | 8472929283883 |
CustSpaceId | string | 否 | ISV 子客户的 SpaceId。 | 28251486512358**** |
Category | string | 否 | Viber 模板分类
说明
此属性只对 Viber 类型模板有效。
| text |
TemplateType | string | 否 | 模板类型。
| |
MessageSendTtlSeconds | integer | 否 | Whatsapp 中 Authentication 模板消息发送有效期 说明
此属性需要提前提供 waba 给阿里运营人员开白名单,不然会导致模板送审失败
| 120 |
返回参数
示例
正常返回示例
JSON
格式
{
"RequestId": "90E63D28-E31D-1EB2-8939-A9486641****",
"Code": "OK",
"Message": "无",
"Data": {
"TemplateCode": "8472929283883",
"TemplateName": "hello_whatsapp"
},
"AccessDeniedDetail": "无"
}
错误码
HTTP status code | 错误码 | 错误信息 |
---|---|---|
400 | Product.Unsubscript | You have not subscribed to the specified product. |
400 | Ram.PermissionDeny | You are not authorized to perform the operation. |
400 | System.LimitControl | The system is under flow control. |
400 | Unknown.ResourceOwnerId | The resource does not belong to the current user. |
访问错误中心查看更多错误码。
变更历史
变更时间 | 变更内容概要 | 操作 | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
2023-11-22 | OpenAPI 错误码发生变更 | 看变更集 | ||||||||||
| ||||||||||||
2023-11-21 | OpenAPI 错误码发生变更 | 看变更集 | ||||||||||
| ||||||||||||
2023-10-19 | OpenAPI 错误码发生变更 | 看变更集 | ||||||||||
| ||||||||||||
2023-08-17 | OpenAPI 错误码发生变更、OpenAPI 入参发生变更 | 看变更集 | ||||||||||
| ||||||||||||
2023-07-04 | OpenAPI 错误码发生变更、OpenAPI 返回结构发生变更 | 看变更集 | ||||||||||
| ||||||||||||
2023-05-08 | OpenAPI 错误码发生变更 | 看变更集 | ||||||||||
| ||||||||||||
2023-03-02 | OpenAPI 错误码发生变更、OpenAPI 入参发生变更 | 看变更集 | ||||||||||
| ||||||||||||
2022-09-29 | 新增 OpenAPI | 看变更集 |