建立訊息範本,範本審核通過後即可傳送訊息。
介面說明
QPS 限制
本介面的單一使用者 QPS 限制為每秒 50 次。超過限制時,API 呼叫將會被限流,這可能會影響您的業務,請合理呼叫。
狀態變更
範本的狀態與品質變更可透過 MNS/HTTP 方式監聽,詳細資訊請參閱回執訊息。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
cams:CreateChatappTemplate |
create |
*全部資源。
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| Category |
string |
是 |
Whatsapp 範本分類:
Viber 範本分類:
|
UTILITY |
| Components |
array<object> |
是 |
訊息範本元件清單。 說明
在 Category=AUTHENTICATION 時,Components 不允許出現 Type=HEADER 的節點,並且 Type=BODY 或 FOOTER 時,Text 內容應該為空。 |
|
|
array<object> |
否 |
元件清單。 |
||
| HasExpiration |
boolean |
否 |
優惠碼是否存在過期時間,在 type = LIMITED_TIME_OFFER 時使用。 |
true |
| ThumbUrl |
string |
否 |
Viber 帶影片訊息的縮圖。 |
https://cdn.multiplymall.mobiapp.cloud/yunmall/B-LM-LMALL202207130001/20220730/d712a057-a6af-4513-bbe6-7ee57ea60983.png?x-oss-process=image/resize,w_100 |
| FileName |
string |
否 |
檔案的名稱。 |
Express delivery video |
| Text |
string |
否 |
傳送訊息的文字。 說明
WHATSAPP 類型時,在 Category=AUTHENTICATION 中,此屬性值為空。 |
hello whatsapp |
| Duration |
integer |
否 |
Viber 影片訊息的影片時長(秒),取值範圍為 0~600。 |
120 |
| Url |
string |
否 |
素材路徑。 說明
Viber 類型時圖片建議大小:800px * 800px。 |
https://image.developer.aliyundoc.com |
| Caption |
string |
否 |
檔案的描述。 |
This is a video |
| AddSecretRecommendation |
boolean |
否 |
Whatsapp 類型範本,Category 為 AUTHENTICATION 且 Component Type 為 Body 時有效,表示在 Body 上面顯示不要將驗證碼資訊提供給其他人的提示資訊。 |
true |
| Type |
string |
是 |
元件類型。取值:
說明
|
BODY |
| Format |
string |
否 |
媒體資源類型。
|
TEXT |
| CodeExpirationMinutes |
integer |
否 |
Whatsapp AUTHENTICATION 範本驗證碼有效期(分鐘),只在 Whatsapp 類型訊息,Category 為 AUTHENTICATION 並且 Component Type 為 Footer 時有效(此資訊顯示在 Footer 位置)。 |
5 |
| FileType |
string |
否 |
Viber 檔案訊息的檔案類型。 |
docx |
| Buttons |
array<object> |
否 |
按鈕清單,僅適用於 BUTTONS 元件。 說明
Whatsapp 按鈕數量說明
說明
Viber 按鈕數量說明
|
|
|
array<object> |
否 |
按鈕定義。 |
||
| AutofillText |
string |
否 |
Whatsapp 範本,Category 為 AUTHENTICATION 且 Button Type 為 ONE_TAP/ZERO_TAP 時必填,Whatsap Autofill 操作的按鈕文字。 |
Autofill |
PackageName
deprecated
|
string |
否 |
請使用 SupportedApps 下的屬性。 |
com.demo |
| Text |
string |
否 |
按鈕顯示的名稱。 |
Call Me |
| Url |
string |
否 |
點擊連結按鈕將存取的網址。 |
https://example.com |
| FlowId |
string |
否 |
Flow ID。 |
479884093605**** |
| Type |
string |
是 |
按鈕類型。
說明
|
PHONE_NUMBER |
| CouponCode |
string |
否 |
優惠碼值,只支援字母加數字,可以傳入變數如 $(couponCode),在傳送時再傳入優惠碼。 |
120293 |
| IsOptOut |
boolean |
否 |
Whatsapp 範本,在 Category 為 Marketing,並且 Button type 為 QUICK_REPLY 時有效,表示按鈕為行銷退訂按鈕,客戶如果點擊了此按鈕,且在 ChatApp 已設定了傳送控制操作,則後續 Marketing 訊息則不會傳送到客戶。 |
false |
| FlowAction |
string |
否 |
Flow 資料事件類型。取值:
|
NAVIGATE |
SignatureHash
deprecated
|
string |
否 |
請使用 SupportedApps 下的屬性。 |
wi299382 |
| NavigateScreen |
string |
否 |
跳轉畫面,在 FlowAction=NAVIGATE 時必填。 |
DETAILS |
| PhoneNumber |
string |
否 |
電話號碼,僅按鈕類型為 PHONE_NUMBER 時有效。 |
+861368897**** |
| SupportedApps |
array<object> |
否 |
支援的 APP 清單。 |
|
|
object |
否 |
|||
| SignatureHash |
string |
否 |
WhatsApp 範本,Category 為 AUTHENTICATION 且 Button Type 為 ONE_TAP/ZERO_TAP 時必填,表示 Whatsapp 叫起應用程式的簽章 Hash 值。 |
ieid83kdiek |
| PackageName |
string |
否 |
WhatsApp 範本,Category 為 AUTHENTICATION 且 Button Type 為 ONE_TAP/ZERO_TAP 時必填,表示 Whatsapp 叫起應用程式的套件名稱。 |
com.kuaidian.waimaistaff |
| UrlType |
string |
否 |
網址類型。
|
static |
| Cards |
array<object> |
否 |
Carousel 範本卡片清單。 |
|
|
array<object> |
否 |
Carousel 範本卡片物件。 |
||
| CardComponents |
array<object> |
否 |
Carousel 卡片中的控制項清單。 |
|
|
array<object> |
否 |
Carousel 範本中的卡片物件。 |
||
| Type |
string |
是 |
元件類型。取值:
|
BODY |
| Format |
string |
否 |
媒體資源類型,在 Type = HEADER 時有效。
|
IMAGE |
| Text |
string |
否 |
Carousel 卡片中 BODY 的內容。 |
Who is the very powerful team |
| Buttons |
array<object> |
否 |
按鈕清單,僅適用於 BUTTONS 元件。Carousel 每個卡片最多只能有兩個按鈕。 |
|
|
object |
否 |
按鈕物件。 |
||
| Type |
string |
是 |
按鈕類型。
|
PHONE_NUMBER |
| PhoneNumber |
string |
否 |
電話號碼。 |
+86138007**** |
| Text |
string |
否 |
按鈕文字。 |
Call me |
| UrlType |
string |
否 |
網址類型。
|
static |
| Url |
string |
否 |
點擊按鈕後將存取的網址。 |
https://alibaba.com/xx |
| Url |
string |
否 |
素材路徑。 |
https://alibaba.com/img.png |
| Name |
string |
是 |
範本名稱。 |
hello_whatsapp |
| Language |
string |
是 |
範本語言。詳細語言代碼,請參見語言代碼。 |
en |
| Example |
object |
否 |
建立範本的範例。 |
hello_whatsapp |
|
string |
否 |
建立範本的範例。 |
StringConcat('a', 'b', 'c') |
|
| TemplateType |
string |
是 |
範本類型。
|
|
CustWabaId
deprecated
|
string |
否 |
ISV 客戶 WabaId。 說明
過時的參數,請使用 CustSpaceId。 |
65921621816**** |
IsvCode
deprecated
|
string |
否 |
ISV 驗證碼,用於驗證子帳號是否由 ISV 授權。 |
skdi3kksloslikdkkdk |
| CustSpaceId |
string |
否 |
ISV 子客戶的 SpaceId/直客客戶執行個體 ID。 |
293483938849493 |
AllowCategoryChange
deprecated
|
boolean |
否 |
是否允許 Facebook 自動變更範本的目錄(這樣能提高範本的審核通過率)此屬性只對 TemplateType=WHATSAPP 有效。 重要 這個屬性已被棄用,WhatsApp 已不支援此屬性 |
true |
| MessageSendTtlSeconds |
integer |
否 |
WhatsApp 中範本訊息傳送時的有效期。
|
120 |
| CategoryChangePaused |
boolean |
否 |
Utility 類型範本變更為 Marketing 類型時,範本是否暫停傳送,屬性僅對 WhatsApp 範本有效。 |
false |
|
否 |
productSetId |
9928** |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
返回資料。 |
||
| RequestId |
string |
請求 ID。 |
90E63D28-E31D-1EB2-8939-A94866411B2D |
| Code |
string |
請求狀態碼。
|
OK |
| Message |
string |
錯誤提示資訊。 |
User not authorized to operate on the specified resource. |
| Data |
object |
返回資料。 |
{"templateCode": "****4b5c79c9432497a075bdfca36bf5","templateName": "hello_whatsapp"} |
| TemplateCode |
string |
範本 Code。 |
SMS_232907**** |
| TemplateName |
string |
範本名稱。 |
hello_whatsapp |
| AccessDeniedDetail |
string |
存取被拒絕詳細資訊。 |
None |
| Success |
boolean |
true |
樣本
正常返回樣本
JSON格式
{
"RequestId": "90E63D28-E31D-1EB2-8939-A94866411B2D",
"Code": "OK",
"Message": "User not authorized to operate on the specified resource.",
"Data": {
"TemplateCode": "SMS_232907****",
"TemplateName": "hello_whatsapp"
},
"AccessDeniedDetail": "None",
"Success": true
}
錯誤碼
|
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. |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。