All Products
Search
Document Center

Chat App Message Service:GetChatappTemplateDetail

Last Updated:Mar 27, 2026

Queries the details of a message template.

Operation description

QPS limit

This operation allows a maximum of 5 requests per second (RPS) per account. Excess requests are throttled, which may affect your business. Stay within the specified limit.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

cams:GetChatappTemplateDetail

get

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

TemplateCode

string

No

The code of the message template.

****4b5c79c9432497a075bdfca36bf5

Language

string

Yes

The language that is used in the message template. For more information, see Language codes.

en_US

CustWabaId deprecated

string

No

The WhatsApp Business account (WABA) ID of the user within the independent software vendor (ISV) account.

Note

CustWabaId is an obsolete parameter. Use CustSpaceId instead.

65921621816****

IsvCode

string

No

The independent software vendor (ISV) verification code. This parameter is used to verify whether the user is authorized by the ISV account.

skdi3kksloslikdkkdk

CustSpaceId

string

Yes

The space ID of the user within the ISV account.

28251486512358****

TemplateType

string

No

The type of the message template. Valid values:

  • WHATSAPP

  • VIBER

  • LINE (developing)

WHATSAPP

TemplateName

string

No

Name of a template.

test_name

Response elements

Element

Type

Description

Example

object

The response parameters.

RequestId

string

The request ID.

744c4b5c79c9432497a075bdfca3****

Code

string

The HTTP status code.

  • Example: OK. This value indicates that the request is successful.

  • Other codes indicate that the request fails. For more information, see Error codes.

OK

Message

string

The error message.

User not authorized to operate on the specified resource.

Data

object

The returned data.

{ "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

The category of the template when the returned value of TemplateType is WHATSAPP. Valid values:

  • UTILITY: a transactional template

  • MARKETING: a marketing template

  • AUTHENTICATION: an identity authentication template

The category of the template when the returned value of the TemplateType parameter is VIBER. Valid values:

  • text: a template that contains only text

  • image: a template that contains only images

  • text_image_button: a template that contains text, images, and buttons

  • text_button: a template that contains text and buttons

  • document: a template that contains only files

  • video: a template that contains only videos

  • text_video: a template that contains text and videos

  • text_video_button: a template that contains text, videos, and buttons

  • text_image: a template that contains text and images

Note

If Category is set to text_video_button, users cannot open a web page by clicking the button. Users can open only the video in the message. In this case, you do not need to specify the Url parameter for the URL button in the template.

UTILITY

TemplateCode

string

The code of the message template.

744c4b5c79c9432497a075bdfca3****

Name

string

The name of the message template.

hello_whatsapp

Language

string

The language that is used in the message template. For more information, see Language codes.

en_US

Example

object

The examples of variables.

string

The values of the variables that are included in the message template. The values must be in the JSON format.

{\"textVariable\":\"text\",\"linkVariable\":\"https://image.developer.aliy\"}

AuditStatus

string

The review status of the message template. Valid values:

  • pass: The message template is approved.

  • fail: The message template is rejected.

  • auditing: The message template is being reviewed.

  • unaudit: The review is suspended.

pass

Components

array<object>

The components of the message template.

array<object>

The information about the array object.

Type

string

The component type. Valid values:

  • BODY

  • HEADER

  • FOOTER

  • BUTTONS

  • CAROUSEL

  • LIMITED_TIME_OFFER

Note
  • In a WhatsApp message template, a Body component cannot exceed 1,024 characters in length. A HEADER or FOOTER component cannot exceed 60 characters in length.

  • FOOTER, CAROUSEL, and LIMITED_TIME_OFFER components are not supported in Viber message templates.

  • In Viber message templates, media resources such as images, videos, and documents are placed in the HEADER component. If a Viber message contains text and an image, the image is placed below the text in the message received on a device.

BODY

Url

string

The URL of the media resource.

https://image.developer.aliyundoc.com

Text

string

The text of the message that you want to send.

Hello

Caption

string

The description of the document.

New file uploaded

FileName

string

The name of the document.

Express shipment

Format

string

The format.

TEXT

Buttons

array<object>

The buttons. This parameter is returned only if the Type sub-parameter of the Components parameter is set to BUTTONS.

Note

  • A marketing or utility WhatsApp message template can contain up to 10 buttons.

  • A WhatsApp message template can contain only one phone call button.

  • A WhatsApp message template can contain up to two URL buttons.

  • In a WhatsApp message template, a quick reply button cannot be used together with a phone call button or a URL button.

array<object>

The information about the array object.

Type

string

The button type. Valid values:

  • PHONE_NUMBER: phone call button

  • URL: URL button

  • QUICK_REPLY: quick reply button

  • COPY_CODE: copy code button

  • ONE_TAP: one-tap autofill button if Category is set to AUTHENTICATION

Note
  • If Category is set to AUTHENTICATION for a WhatsApp message template, you can add only one button to the WhatsApp message template and you must set the Type sub-parameter of the Buttons parameter to COPY_CODE or ONE_TAP. If Type is set to COPY_CODE, the Text sub-parameter of the Buttons parameter is required. If Type is set to ONE_TAP, the Text, SignatureHash, PackageName, and AutofillText sub-parameters of the Buttons parameter are required. The value of Text is displayed if the desired app is not installed on the device. The value of Text indicates that you must manually copy the verification code.

  • You can add only one button to a Viber message template, and you must set the Type sub-parameter of the Buttons parameter to URL.

PHONE_NUMBER

Text

string

The display name of the button.

Call

PhoneNumber

string

The phone number. This parameter is valid only if the Type sub-parameter of the Buttons parameter is set to PHONE_NUMBER.

+861398745****

Url

string

The URL to which you are redirected when you click the URL button.

https://example.com

UrlType

string

The URL type. Valid values:

  • static

  • dynamic

static

SignatureHash

string

The app signing key hash that WhatsApp uses to load your app. This parameter is required if Category is set to AUTHENTICATION and the Type sub-parameter of the Buttons parameter is set to ONE_TAP in a WhatsApp message template.

2993839

PackageName

string

The app package name that WhatsApp uses to load your app. This parameter is required if Category is set to AUTHENTICATION and the Type sub-parameter of the Buttons parameter is set to ONE_TAP in a WhatsApp message template.

com.aliyun

AutofillText

string

The text of the one-tap autofill button. This parameter is required if Category is set to AUTHENTICATION and the Type sub-parameter of the Buttons parameter is set to ONE_TAP in a WhatsApp message template.

Autofill

IsOptOut

boolean

The unsubscribe button. This parameter is valid if Category is set to MARKETING and the Type sub-parameter of the Buttons parameter is set to QUICK_REPLY for a WhatsApp message template. Marketing messages will not be sent to customers if you configure message sending in the Chat App Message Service console and the customers click this button.

false

ExtendAttrs

object

The extended fields.

NextTemplateCode

string

The code of the next template.

20939920093993

NextTemplateName

string

The name of the next template.

abc

NextLanguageCode

string

The language of the next template.

en

Action

string

The event type.

nextCard

IntentCode

string

The intent code.

test

CouponCode

string

The coupon code.

202039ksjs

FlowId

string

The Flow ID.

3838292983

FlowAction

string

The Flow action. Valid values: NAVIGATE and DATA_EXCHANGE.

NAVIGATE

NavigateScreen

string

The first screen in the Flow. This parameter is returned if FlowAction is set to NAVIGATE.

DETAILS

SupportedApps

array<object>

The apps that support one-tap authentication and zero-tap authentication.

object

SignatureHash

string

The app signing key hash.

29kdkeik939

PackageName

string

The app package name.

com.test

ThumbUrl

string

The thumbnail URL of the video in the Viber message template.

https://img.png

Duration

integer

The length of the video in the Viber message template. Unit: seconds. Valid values: 0 to 600.

50

FileType

string

The type of the document attached in the Viber message template.

docx

Latitude

string

The latitude of the location.

28.001

Longitude

string

The longitude of the location.

120.002

LocationName

string

The name of the location.

Hangzhou

LocationAddress

string

The address of the location.

Hangzhou

AddSecretRecommendation

boolean

The note indicating that customers cannot share verification codes with others. The note is displayed in the message body. This parameter is valid if Category is set to AUTHENTICATION and the Type sub-parameter of the Components parameter is set to BODY for a WhatsApp message template.

false

CodeExpirationMinutes

integer

The validity period of the verification code in the WhatsApp authentication template. Unit: minutes. This parameter is valid only when Category is set to AUTHENTICATION and the Type sub-parameter of the Components parameter is set to FOOTER for a WhatsApp message template. The validity period of the verification code is displayed in the footer.

5

hasExpiration

boolean

Indicates whether the coupon code has an expiration time in the limited-time offer template.

true

OfferExpirationTimeMs

string

The variable when the coupon code expires in the limited-time offer template.

$(offerExpirationTimeMs)

Cards

array<object>

The carousel cards.

array<object>

CardComponents

array<object>

The components of the carousel card.

array<object>

Type

string

The component type.

HEADER

Text

string

The text of the carousel card.

Body

Url

string

The URL.

https://aliyun.com

Format

string

The type of the header in the carousel template. The header can only be an image or a video. The headers of all carousel cards must be the same. The type of the media resources that are included in the message. Valid values: IMGAGE and VIDEO.

HEADER

Buttons

array<object>

The buttons of the carousel card.

object

Type

string

The type of the button in the carousel template. Valid values: URL, PHONE_NUMBER, and QUICK_REQLY.

URL

Text

string

The button text.

Button text

Url

string

The URL to which you are redirected when you click the URL button.

https://aliyun.com

UrlType

string

The type of the URL. Valid values: static and dynamic.

static

PhoneNumber

string

The phone number.

+861380005****

TemplateType

string

The type of the message template. Valid values:

  • WHATSAPP

  • VIBER

  • LINE (developing)

WHATSAPP

QualityScore

string

The quality of the template.

Valid values:

  • RED :

    低质量

  • YELLOW :

    中等质量

  • UNKNOWN :

    质量未知

  • GREEN :

    高质量

GREEN

MessageSendTtlSeconds

integer

The validity period of the WhatsApp authentication message.

120

Reason

string

The reason why the template was rejected.

None

AccessDeniedDetail

string

Access denied details.

None

Examples

Success response

JSON format

{
  "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": "New file uploaded",
        "FileName": "Express shipment",
        "Format": "TEXT",
        "Buttons": [
          {
            "Type": "PHONE_NUMBER",
            "Text": "Call",
            "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": "Button text",
                    "Url": "https://aliyun.com",
                    "UrlType": "static",
                    "PhoneNumber": "+861380005****"
                  }
                ]
              }
            ]
          }
        ]
      }
    ],
    "TemplateType": "WHATSAPP",
    "QualityScore": "GREEN",
    "MessageSendTtlSeconds": 120,
    "Reason": "None"
  },
  "AccessDeniedDetail": "None"
}

Error codes

HTTP status code

Error code

Error message

Description

400 Product.Unsubscript You have not subscribed to the specified product. 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. The system is under flow control.
400 Unknown.ResourceOwnerId The resource does not belong to the current user. The resource does not belong to the current user.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.