获取消息模板的详细信息。
接口说明
QPS 限制
本接口的单用户 QPS 限制为 5 次/秒。超过限制,API 调用会被限流,这可能会影响您的业务,请合理调用。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
cams:GetChatappTemplateDetail |
get |
*全部资源
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| TemplateCode |
string |
否 |
模板 Code。 |
****4b5c79c9432497a075bdfca36bf5 |
| Language |
string |
是 |
模板语言。 详细语言代码,请参见语言代码。 |
en_US |
CustWabaId
deprecated
|
string |
否 |
ISV 客户 WabaId。 说明
过时的参数,请使用 CustSpaceId |
65921621816**** |
| IsvCode |
string |
否 |
ISV 校验码,用于校验子账号是否由 ISV 授权。 |
skdi3kksloslikdkkdk |
| CustSpaceId |
string |
是 |
ISV 子客户的 SpaceId/直客客户实例 ID。 |
28251486512358**** |
| TemplateType |
string |
否 |
模板类型。
|
|
| TemplateName |
string |
否 |
模板名称。 |
test_name |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
返回数据。 |
||
| RequestId |
string |
请求 ID。 |
744c4b5c79c9432497a075bdfca3**** |
| Code |
string |
请求状态码。
|
OK |
| Message |
string |
错误提示信息。 |
User not authorized to operate on the specified resource. |
| Data |
object |
返回数据。 |
{ "category": "ACCOUNT_UPDATE", "name": "account_notice", "language": "en_US", "templateCode": "744c4b5c79c9432497a075bdfca3****", "auditStatus": "APPROVED", "components": "[{\"type\":\"BODY\",\"text\":\"body_text$(textVariable)\"},{\"type\":\"HEADER\",\"formate\":\"IMAGE\",\"url\":\"$(linkVariable)\"},{\"type\":\"FOOTER\",\"text\":\"footer-text\"},{\"type\":\"BUTTONS\",\"buttons\":[{\"type\":\"PHONE_NUMBER\",\"text\":\"phone-button-text\",\"phone_number\":\"+861388888****\"},{\"type\":\"URL\",\"text\":\"url-button-text\",\"url\":\"https://www.website.com/\"}]}]", "example": "{\"textVariable\": \"text\", \"linkVariable\": \"link\"}" } |
| Category |
string |
Whatsapp 模板分类。取值:
Viber 模板分类
说明
当 Viber 模板取值为 text_video_button 时,按钮并不能打开网页,只是在网页中打开当前消息的视频,所以按钮的 URL 中不需要填写任何地址信息 |
UTILITY |
| TemplateCode |
string |
模板 Code。 |
744c4b5c79c9432497a075bdfca3**** |
| Name |
string |
模板名称。 |
hello_whatsapp |
| Language |
string |
模板语言。 详细语言代码,请参见语言代码。 |
en_US |
| Example |
object |
变量举例。 |
|
|
string |
模板变量对应的实际值,参数格式为 JSON 格式。 |
{\"textVariable\":\"text\",\"linkVariable\":\"https://image.developer.aliy\"} |
|
| AuditStatus |
string |
审核状态。取值:
|
pass |
| Components |
array<object> |
消息模板组件列表。 |
|
|
array<object> |
消息模板组件。 |
||
| Type |
string |
组件类型。
说明
|
BODY |
| Url |
string |
素材路径。 |
https://image.developer.aliyundoc.com |
| Text |
string |
发送消息的文本。 |
hello |
| Caption |
string |
文件的描述。 |
example |
| FileName |
string |
文件的名称。 |
example |
| Format |
string |
格式。 |
TEXT |
| Buttons |
array<object> |
按钮列表,仅适用于 BUTTONS 组件。 说明
Whatsapp 按钮数量说明
|
|
|
array<object> |
组件列表。 |
||
| Type |
string |
按钮类型。
说明
|
PHONE_NUMBER |
| Text |
string |
按钮显示的名称。 |
example |
| PhoneNumber |
string |
电话号码,仅按钮类型为PHONE_NUMBER时有效。 |
+861398745**** |
| Url |
string |
点击链接按钮将访问的网址。 |
https://example.com |
| UrlType |
string |
网址类型。
|
static |
| SignatureHash |
string |
WhatsApp 模板,Category 为 Authentication,并且 Button Type 为 ONE_TAP 时必填,表示 Whatsapp 调起应用的签名 Hash 值。 |
2993839 |
| PackageName |
string |
WhatsApp 模板,Category 为 Authentication,并且 Button Type 为 ONE_TAP 时必填,表示 Whatsapp 调起应用的包名。 |
com.aliyun |
| AutofillText |
string |
WhatsApp 模板,Category 为 Authentication,并且 Button Type 为 ONE_TAP 时必填,Whatsap Autofill 操作的按钮文本。 |
Autofill |
| IsOptOut |
boolean |
WhatsApp 模板,在 Category 为 Marketing,并且 Button type 为 QUICK_REPLY 时有效,表示按钮为营销退订按钮,客户如果点击了此按钮,并且在 chatapp 平台上配置了发送控制操作,则后续 Marketing 消息则不会发送到客户。 |
false |
| ExtendAttrs |
object |
扩展字段。 |
|
| NextTemplateCode |
string |
下一个模板编码。 |
20939920093993 |
| NextTemplateName |
string |
下一个模板名称。 |
abc |
| NextLanguageCode |
string |
下一个模板语言。 |
en |
| Action |
string |
事件类型。 |
nextCard |
| IntentCode |
string |
意图编码。 |
test |
| CouponCode |
string |
优惠券码。 |
202039ksjs |
| FlowId |
string |
Flow ID。 |
3838292983 |
| FlowAction |
string |
Flow 数据事件类型,取值:
|
NAVIGATE |
| NavigateScreen |
string |
跳转屏,在 FlowAction=NAVIGATE 时必填。 |
DETAILS |
| SupportedApps |
array<object> |
验证码 ONE_TAP/ZERO_TAP 支持的应用。 |
|
|
object |
验证码 ONE_TAP/ZERO_TAP 支持的应用。 |
||
| SignatureHash |
string |
包签名 HASH。 |
29kdkeik939 |
| PackageName |
string |
包名。 |
com.test |
| ThumbUrl |
string |
Viber 带视频消息的缩略图。 |
https://img.png |
| Duration |
integer |
Viber 视频消息的视频时长,取值范围:0~600。 |
50 |
| FileType |
string |
Viber 文件消息的文件类型。 |
docx |
| Latitude |
string |
位置纬度属性。 |
28.001 |
| Longitude |
string |
位置经度属性。 |
120.002 |
| LocationName |
string |
位置名称。 |
hangzhou |
| LocationAddress |
string |
位置地址。 |
hangzhou |
| AddSecretRecommendation |
boolean |
WhatsApp 类型模板,Category 为 Authentication,并且 Component Type 为 Body 时有效,表示在 Body 上面显示不要将验证码信息提供给其它人的提示信息。 |
false |
| CodeExpirationMinutes |
integer |
WhatsApp Authentication 模板验证码有效期(分钟),只在 Whatsapp 类型消息,Category 为 Authentication 并且 Component Type 为 Footer 时有效(此信息显示在 Footer 位置)。 |
5 |
| hasExpiration |
boolean |
LTO 模板中,优惠码是否有过期时间。 |
true |
| OfferExpirationTimeMs |
string |
LTO 模板时,优惠码过期变量。 |
$(offerExpirationTimeMs) |
| Cards |
array<object> |
轮播卡片列表。 |
|
|
array<object> |
Carousel 模板卡片列表。 |
||
| CardComponents |
array<object> |
卡片控件列表。 |
|
|
array<object> |
Carousel 卡片中控件列表。 |
||
| Type |
string |
组件类型。 |
HEADER |
| Text |
string |
卡片文本内容。 |
Body |
| Url |
string |
网页地址。 |
https://aliyun.com |
| Format |
string |
Carousel 模板中 Header 的类型,只支持 IMAGE/VIDEO,所有卡片的 Header 必须一致。 |
HEADER |
| Buttons |
array<object> |
卡片按钮列表 |
|
|
object |
按钮对象。 |
||
| Type |
string |
Carousel 模板的按钮类型 取值:URL/PHONE_NUMBER/QUICK_REQLY |
URL |
| Text |
string |
按钮内容。 |
example |
| Url |
string |
点击按钮后将访问的网址。 |
https://aliyun.com |
| UrlType |
string |
网址类型。取值:
|
static |
| PhoneNumber |
string |
号码。 |
+861380005**** |
| TemplateType |
string |
模板类型。
|
|
| QualityScore |
string |
模板质量。
|
GREEN |
| MessageSendTtlSeconds |
integer |
Whatsapp 中 Authentication 类型模板发送消息时的消息有效期。 |
120 |
| Reason |
string |
模板审核被拒的原因。 |
None |
| AccessDeniedDetail |
string |
访问被拒绝详细信息。 |
None |
示例
正常返回示例
JSON格式
{
"RequestId": "744c4b5c79c9432497a075bdfca3****",
"Code": "OK",
"Message": "User not authorized to operate on the specified resource.",
"Data": {
"Category": "UTILITY",
"TemplateCode": "744c4b5c79c9432497a075bdfca3****",
"Name": "hello_whatsapp",
"Language": "en_US",
"Example": {
"key": "{\\\"textVariable\\\":\\\"text\\\",\\\"linkVariable\\\":\\\"https://image.developer.aliy\\\"}"
},
"AuditStatus": "pass",
"Components": [
{
"Type": "BODY",
"Url": "https://image.developer.aliyundoc.com",
"Text": "hello",
"Caption": "example",
"FileName": "example",
"Format": "TEXT",
"Buttons": [
{
"Type": "PHONE_NUMBER",
"Text": "example",
"PhoneNumber": "+861398745****",
"Url": "https://example.com\n",
"UrlType": "static",
"SignatureHash": "2993839",
"PackageName": "com.aliyun",
"AutofillText": "Autofill",
"IsOptOut": false,
"ExtendAttrs": {
"NextTemplateCode": "20939920093993",
"NextTemplateName": "abc",
"NextLanguageCode": "en",
"Action": "nextCard",
"IntentCode": "test"
},
"CouponCode": "202039ksjs",
"FlowId": "3838292983",
"FlowAction": "NAVIGATE",
"NavigateScreen": "DETAILS",
"SupportedApps": [
{
"SignatureHash": "29kdkeik939",
"PackageName": "com.test"
}
]
}
],
"ThumbUrl": "https://img.png",
"Duration": 50,
"FileType": "docx",
"Latitude": "28.001",
"Longitude": "120.002",
"LocationName": "hangzhou",
"LocationAddress": "hangzhou",
"AddSecretRecommendation": false,
"CodeExpirationMinutes": 5,
"hasExpiration": true,
"OfferExpirationTimeMs": "$(offerExpirationTimeMs)",
"Cards": [
{
"CardComponents": [
{
"Type": "HEADER",
"Text": "Body",
"Url": "https://aliyun.com",
"Format": "HEADER",
"Buttons": [
{
"Type": "URL",
"Text": "example",
"Url": "https://aliyun.com",
"UrlType": "static",
"PhoneNumber": "+861380005****"
}
]
}
]
}
]
}
],
"TemplateType": "WHATSAPP",
"QualityScore": "GREEN",
"MessageSendTtlSeconds": 120,
"Reason": "None"
},
"AccessDeniedDetail": "None"
}
错误码
|
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. | 资源不属于当前用户。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。