Mengirim Paket ChatApp.
Deskripsi operasi
-
Call this operation to send messages. You can also send messages manually in the console at Channel Management > Manage > Message Sending.
-
Before calling this operation, you must create a channel and have an approved template.
-
For a WhatsApp channel, you must register and bind a WABA and add a phone number.
-
For a Messenger channel, you must connect to a Facebook Page.
-
For an Instagram channel, you must connect to an Instagram professional account.
-
For a Viber channel, you must apply for a service ID.
QPS limit
The QPS limit for this operation is 250 per user. API calls that exceed this limit are throttled. To prevent service disruptions, ensure your calls stay within this limit.
Status changes
You can receive notifications about message status changes by using MNS or HTTP callbacks. For more information, see message receipts.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cams:SendChatappMessage |
create |
*全部资源
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| ChannelType |
string |
Yes |
Tipe saluran. Nilai valid:
|
|
| Type |
string |
Yes |
Tipe Paket. Nilai valid:
Penting
Jika Anda mengatur . |
message |
| MessageType |
string |
No |
Tipe Paket yang digunakan saat . |
text |
| TemplateCode |
string |
No |
Kode templat Paket. Anda dapat menemukan kode tersebut di halaman Channel Management > Manage > Template Design. |
1119*************** |
| Language |
string |
No |
Bahasa templat Paket. Untuk daftar bahasa yang didukung dan kode yang sesuai, lihat kode bahasa. |
en |
| From |
string |
Yes |
Nomor atau ID pengirim.
|
861387777**** |
| To |
string |
Yes |
Nomor atau ID penerima.
|
861388988**** |
| TemplateParams |
object |
No |
Parameter untuk templat Paket. |
|
|
string |
No |
A key-value pair for a template parameter. The key is the parameter's name and the value is its corresponding value. |
{ "param1": "value1", "param2": "value2" } |
|
| Content |
string |
No |
Konten Paket, dalam format string JSON. Catatan untuk Paket WhatsApp:
Catatan untuk Paket Messenger:
Catatan untuk Paket Instagram:
Catatan untuk Paket Viber:
|
{ "text": "hello,whatsapp", "link": "https://*******", "caption": "****", "fileName": "****" } |
| Payload |
array |
No |
Array string data kustom yang dikirim ke webhook Anda saat pengguna mengklik tombol yang sesuai. |
payloadtext1,payloadtext2,payloadtext3 |
|
string |
No |
The payload for a button in the message template. |
payloadtext |
|
CustWabaId
deprecated
|
string |
No |
Tidak digunakan lagi. Gunakan |
cams-8c8********* |
| FallBackId |
string |
No |
ID strategi fallback. Parameter ini hanya tersedia di Situs Internasional dan dapat diabaikan jika Anda menggunakan Situs Tiongkok.Anda dapat menemukan ID strategi di halaman Fallback Policy.. |
S0**** |
| FallBackContent |
string |
No |
Konten kustom Paket fallback. Parameter ini hanya tersedia di Situs Internasional dan dapat diabaikan jika Anda menggunakan Situs Tiongkok. |
Fallback SMS |
IsvCode
deprecated
|
string |
No |
Tidak digunakan lagi. Kode verifikasi yang digunakan untuk mengotorisasi sub-akun ISV. Anda dapat mengabaikan parameter ini. |
123123****** |
| CustSpaceId |
string |
No |
ID Space sub-akun ISV. Untuk pelanggan langsung, ini adalah ID Instans. Anda dapat menemukan ID tersebut di halaman Channel Management. |
cams-8c8********* |
| ContextMessageId |
string |
No |
ID Paket yang Anda balas. |
61851ccb2f1365b16aee**** |
| TrackingData |
string |
No |
Data pelacakan kustom untuk Paket Viber. Parameter ini hanya tersedia di Situs Internasional dan dapat diabaikan jika Anda menggunakan Situs Tiongkok. |
Tracking Data |
| Label |
string |
No |
Tipe Paket Viber. Parameter ini hanya tersedia di Situs Internasional dan dapat diabaikan jika Anda menggunakan Situs Tiongkok. Nilai valid:
|
promotion |
| Ttl |
integer |
No |
pengatur waktu-to-live (TTL) untuk Paket Viber. Parameter ini hanya tersedia di Situs Internasional dan dapat diabaikan jika Anda menggunakan Situs Tiongkok.Unit: seconds. Nilai harus antara 30 dan 1209600.. |
50 |
| Tag |
string |
No |
Tag kustom untuk Paket Viber. |
tag |
| TaskId |
string |
No |
ID tugas kustom. |
10000**** |
| FallBackDuration |
integer |
No |
Durasi setelah fallback dipicu. Parameter ini hanya tersedia di Situs Internasional dan dapat diabaikan jika Anda menggunakan Situs Tiongkok.Jika tanda terima pengiriman tidak dikembalikan dalam periode yang ditentukan, fallback akan dipicu. Jika parameter ini dihilangkan, fallback hanya dipicu jika Paket gagal dikirim atau tanda terima pengiriman gagal dikembalikan. Unit: seconds. Nilai harus antara 60 dan 43200.. |
120 |
| ProductAction |
object |
No |
Informasi produk yang telah Anda unggah ke Meta. Parameter ini hanya berlaku untuk saluran WhatsApp. |
|
| ThumbnailProductRetailerId |
string |
No |
The product catalog ID. You can get this ID by calling the ListProductCatalog operation. |
skkks99**** |
| Sections |
array<object> |
No |
A list of product categories. You can specify up to 10 categories and a total of 30 products. |
|
|
array<object> |
No |
A product category. |
||
| Title |
string |
No |
The category name. You can find the name on the Channel Management > Manage > Catalog Management > Product Management page, or obtain it by calling the ListProduct operation. |
abcd |
| ProductItems |
array<object> |
No |
A list of product information. |
|
|
object |
No |
The product information. |
||
| ProductRetailerId |
string |
No |
The product ID. View the ID on the Channel Management > Manage > Catalog Management > Product Management page or get it by calling the ListProduct API. |
ksi3**** |
| FallBackRule |
string |
No |
Aturan fallback. Parameter ini hanya tersedia di Situs Internasional dan dapat diabaikan jika Anda menggunakan Situs Tiongkok. Nilai valid:
|
undelivered |
| FlowAction |
object |
No |
Objek Paket Flow. |
|
| FlowActionData |
object |
No |
A collection of default flow parameters. |
|
|
any |
No |
A default flow parameter in key-value format. The key is the parameter name, and the value is the parameter value. |
{ "name": "name" } |
|
| FlowToken |
string |
No |
The custom flow token. |
kde**** |
| TemplateName |
string |
No |
Nama templat. Anda dapat menemukan nama templat di halaman Channel Management > Manage > Template Design. |
test_name |
| RecipientType |
string |
No |
Tipe penerima. Nilai valid:
|
individual |
| MessageCampaignId |
string |
No |
ID kampanye Paket. Catatan
Parameter ini untuk pengujian internal, tidak tersedia secara umum, dan dapat diabaikan. |
123123******** |
| AdAccountId |
string |
No |
ID akun iklan Meta. Catatan
Parameter ini untuk pengujian internal, tidak tersedia secara umum, dan dapat diabaikan. |
123123******** |
| TokenType |
string |
No |
Tipe token. Catatan
Parameter ini untuk pengujian internal, tidak tersedia secara umum, dan dapat diabaikan. |
bearer |
| Category |
string |
No |
Kategori Paket untuk pengiriman WhatsApp langsung. Peringatan
Tentukan parameter ini hanya jika Anda adalah pelanggan yang diundang oleh Meta. Jika tidak, Paket mungkin gagal dikirim. . |
UTILITY |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
The response data. |
||
| AccessDeniedDetail |
string |
Details about the access denial. |
None |
| RequestId |
string |
The ID of the request. |
90E63D28-E31D-1EB2-8939-A94866****** |
| Message |
string |
The error message. |
User not authorized to operate on the specified resource. |
| Code |
string |
The status code of the request.
|
OK |
| MessageId |
string |
The ID of the message. |
61851ccb2f1365b16aee**** |
Contoh
Respons sukses
JSONformat
{
"AccessDeniedDetail": "None",
"RequestId": "90E63D28-E31D-1EB2-8939-A94866******",
"Message": "User not authorized to operate on the specified resource.",
"Code": "OK",
"MessageId": "61851ccb2f1365b16aee****"
}
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.