All Products
Search
Document Center

Chat App Message Service:CreateChatappTemplate

Last Updated:Jun 10, 2026

Membuat Templat Paket. Setelah Templat disetujui, Anda dapat menggunakannya untuk mengirim Paket.

Deskripsi operasi

QPS limit

The queries per second (QPS) limit for this API operation is 50 for a single user. If you exceed the limit, API calls are rate-limited, which may affect your business. We recommend that you call this operation at a reasonable frequency.

Status change

You can monitor template status and quality changes using Message Service (MNS) or HTTP. For more information, see Message receipts.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

cams:CreateChatappTemplate

create

*全部资源

*

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

Category

string

Yes

Kategori templat WhatsApp:

  • UTILITY: Transaksional.

  • MARKETING: Pemasaran.

  • AUTHENTICATION: Otentikasi.

Kategori templat Viber:

  • UTILITY: Transaksional.

  • MARKETING: Pemasaran.

  • AUTHENTICATION: Otentikasi.

UTILITY

Components

array<object>

Yes

Daftar Komponen Templat Paket.

Catatan

Saat Category diatur ke AUTHENTICATION, array Components tidak boleh berisi Komponen bertipe HEADER. Jika tipe Komponen adalah BODY atau FOOTER, parameter Text harus kosong.

array<object>

No

The list of components.

Type

string

Yes

The component type. Valid values:

  • BODY

  • HEADER

  • FOOTER

  • BUTTONS

  • CAROUSEL

  • LIMITED_TIME_OFFER

Catatan
  • For WhatsApp templates, the BODY component can contain up to 1,024 characters. The HEADER and FOOTER components can contain up to 60 characters.

  • For Viber templates, the FOOTER, CAROUSEL, and LIMITED_TIME_OFFER types are invalid.

  • For Viber templates, images, videos, and files are placed in the HEADER component. The client displays the image below the text. The text is placed in the BODY component.

BODY

Text

string

No

The text of the message to send.

Catatan

For WhatsApp templates, if Category is set to AUTHENTICATION, this parameter is empty.

hello whatsapp

Format

string

No

The type of the media resource.

  • TEXT: text

  • IMAGE: image

  • DOCUMENT: document

  • VIDEO: video

TEXT

Url

string

No

The path of the media resource.

Catatan

For Viber templates, the recommended image size is 800 × 800 pixels.

https://image.developer.aliyundoc.com

Caption

string

No

The description of the file.

This is a video

FileName

string

No

The name of the file.

Express delivery video

Buttons

array<object>

No

The list of buttons. This parameter applies only to the BUTTONS component.

Catatan

Number of buttons for WhatsApp

  • For MARKETING or UTILITY templates, you can add up to 10 buttons.

  • You can add only one button of the PHONE_NUMBER type.

  • You can add up to two buttons of the URL type.

  • Buttons of the QUICK_REPLY type cannot be mixed with buttons of the PHONE_NUMBER or URL type.

Catatan

Number of buttons for Viber

  • Only one button of the URL type is allowed.

  • If the HEADER component contains a video, the button type is URL, but you cannot set a URL.

array<object>

No

The button definition.

Type

string

Yes

The button type.

  • PHONE_NUMBER: A call button.

  • URL: A URL button.

  • QUICK_REPLY: A quick reply button.

  • COPY_CODE: A button to copy a verification code or coupon code.

  • ONE_TAP: An autofill button for AUTHENTICATION templates.

  • ZERO_TAP: An autofill button for AUTHENTICATION templates.

  • MPM: A multi-product message.

  • CATALOG: A catalog.

  • FLOW: Opens a WhatsApp flow.

Catatan
  • For WhatsApp templates, if Category is set to AUTHENTICATION, only one button is allowed. The button type must be COPY_CODE or ONE_TAP. If you set the button type to COPY_CODE, the Text parameter is required. If you set the button type to ONE_TAP, the Text (the name of the copy code button displayed on the client if the destination app is not installed), SignatureHash, PackageName, and AutofillText parameters are required.

  • For Viber templates, only one button is allowed, and it must be of the URL type.

PHONE_NUMBER

Text

string

No

The name displayed on the button.

Call Me

PhoneNumber

string

No

The phone number. This parameter is valid only when the button type is PHONE_NUMBER.

+861368897****

Url

string

No

The URL that is visited when the URL button is clicked.

https://example.com

UrlType

string

No

The URL type.

  • static: Static

  • dynamic: Dynamic

static

SignatureHash deprecated

string

No

Use the properties under SupportedApps.

wi299382

PackageName deprecated

string

No

Use the properties under SupportedApps.

com.demo

AutofillText

string

No

This parameter is required for WhatsApp templates when Category is set to AUTHENTICATION and the button type is ONE_TAP or ZERO_TAP. It specifies the button text for the WhatsApp autofill action.

Autofill

IsOptOut

boolean

No

This parameter is valid for WhatsApp templates when Category is set to Marketing and the button type is QUICK_REPLY. It indicates that the button is a marketing opt-out button. If a customer clicks this button and you have configured sending control operations in ChatApp, subsequent marketing messages will not be sent to the customer.

false

CouponCode

string

No

The value of the coupon code. It supports only letters and digits. You can pass a variable such as $(couponCode) and then pass the actual coupon code when sending the message.

120293

FlowId

string

No

The flow ID.

479884093605****

FlowAction

string

No

The flow data event type. Valid values:

  • DATA_EXCHANGE: Data exchange.

  • NAVIGATE: Navigation.

NAVIGATE

NavigateScreen

string

No

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

DETAILS

SupportedApps

array<object>

No

The list of supported apps.

object

No

SignatureHash

string

No

This parameter is required for WhatsApp templates when Category is set to AUTHENTICATION and the button type is ONE_TAP or ZERO_TAP. It specifies the signature hash of the app that WhatsApp will launch.

ieid83kdiek

PackageName

string

No

This parameter is required for WhatsApp templates when Category is set to AUTHENTICATION and the button type is ONE_TAP or ZERO_TAP. It specifies the package name of the app that WhatsApp will launch.

com.kuaidian.waimaistaff

ThumbUrl

string

No

The thumbnail of a Viber message that contains a video.

https://cdn.multiplymall.mobiapp.cloud/yunmall/B-LM-LMALL202207130001/20220730/d712a057-a6af-4513-bbe6-7ee57ea60983.png?x-oss-process=image/resize,w_100

Duration

integer

No

The duration of the video in a Viber video message, in seconds. The value ranges from 0 to 600.

120

FileType

string

No

The file type of a Viber file message.

docx

CodeExpirationMinutes

integer

No

The validity period of the verification code for a WhatsApp AUTHENTICATION template, in minutes. This parameter is valid only for WhatsApp messages when Category is set to AUTHENTICATION and the component type is Footer. This information is displayed in the footer.

5

AddSecretRecommendation

boolean

No

This parameter is valid for WhatsApp templates when Category is set to AUTHENTICATION and the component type is Body. It indicates that a security recommendation is displayed above the body, advising the user not to share the verification code.

true

HasExpiration

boolean

No

Indicates whether the coupon code has an expiration time. This parameter is used when type is set to LIMITED_TIME_OFFER.

true

Cards

array<object>

No

The list of cards for a carousel template.

array<object>

No

The card object for a carousel template.

CardComponents

array<object>

Yes

The list of controls in the carousel card.

array<object>

No

The card object in the carousel template.

Type

string

Yes

The component type. Valid values:

  • BODY

  • HEADER

  • BUTTONS

BODY

Format

string

No

The type of the media resource. This parameter is valid when Type is set to HEADER.

  • IMAGE: image

  • VIDEO: video

IMAGE

Text

string

No

The content of the BODY component in the carousel card.

Who is the very powerful team

Url

string

No

The path of the media resource.

https://alibaba.com/img.png

Buttons

array<object>

No

The list of buttons. This parameter applies only to the BUTTONS component. Each card in a carousel can have a maximum of two buttons.

object

No

The button object.

Text

string

No

The button text.

Call me

Type

string

Yes

The button type.

  • PHONE_NUMBER: A call button.

  • URL: A URL button.

  • QUICK_REPLY: A quick reply button.

PHONE_NUMBER

Url

string

No

The URL that is visited when the button is clicked.

https://alibaba.com/xx

UrlType

string

No

The URL type.

  • static: Static

  • dynamic: Dynamic

static

PhoneNumber

string

No

The phone number.

+86138007****

Name

string

Yes

Nama templat.

hello_whatsapp

Language

string

Yes

Bahasa templat. Untuk informasi selengkapnya tentang kode bahasa, lihat Kode bahasa.

en

Example

object

No

Contoh cara membuat templat.

hello_whatsapp

string

No

An example of how to create a template.

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

TemplateType

string

Yes

Tipe templat.

  • WHATSAPP

  • VIBER.

WHATSAPP

CustWabaId deprecated

string

No

ID WhatsApp Business Account (WABA) pelanggan independent software vendor (ISV).

Catatan

Parameter ini tidak digunakan lagi. Gunakan CustSpaceId sebagai gantinya.

65921621816****

IsvCode

string

No

Kode verifikasi ISV, digunakan untuk memverifikasi apakah Pengguna RAM diberi otorisasi oleh ISV.

skdi3kksloslikdkkdk

CustSpaceId

string

Yes

ID Space pelanggan sub-ISV atau ID instans pelanggan langsung.

293483938849493

AllowCategoryChange deprecated

boolean

No

Apakah akan mengizinkan Facebook untuk mengubah kategori Templat secara otomatis. Hal ini dapat meningkatkan laju persetujuan Templat. Parameter ini hanya valid saat TemplateType diatur ke WHATSAPP.

Penting Properti ini tidak digunakan lagi. WhatsApp tidak lagi mendukung properti ini.
.

true

MessageSendTtlSeconds

integer

No

Pengatur waktu-to-live (TTL) Templat Paket di WhatsApp.

  • Untuk Templat AUTHENTICATION, nilai berkisar dari 30 hingga 900.

  • Untuk Templat UTILITY, nilai berkisar dari 30 hingga 43200.

120

Elemen respons

Element

Type

Description

Example

object

The returned data.

RequestId

string

The request ID.

90E63D28-E31D-1EB2-8939-A94866411B2D

Code

string

The status code of the request.

  • An `OK` response indicates that the request was successful.

  • For other error codes, see API error codes.

OK

Message

string

The error message.

User not authorized to operate on the specified resource.

Data

object

The returned data.

{"templateCode": "****4b5c79c9432497a075bdfca36bf5","templateName": "hello_whatsapp"}

TemplateCode

string

The template code.

SMS_232907****

TemplateName

string

The template name.

hello_whatsapp

AccessDeniedDetail

string

The details about the access denial.

None

Contoh

Respons sukses

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"
  },
  "AccessDeniedDetail": "None"
}

Kode kesalahan

HTTP status code

Error code

Error message

Description

400 Product.Unsubscript 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.
400 Unknown.ResourceOwnerId The resource does not belong to the current user.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.