ModifyChatappTemplate

Updated at:

Modifies a message template. Only templates that have not been reviewed or that failed the review can be modified.

Operation description

QPS limit

The single-user QPS limit for this operation is 50 calls per second. If this limit is exceeded, the API calls are throttled, which may affect your business. Call this operation as needed.

Status changes

Changes to the status and quality of a template can be monitored through MNS or HTTP. For more information, see Receipt messages.

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:ModifyChatappTemplate

update

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Components

array<object>

Yes

The list of message template components.

Note

When Category is set to AUTHENTICATION, Components cannot contain a node with Type set to HEADER. When Type is set to BODY or FOOTER, if the Text content is empty, the content is automatically generated.

array<object>

No

The message template component.

HasExpiration

boolean

No

Specifies whether the LTO template has an expiration time.

true

ThumbUrl

string

No

The thumbnail URL for a Viber video message.

https://img.png

FileName

string

No

The file name. You can specify a file name when Type is set to Header and Format is set to DOCUMENT.

txt.txt

Text

string

No

The text of the message to be sent.

IMAGE

Duration

integer

No

The video duration of a Viber video message. Valid values: 0 to 600.

120

Url

string

No

The URL of the media resource.

https://img.png

Caption

string

No

The description. You can add a description when Type is set to Header and Format is set to IMGAGE, DOCUMENT, or VIDEO.

test

AddSecretRecommendation

boolean

No

Specifies whether to display a security recommendation above the body text, advising users not to share the verification code. This parameter is valid only for WhatsApp templates when Category is set to Authentication and Component Type is set to Body.

false

Type

string

Yes

The component type.\nValid values: BODY, HEADER, FOOTER, and BUTTONS.

HEADER

Format

string

No

The format.\nValid values:\n- TEXT: text.\n- IMGAGE: image.\n- DOCUMENT: document.\n- VIDEO: video.

body

CodeExpirationMinutes

integer

No

The validity period of the verification code in the WhatsApp Authentication template, in minutes. This parameter is valid only for WhatsApp messages when Category is set to Authentication and Component Type is set to Footer. The information is displayed in the Footer section.

10

FileType

string

No

The file type of a Viber file message.

txt

Buttons

array<object>

No

The list of buttons. This parameter is applicable only to BUTTONS components.

Note

WhatsApp button quantity rules:

  • When the WhatsApp template type is MARKETING or UTILITY, 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 in random order with PHONE_NUMBER or URL buttons.

array<object>

No

The button.

AutofillText

string

No

The button text for the WhatsApp Autofill operation. This parameter is required for WhatsApp templates when Category is set to Authentication and Button Type is set to ONE_TAP.

Autofill

PackageName

string

No

The package name of the application that WhatsApp launches. This parameter is valid for WhatsApp templates when Category is set to Authentication and Button Type is set to ONE_TAP or ZERO_TAP.

com.aliyun.pack.***

Text

string

No

The text of the message to be sent.

CTA

Url

string

No

The URL that is accessed when the button is clicked.

https://aliyun.com

FlowId

string

No

Flow id

293882

Type

string

Yes

The button type.\nValid values: PHONE_NUMBER (phone call), URL (web button), and QUICK_REPLY (quick reply).

URL

CouponCode

string

No

The coupon code.

23838jdjdj

IsOptOut

boolean

No

Specifies whether the button is a marketing opt-out button. This parameter is valid for WhatsApp templates when Category is set to Marketing and Button Type is set to QUICK_REPLY. If a customer clicks this button and the send control operation is configured on the Chat App Message Service platform, subsequent Marketing messages are not sent to the customer.

false

FlowAction

string

No

The flow data event type.\nValid values: NAVIGATE and DATA_EXCHANGE.

NAVIGATE

SignatureHash

string

No

The signature hash value of the application that WhatsApp launches. This parameter is valid for WhatsApp templates when Category is set to Authentication and Button Type is set to ONE_TAP or ZERO_TAP.

kdikie9398k

NavigateScreen

string

No

The navigate screen.\nThis parameter is required when FlowAction is set to NAVIGATE.

SIGN_UP

PhoneNumber

string

No

The phone number.

8613800**

SupportedApps

array<object>

No

The applications supported by the ONE_TAP or ZERO_TAP verification code button.

object

No

The applications supported by the ONE_TAP or ZERO_TAP verification code button.

SignatureHash

string

No

The signature hash value of the application that WhatsApp launches. This parameter is valid for WhatsApp templates when Category is set to Authentication and Button Type is set to ONE_TAP or ZERO_TAP.

kdikie9398k

PackageName

string

No

The package name of the application that WhatsApp launches. This parameter is valid for WhatsApp templates when Category is set to Authentication and Button Type is set to ONE_TAP or ZERO_TAP.

com.aliyun.pack.***

UrlType

string

No

The URL type. Valid values:\n- static: static URL.\n- dynamic: dynamic URL.

static

Cards

array<object>

No

The list of Carousel template cards.

array<object>

No

The Carousel template card.

CardComponents

array<object>

Yes

The list of components in the Carousel card.

array<object>

No

The list of components in the Carousel card.

Type

string

Yes

The component type.\nValid values: BODY, HEADER, and BUTTONS.

HEADER

Format

string

No

The header type in the Carousel template. Only IMAGE and VIDEO are supported. The header type must be the same across all cards.\nValid values:\n- IMGAGE: image.\n- VIDEO: video.

IMAGE

Text

string

No

The body content of the Carousel card.

body

Buttons

array<object>

No

The buttons in the Carousel card. The button type, name, and order must be the same across all cards. Each card supports a maximum of 2 buttons.

object

No

The buttons in the Carousel card. The button type, name, and order must be the same across all cards. Each card supports a maximum of 2 buttons.

Type

string

Yes

The button type of the Carousel template.\nValid values: URL, PHONE_NUMBER, and QUICK_REQLY.

URL

PhoneNumber

string

No

The phone number.

8613800**

Text

string

No

The button text.

text

UrlType

string

No

The URL type. Valid values:\n- static: static URL.\n- dynamic: dynamic URL.

static

Url

string

No

The URL that is accessed when the button is clicked.

https://aliyun.com/image.png

Url

string

No

The URL of the header image or video.

https://aliyun.com/image.png

Language

string

Yes

The language.

en

Example

object

No

The variables in key-value structure.

string

No

The example for creating a template.

StringConcat('a', 'b', 'c')

CustWabaId

string

No

The ISV customer WabaId. This parameter will be deprecated. Use CustSpaceId instead.

939***

IsvCode deprecated

string

No

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

9393***

TemplateCode

string

No

The message template code.

93938**

CustSpaceId

string

No

The SpaceId of the ISV sub-customer or the instanceId of a direct customer.

cams-did***

Category

string

No

The template category. This parameter can be modified when updating Viber templates. This parameter is invalid for WhatsApp templates.

MARKETING

TemplateType

string

No

The templatetype of the template to be modified. Valid values:

  • WHATSAPP

  • VIBER

Default value: WHATSAPP.

WHATSAPP

MessageSendTtlSeconds

integer

No

The time-to-live (TTL) for sending WhatsApp Authentication template messages.

120

TemplateName

string

No

The template name.

test_name

CategoryChangePaused

boolean

No

Specifies whether to pause template sending when a Utility template is changed to the Marketing type.

true

ProductSetId

string

No

productSetId

939***

Response elements

Element

Type

Description

Example

object

The response parameters.

RequestId

string

The request ID.

90E63D28-E31D-1EB2-8939-A9486641****

Code

string

The response code.

  • OK indicates that the request was successful.

  • For other error codes, see Error codes.

OK

Message

string

The error message.

None

Data

object

The returned data.

TemplateCode

string

The template code.

8472929283883

TemplateName

string

The template name.

hello_whatsapp

AccessDeniedDetail

string

The access denial details.

None

Success

boolean

Indicates whether the request was successful.

true

Examples

Success response

JSON format

{
  "RequestId": "90E63D28-E31D-1EB2-8939-A9486641****",
  "Code": "OK",
  "Message": "None",
  "Data": {
    "TemplateCode": "8472929283883",
    "TemplateName": "hello_whatsapp"
  },
  "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.