全部產品
Search
文件中心

Chat App Message Service:GetChatappTemplateDetail - 查詢ChatApp模板詳情

更新時間:Dec 22, 2025

擷取訊息模板的詳細資料。

介面說明

QPS 限制

本介面的單使用者 QPS 限制為 5 次/秒。超過限制,API 呼叫會被限流,這可能會影響您的業務,請合理調用。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

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

模板類型。

  • WHATSAPP

  • VIBER

WHATSAPP

TemplateName

string

模板名稱。

test_name

返回參數

名稱

類型

描述

樣本值

object

返回資料。

RequestId

string

請求 ID。

744c4b5c79c9432497a075bdfca3****

Code

string

請求狀態代碼。

  • 返回 OK 代表請求成功。

  • 其他錯誤碼,請參見錯誤碼列表

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 模板分類。取值:

  • UTILITY:交易相關。

  • MARKETING:營銷性模板。

  • AUTHENTICATION:身分識別驗證。

Viber 模板分類

  • text:純文字

  • image:純圖片

  • text_image_button:文本 + 圖片 + 按鈕

  • text_button:文本 + 按鈕

  • document: 檔案

  • video:視頻

  • text_video:文本 + 視頻

  • text_video_button:文本 + 視頻 + 按鈕

  • text_image:文本 + 圖片

說明

當 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:通過審核。

  • fail:拒絕審核。

  • auditing:審核中。

  • unaudit:審核暫停處理。

pass

Components

array<object>

訊息模板組件列表。

array<object>

訊息模板組件。

Type

string

組件類型。

  • BODY

  • HEADER

  • FOOTER

  • BUTTONS

  • CAROUSEL

  • LIMITED_TIME_OFFER

說明
  • WhatsApp 類型模板時,BODY 組件的字元長度不超度是 1024 個字元。HEADERFOOTER 組件的字元長度不超過 60 個字元。

  • Viber 類型模板時,FOOTERCAROUSELLIMITED_TIME_OFFER 類型無效。

  • Viber 類型模板中,圖片、視頻、檔案都是放在 HEADER 中(終端將圖片顯示在文本之下)。

BODY

Url

string

素材路徑。

https://image.developer.aliyundoc.com

Text

string

發送訊息的文本。

你好

Caption

string

檔案的描述。

新檔案已上傳

FileName

string

檔案的名稱。

快遞檔案

Format

string

格式。

TEXT

Buttons

array<object>

按鈕列表,僅適用於 BUTTONS 組件。

說明

Whatsapp 按鈕數量說明

  • Whatsapp 在類型為 MARKETING/UTILITY 時,最多允許 10 個按鈕

  • PHONE_NUMBER 類型的按鈕只允許存在 1 個

  • URL 類型的按鈕最多允許存在 2 個

  • QUICK_REPLY 按鍵不允許和 PHONE_NUMBER/URL 按鈕亂序出現

array<object>

組件列表。

Type

string

按鈕類型。

  • PHONE_NUMBER:撥打到電話按鈕

  • URL:網頁按鈕

  • QUICK_REPLY:快速回複按鈕

  • COPY_CODE:複製驗證碼、優惠碼

  • ONE_TAP:AUTHENTICATION 模板時回填按鈕

  • ZERO_TAP:AUTHENTICATION 模板時回填按鈕

  • MPM:多商品目錄

  • CATALOG:目錄

  • FLOW:開啟 Whatsapp flow

說明
  • Whatsapp 類型模板且 Category 為 AUTHENTICATION 時,按鈕只允許存在一個,並且類型只能是 COPY_CODE/ONE_TAP, 當類型選擇 COPY_CODE 時,Text 為必填。當類型選擇 ONE_TAP 時,Text(在終端沒有裝目標應用時顯示,表示採用複製驗證碼按鈕的名稱)必填,SignatureHash, PackageName, AutofillText 屬性必填。

  • Viber 類型的模板只允許一個 Button 且只能是 URL 類型。

PHONE_NUMBER

Text

string

按鈕顯示的名稱。

打電話

PhoneNumber

string

電話號碼,僅按鈕類型為PHONE_NUMBER時有效。

+861398745****

Url

string

點選連結按鈕將訪問的網址。

https://example.com

UrlType

string

網址類型。

  • static:靜態。

  • dynamic:動態。

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:導航

  • DATA_EXCHANGE:資料交換

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:靜態

  • dynamic:動態。

static

PhoneNumber

string

號碼。

+861380005****

TemplateType

string

模板類型。

  • WHATSAPP

  • VIBER

WHATSAPP

QualityScore

string

模板品質。

枚舉值:

  • RED :

    低品質

  • YELLOW :

    中等品質

  • UNKNOWN :

    品質未知

  • GREEN :

    高品質

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. 資源不屬於目前使用者。

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情