擷取訊息模板的詳細資料。
介面說明
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 |
發送訊息的文本。 |
你好 |
| Caption |
string |
檔案的描述。 |
新檔案已上傳 |
| FileName |
string |
檔案的名稱。 |
快遞檔案 |
| Format |
string |
格式。 |
TEXT |
| Buttons |
array<object> |
按鈕列表,僅適用於 BUTTONS 組件。 說明
Whatsapp 按鈕數量說明
|
|
|
array<object> |
組件列表。 |
||
| Type |
string |
按鈕類型。
說明
|
PHONE_NUMBER |
| Text |
string |
按鈕顯示的名稱。 |
打電話 |
| 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 |
位置名稱。 |
杭州 |
| LocationAddress |
string |
位置地址。 |
杭州 |
| 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 |
按鈕內容。 |
按鈕文本 |
| 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 |
訪問被拒絕詳細資料。 |
無 |
樣本
正常返回樣本
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": "你好",
"Caption": "新檔案已上傳",
"FileName": "快遞檔案",
"Format": "TEXT",
"Buttons": [
{
"Type": "PHONE_NUMBER",
"Text": "打電話",
"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": "杭州",
"LocationAddress": "杭州",
"AddSecretRecommendation": false,
"CodeExpirationMinutes": 5,
"hasExpiration": true,
"OfferExpirationTimeMs": "$(offerExpirationTimeMs)",
"Cards": [
{
"CardComponents": [
{
"Type": "HEADER",
"Text": "Body",
"Url": "https://aliyun.com",
"Format": "HEADER",
"Buttons": [
{
"Type": "URL",
"Text": "按鈕文本",
"Url": "https://aliyun.com",
"UrlType": "static",
"PhoneNumber": "+861380005****"
}
]
}
]
}
]
}
],
"TemplateType": "WHATSAPP",
"QualityScore": "GREEN",
"MessageSendTtlSeconds": 120,
"Reason": "None"
},
"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. | 資源不屬於目前使用者。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。