All Products
Search
Document Center

ChatAPP:CreateChatappTemplate

Last Updated:Mar 16, 2023

Creates a message template. You can send messages after the template is approved.

Operation Description

QPS limit

You can call this operation up to five times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
CategorystringYes

The category of the message template. Valid values:

  • TRANSACTIONAL: a transactional template
  • MARKETING: a marketing template
  • OTP: a one-time password template
TRANSACTIONAL
ComponentsarrayYes

The components of the message template.

objectNo

The list of components.

TypestringYes

The type of the component. Valid values:

  • BODY
  • HEADER
  • FOOTER
  • BUTTONS
NoteA component of the BODY type cannot exceed 1,024 characters in length. A component of the HEADER or FOOTER type cannot exceed 60 characters in length.
BODY
TextstringNo

The text of the message to be sent.

hello whatsapp
FormatstringNo

The type of the media resources that are included in the message.

  • TEXT: text
  • IMAGE: image
  • DOCUMENT: document
  • VIDEO: video
TEXT
UrlstringNo

The URL of the material.

https://image.developer.aliyundoc.com
CaptionstringNo

The description of the file.

FileNamestringNo

The name of the file.

ButtonsarrayNo

The list of buttons, which applies only to the BUTTONS component.

objectNo

The definition of the button.

TypestringYes

The type of the button. Valid values:

  • PHONE_NUMBER: a phone number button
  • URL: a URL button
  • QUICK_REPLY: a quick reply button
Note
  • If you have created a website link or a phone number link, you cannot create an quick reply button.

  • You can add a combination of two URL buttons or a combination of a URL button and a phone number button to a message template.

PHONE_NUMBER
TextstringNo

The display name of the button.

Call Me
PhoneNumberstringNo

The mobile phone number. This parameter is valid only if the Type parameter is set to PHONE_NUMBER.

+861368897****
UrlstringNo

The URL to be accessed when users click the URL button.

https://example.com
UrlTypestringNo

The type of the URL. Valid values:

  • static: a static URL
  • dynamic: a dynamic URL
static
NamestringYes

The name of the message template.

hello_whatsapp
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. This parameter is specified when the original JSON structure is converted into a string.

{"textVariable":"text"}
TemplateTypestringYes

The type of the message template.

  • WHATSAPP
  • viber. The feature that ChatApp sends messages by using Viber is under development.
  • line. The feature that ChatApp sends messages by using Line is under development.
WHATSAPP
CustWabaIdstringNo

The ID of the WhatsApp account that you register.

65921621816****
IsvCodestringNo

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

skdi3kksloslikdkkdk
CustSpaceIdstringNo

The space ID of the user under the ISV account.

28251486512358****

Response parameters

ParameterTypeDescriptionExample
object

The data returned.

RequestIdstring

The ID of the request.

90E63D28-E31D-1EB2-8939-A94866411B2D
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.

User not authorized to operate on the specified resource.
Dataobject

The data returned.

TemplateCodestring

The code of the message template.

SMS_232907****
TemplateNamestring

The name of the message template.

hello_whatsapp

Examples

Sample success responses

JSONformat

{
  "RequestId": "90E63D28-E31D-1EB2-8939-A94866411B2D",
  "Code": "OK",
  "Message": "User not authorized to operate on the specified resource.",
  "Data": {
    "TemplateCode": "SMS_232907****",
    "TemplateName": "hello_whatsapp"
  }
}

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
No change history