All Products
Search
Document Center

Chat App Message Service:GetChatappTemplateDetail

Last Updated:Sep 29, 2026

Retrieves the details of a Chat App Message Service message template.

Operation description

QPS limit

The QPS limit for this operation is 5 calls per second per user. If the limit is exceeded, API calls are throttled, which may affect your business. Call this operation at a reasonable rate.

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 template code.

****4b5c79c9432497a075bdfca36bf5

Language

string

Yes

The template language. For language codes, see Language codes.

en_US

CustWabaId deprecated

string

No

The ISV customer WABA ID.

Note

This parameter is deprecated. Use CustSpaceId instead.

65921621816****

IsvCode deprecated

string

No

The ISV verification code used to verify whether a sub-account is authorized by the ISV.

skdi3kksloslikdkkdk

CustSpaceId

string

No

The space ID of the ISV sub-customer or the instance ID of the direct customer.

28251486512358****

TemplateType

string

No

The templatetype. Valid values:

  • WHATSAPP

  • VIBER

WHATSAPP

TemplateName

string

No

The template name.

test_name

Response elements

Element

Type

Description

Example

object

The response data.

RequestId

string

The request ID.

744c4b5c79c9432497a075bdfca3****

Code

string

The request status code.

  • OK indicates that the request was successful.

  • For other error codes, see Error codes.

OK

Message

string

The error message.

User not authorized to operate on the specified resource.

Data

object

The response 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 WhatsApp template category. Valid values:

  • UTILITY: transaction-related.

  • MARKETING: marketing template.

  • AUTHENTICATION: identity verification.

Viber template category:

  • UTILITY: transaction-related.

  • MARKETING: marketing template.

  • AUTHENTICATION: identity verification.

UTILITY

TemplateCode

string

The template code.

744c4b5c79c9432497a075bdfca3****

Name

string

The template name.

hello_whatsapp

Language

string

The template language. For language codes, see Language codes.

en_US

Example

object

The variable example.

string

The actual value corresponding to the template variable. The parameter is in JSON format.

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

AuditStatus

string

The audit status. Valid values:

  • pass: Approved.

  • fail: Rejected.

  • auditing: Under review.

  • unaudit: Review suspended.

pass

Components

array<object>

The list of message template components.

array<object>

The message template component.

Type

string

The component type. Valid values:

  • BODY

  • HEADER

  • FOOTER

  • BUTTONS

  • CAROUSEL

  • LIMITED_TIME_OFFER

Note
  • For WhatsApp templates, the BODY component supports a maximum of 1,024 characters. The HEADER and FOOTER components support a maximum of 60 characters each.

  • For Viber templates, FOOTER, CAROUSEL, and LIMITED_TIME_OFFER are not supported.

  • For Viber templates, images, videos, and files are placed in the HEADER component (the terminal displays images below the text).

BODY

Url

string

The media resource path.

https://image.developer.aliyundoc.com

Text

string

The text of the message to send.

hello

Caption

string

The description of the file.

example

FileName

string

The name of the file.

example

Format

string

The format.

TEXT

Buttons

array<object>

The list of buttons. Applicable to BUTTONS components only.

Note

WhatsApp button quantity rules:

  • For MARKETING or UTILITY templates, a maximum of 10 buttons are allowed.

  • Only one PHONE_NUMBER button is allowed.

  • A maximum of two URL buttons are allowed.

  • QUICK_REPLY buttons cannot be mixed out of order with PHONE_NUMBER or URL buttons.

array<object>

The component list.

Type

string

The button type. Valid values:

  • PHONE_NUMBER: call button.

  • URL: web link button.

  • QUICK_REPLY: quick reply button.

  • COPY_CODE: copy verification code or coupon code.

  • ONE_TAP: autofill button for AUTHENTICATION templates.

  • ZERO_TAP: autofill button for AUTHENTICATION templates.

  • MPM: multi-product catalog.

  • CATALOG: catalog.

  • FLOW: opens a WhatsApp flow.

Note
  • For WhatsApp templates with Category set to AUTHENTICATION, only one button is allowed, and the type must be COPY_CODE or ONE_TAP. If the type is COPY_CODE, Text is required. If the type is ONE_TAP, Text (displayed when the target app is not installed on the device, representing the name of the copy verification code button), SignatureHash, PackageName, and AutofillText are all required.

  • Viber templates allow only one button, and the type must be URL.

PHONE_NUMBER

Text

string

The display name of the button.

example

PhoneNumber

string

The phone number. Valid only when the button type is PHONE_NUMBER.

+861398745****

Url

string

The URL that the user is directed to when the link button is clicked.

https://example.com

UrlType

string

The URL type. Valid values:

  • static: static.

  • dynamic: dynamic.

static

SignatureHash

string

The signature hash used by WhatsApp to launch the app. Required for WhatsApp templates with Category set to Authentication and Button Type set to ONE_TAP.

2993839

PackageName

string

The package name of the app that WhatsApp launches. Required for WhatsApp templates with Category set to Authentication and Button Type set to ONE_TAP.

com.aliyun

AutofillText

string

The button text for the WhatsApp autofill action. Required for WhatsApp templates with Category set to Authentication and Button Type set to ONE_TAP.

Autofill

IsOptOut

boolean

Indicates whether the button is a marketing opt-out button. Valid for WhatsApp templates with Category set to Marketing and Button Type set to QUICK_REPLY. If a customer clicks this button and a send control action is configured on the Chat App Message Service platform, subsequent marketing messages will not be sent to that customer.

false

ExtendAttrs

object

The extended attributes.

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

Flow ID

3838292983

FlowAction

string

The flow data event type. Valid values:

  • NAVIGATE: navigation.

  • DATA_EXCHANGE: data exchange.

NAVIGATE

NavigateScreen

string

The target screen to navigate to. Required when FlowAction is set to NAVIGATE.

DETAILS

SupportedApps

array<object>

The apps supported by ONE_TAP or ZERO_TAP verification codes.

object

The apps supported by ONE_TAP or ZERO_TAP verification codes.

SignatureHash

string

The package signature hash.

29kdkeik939

PackageName

string

The package name.

com.test

ThumbUrl

string

The thumbnail for Viber video messages.

https://img.png

Duration

integer

The video duration for Viber video messages. Valid range: 0–600.

50

FileType

string

The file type for Viber file messages.

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

Valid for WhatsApp templates where Category is Authentication and Component Type is Body. Specifies whether to display a message in the body advising users not to share the verification code with others.

false

CodeExpirationMinutes

integer

The expiration time in minutes for the verification code in a WhatsApp Authentication template. Valid only for WhatsApp messages where Category is Authentication and Component Type is Footer (displayed in the footer).

5

hasExpiration

boolean

Specifies whether the offer code has an expiration time in an LTO template.

true

OfferExpirationTimeMs

string

The offer code expiration variable for LTO templates.

$(offerExpirationTimeMs)

Cards

array<object>

The carousel card list.

array<object>

The list of cards in a carousel template.

CardComponents

array<object>

The list of components in a card.

array<object>

The list of components in a carousel card.

Type

string

The component type.

HEADER

Text

string

The text content of the card.

Body

Url

string

The web address.

https://aliyun.com

Format

string

The header type for carousel templates. Only IMAGE or VIDEO is supported, and all cards must use the same header type.

HEADER

Buttons

array<object>

The list of buttons in a card.

object

The button object.

Type

string

The button type for carousel templates. Valid values: URL/PHONE_NUMBER/QUICK_REPLY.

URL

Text

string

The button text.

example

Url

string

The URL to open when the button is clicked.

https://aliyun.com

UrlType

string

The URL type. Valid values:

  • static: static URL.

  • dynamic: dynamic URL.

static

PhoneNumber

string

The phone number.

+861380005****

TemplateType

string

The templatetype.

  • WHATSAPP

  • VIBER

WHATSAPP

QualityScore

string

The template quality.

  • RED (low quality)

  • YELLOW (medium quality)

  • UNKNOWN (quality unknown)

  • GREEN (high quality)

GREEN

MessageSendTtlSeconds

integer

The message validity period when sending messages using a WhatsApp Authentication template.

120

Reason

string

The reason the template was rejected during review.

None

CategoryChangePaused

boolean

Specifies whether message sending is paused when a Utility template is changed to a Marketing template.

true

AllowSend

boolean

Specifies whether the current template can be used to send messages. Valid only for Marketing templates.

true

ProductSetId

string

productSetId

939***

AccessDeniedDetail

string

The details of the access denial.

None

Success

boolean

Indicates whether the request was successful.

true

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": "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",
    "CategoryChangePaused": true,
    "AllowSend": true,
    "ProductSetId": "939***"
  },
  "AccessDeniedDetail": "None",
  "Success": true
}

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.