All Products
Search
Document Center

Chat App Message Service:ModifyChatappTemplate

Last Updated:Nov 18, 2024

The code of the message template.

Operation description

The name of the message template.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
cams:ModifyChatappTemplateupdate
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
Componentsarray<object>Yes

The components of the message template.

Note If Category is set to AUTHENTICATION, the Type sub-parameter of the Components parameter cannot be set to HEADER. If the Type sub-parameter is set to BODY or FOOTER, you do not need to set the Text sub-parameter of the Components parameter because the value is automatically generated.
objectYes

The components of the message template.

Note If Category is set to AUTHENTICATION, the Type sub-parameter of the Components parameter cannot be set to HEADER. If the value of Type is BODY or FOOTER, the Text sub-parameter of the Components parameter is empty.
TypestringYes

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
TextstringNo

The text of the message that you want to send.

Note If Category is set to AUTHENTICATION, do not specify the Text sub-parameter of the Components parameter.
hello chatapp
FormatstringNo

The type of the media resource. Valid values:

  • TEXT
  • IMAGE
  • DOCUMENT
  • VIDEO
TEXT
UrlstringNo

The URL of the media resource.

https://img.tukuppt.com/png_preview/00/10/24/1GygxVK3F4.jpg
CaptionstringNo

The description of the media resource.

Note If the Type sub-parameter of the Components parameter is set to HEADER and the Format parameter is set to IMAGE, DOCUMENT, or VIDEO, you can specify this parameter.
This is a video
FileNamestringNo

The name of the document.

Note If the Type sub-parameter of the Components parameter is set to HEADER and the Format parameter is set to DOCUMENT, you can specify this parameter.
video name
Buttonsarray<object>No

The buttons. Specify this parameter only if you set the Type sub-parameter of the Components parameter 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.

objectNo

The button.

TypestringYes

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
TextstringNo

The text of the button.

phone-button-text
PhoneNumberstringNo

The phone number.

+8613888887889
UrlstringNo

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

https://www.website.com/
UrlTypestringNo

The URL type. Valid values:

  • static
  • dynamic
dynamic
SignatureHashdeprecatedstringNo

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 for a WhatsApp message template.

29dkeke
PackageNamedeprecatedstringNo

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 for a WhatsApp message template.

com.demo
AutofillTextstringNo

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 for a WhatsApp message template.

Autofill
IsOptOutbooleanNo

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
CouponCodestringNo

The coupon code. It can contain only letters and digits. You can set this parameter to a variable such as $(couponCode). Specify the value of couponCode when you send a message.

120293
FlowIdstringNo

The Flow ID.

664597077870605
FlowActionstringNo

The Flow action.

Valid values:

  • DATA_EXCHANGE
  • NAVIGATE
NAVIGATE
NavigateScreenstringNo

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

DETAILS
SupportedAppsarray<object>No

List of supported apps.

objectNo

List of supported apps.

SignatureHashstringNo

The Whatsapp template is required when the Category is' Authorisation 'and the Button Type is' ONE_TAP/ZERO-TAP', indicating the signature hash value of the Whatsapp call application.

fk39kd93ks9
PackageNamestringNo

The Whatsapp template is required when the Category is' Authorisation 'and the Button Type is' ONE_TAP/ZERO-TAP', indicating the signature hash value of the Whatsapp call application.

com.example.myapplication
ThumbUrlstringNo

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

https://cdn.multiplymall.mobiapp.cloud/cloudcode/yc-165407506207478-165511576113195/20220905/ec5b9737-1507-4208-bb27-8da3958da961.jpg?x-oss-process=image/resize,w_100
DurationintegerNo

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

120
FileTypestringNo

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

docx
CodeExpirationMinutesintegerNo

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. The validity period of the verification code is displayed in the footer.

5
AddSecretRecommendationbooleanNo

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
HasExpirationbooleanNo

Specifies whether the coupon code has an expiration time. Specify this parameter if the Type sub-parameter of the Components parameter is set to LIMITED_TIME_OFFER.

true
Cardsarray<object>No

The carousel cards of the carousel template.

objectNo
CardComponentsarray<object>Yes

The components of the carousel card.

objectNo
TypestringYes

The component type. Valid values:

  • BODY
  • HEADER
  • BUTTONS
BODY
FormatstringNo

The type of the media resource. This parameter is valid if the Type sub-parameter of the CardComponents parameter is set to HEADER. Valid values:

  • IMAGE
  • VIDEO
IMAGE
TextstringNo

The body content of the carousel card.

Who is the very powerful team
UrlstringNo

The URL of the media resource.

https://alibaba.com/img.png
Buttonsarray<object>No

The buttons. Specify this parameter only if you set the Type sub-parameter of the CardComponents parameter to BUTTONS. A carousel card can contain up to two buttons.

objectNo
TextstringNo

The text of the button.

Call me
TypestringYes

The button type. Valid values:

  • PHONE_NUMBER: phone call button
  • URL: URL button
  • QUICK_REPLY: quick reply button
PHONE_NUMBER
UrlstringNo

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

https://alibaba.com/xx
UrlTypestringNo

The URL type. Valid values:

  • static
  • dynamic
static
PhoneNumberstringNo

The phone number.

+8613800
LanguagestringYes

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

en
ExampleobjectNo

The examples of variables that are used when you create the message template.

stringNo

The examples of variables that are used when you create the message template.

{"textVariable":"text"}
CustWabaIddeprecatedstringNo

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.
659216218162179
IsvCodestringNo

The ISV verification code, which is used to verify whether the user is authorized by the ISV account.

ksiekdki39ksks93939
TemplateCodestringNo

The message template code.

8472929283883
CustSpaceIdstringNo

The space ID of the user within the ISV account.

28251486512358****
CategorystringNo

The category of the Viber message template. Valid values:

  • text: the template that contains only text
  • image: the template that contains only images
  • text_image_button: the template that contains text, images, and buttons
  • text_button: the template that contains text and buttons
  • document: the template that contains only documents
  • video: the template that contains only videos
  • text_video: the template that contains text and videos
  • text_video_button: the template that contains text, videos, and buttons
  • text_image: the template that contains text and images
Note This parameter applies only to Viber message templates.
text
TemplateTypestringNo

The type of the message template.

  • WHATSAPP
  • VIBER
  • LINE: the Line message template. This type of message template will be released later.
WHATSAPP
MessageSendTtlSecondsintegerNo

Validity period of authentication template message sending in WhatsApp

Note This attribute requires providing waba in advance to Alibaba operators to open the whitelist, otherwise it will result in template submission failure
120
TemplateNamestringNo

Template name.

test_name

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The ID of the request.

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

The HTTP status code returned.

  • A value of OK indicates that the call is successful.
  • Other values indicate that the call fails. For more information, see Error codes.
OK
Messagestring

The error message returned.

NONE
Dataobject

The data returned.

TemplateCodestring

The code of the message template.

8472929283883
TemplateNamestring

The name of the message template.

hello_whatsapp
AccessDeniedDetailstring

The details about the access denial.

None

Examples

Sample success responses

JSONformat

{
  "RequestId": "90E63D28-E31D-1EB2-8939-A9486641****",
  "Code": "OK",
  "Message": "NONE",
  "Data": {
    "TemplateCode": "8472929283883",
    "TemplateName": "hello_whatsapp"
  },
  "AccessDeniedDetail": "None\n"
}

Error codes

HTTP status codeError codeError message
400Product.UnsubscriptYou have not subscribed to the specified product.
400Ram.PermissionDenyYou are not authorized to perform the operation.
400System.LimitControlThe system is under flow control.
400Unknown.ResourceOwnerIdThe resource does not belong to the current user.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-06-21The Error code has changedView Change Details
2024-04-10The Error code has changed. The request parameters of the API has changedView Change Details
2023-11-22The Error code has changedView Change Details
2023-11-21The Error code has changedView Change Details
2023-10-19The Error code has changedView Change Details
2023-08-17The Error code has changed. The request parameters of the API has changedView Change Details
2023-07-04The Error code has changed. The response structure of the API has changedView Change Details
2023-05-08The Error code has changedView Change Details
2023-03-02The Error code has changed. The request parameters of the API has changedView Change Details
2022-09-29Add OperationView Change Details