Sends a ChatApp message.
Operation description
-
You can call this API to send messages. You can also send messages manually on the Channel Management > Management > Send Messages page.
-
Before you call this API, make sure that you have created a channel and have an approved template.
-
For WhatsApp channels, you must complete WABA registration and attachment. You must also add a phone number.
-
For Messenger channels, you must connect a Facebook Page account.
-
For Instagram channels, you must connect a professional account.
-
For Viber channels, you must request a service ID.
QPS limits
The queries per second (QPS) limit for a single user on this API is 250. If you exceed this limit, API calls are throttled, which may affect your business. Call the API at a reasonable rate.
Status changes
You can monitor the message sending status using MNS or HTTP. For more information, see Message receipts.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cams:SendChatappMessage |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ChannelType |
string |
Yes |
The channel type. Valid values:
|
|
| Type |
string |
Yes |
The message type. Valid values:
Important If you set Type to template, you must set TemplateCode. If you set Type to message, you must set MessageType. |
message |
| MessageType |
string |
No |
The specific type of the message when Type is set to message. Valid values:
|
text |
| TemplateCode |
string |
No |
The template code. You can view the template code on the Channel Management > Management > Template Design page. |
1119*************** |
| Language |
string |
No |
The language. For a list of language codes, see Language codes. |
en |
| From |
string |
Yes |
The sender number.
|
861387777**** |
| To |
string |
Yes |
The recipient number.
|
861388988**** |
| TemplateParams |
object |
No |
The collection of template parameters. |
|
|
string |
No |
The template parameters. This is a key-value pair, where the key is the parameter name and the value is the parameter value. |
{ "param1": "value1", "param2": "value2" } |
|
| Content |
string |
No |
The message content. Notes on WhatsApp messages:
Notes on Messenger messages:
Notes on Instagram messages:
Notes on Viber messages:
|
{ "text": "hello,whatsapp", "link": "https://*******", "caption": "****", "fileName": "****" } |
| Payload |
array |
No |
The collection of messages that are triggered by buttons. |
payloadtext1,payloadtext2,payloadtext3 |
|
string |
No |
The message that is triggered by a button in the template. |
payloadtext |
|
CustWabaId
deprecated
|
string |
No |
The WABA ID of the ISV customer. This parameter is deprecated. Use CustSpaceId, which is the instance ID for direct customers. You can view the ID on the Channel Management page. |
cams-8c8********* |
| FallBackId |
string |
No |
The fallback strategy ID. This parameter is for the Alibaba Cloud International website. Users of the Alibaba Cloud China website can ignore this parameter. You can view the strategy ID on the Fallback Strategy page. |
S0**** |
| FallBackContent |
string |
No |
The custom fallback content. This parameter is for the Alibaba Cloud International website. Users of the Alibaba Cloud China website can ignore this parameter. |
Fallback SMS |
IsvCode
deprecated
|
string |
No |
The ISV verification code, which is used to verify whether a RAM user is authorized by the ISV. This parameter is deprecated and can be ignored. |
123123****** |
| CustSpaceId |
string |
No |
The SpaceId of the ISV sub-customer, which is the instance ID for direct customers. You can view the ID on the Channel Management page. |
cams-8c8********* |
| ContextMessageId |
string |
No |
The ID of the message to reply to. This refers to the ID of a message that has been sent or received. |
61851ccb2f1365b16aee**** |
| TrackingData |
string |
No |
The custom tracking data for Viber messages. This parameter is for the Alibaba Cloud International website. Users of the Alibaba Cloud China website can ignore this parameter. |
Tracking Data |
| Label |
string |
No |
The Viber message type. This parameter is for the Alibaba Cloud International website. Users of the Alibaba Cloud China website can ignore this parameter. Valid values:
|
promotion |
| Ttl |
integer |
No |
The timeout period for sending a Viber message. This parameter is for the Alibaba Cloud International website. Users of the Alibaba Cloud China website can ignore this parameter. Unit: seconds. Valid values: 30 to 1209600. |
50 |
| Tag |
string |
No |
The tag information. This is a custom tag for sending Viber messages. |
tag |
| TaskId |
string |
No |
The custom task ID. |
10000**** |
| FallBackDuration |
integer |
No |
The fallback trigger time. This parameter is for the Alibaba Cloud International website. Users of the Alibaba Cloud China website can ignore this parameter. If a delivery receipt is not returned for a message within the specified time, a fallback is triggered. If you leave this parameter empty, a fallback is triggered only when the message fails to be sent or a failed delivery report is received. Unit: seconds. Minimum value: 60. Maximum value: 43200. |
120 |
| ProductAction |
object |
No |
The product information. This parameter is only for WhatsApp channels. It refers to the product information that you uploaded to Meta. |
|
| ThumbnailProductRetailerId |
string |
No |
The product catalog ID. You can obtain it by calling the ListProductCatalog API. |
skkks99**** |
| Sections |
array<object> |
No |
The list of product categories. You can have up to 10 categories and 30 products. |
|
|
array<object> |
No |
A product category. |
||
| Title |
string |
No |
The category name. You can view the name on the Channel Management > Management > Catalog Management > Product Management page or obtain it by calling the ListProduct API. |
abcd |
| ProductItems |
array<object> |
No |
The list of product information. |
|
|
object |
No |
The product information. |
||
| ProductRetailerId |
string |
No |
The product ID. You can view the ID on the Channel Management > Management > Catalog Management > Product Management page or obtain it by calling the ListProduct API. |
ksi3**** |
| FallBackRule |
string |
No |
The fallback rule. This parameter is for the Alibaba Cloud International website. Users of the Alibaba Cloud China website can ignore this parameter. Valid values:
|
undelivered |
| FlowAction |
object |
No |
The Flow message object. |
|
| FlowToken |
string |
No |
The custom flow token information. |
kde**** |
| FlowActionData |
object |
No |
The collection of default flow parameters. |
|
|
string |
No |
The default flow parameters. This is a key-value pair, where the key is the parameter name and the value is the parameter value. |
{ "name": "name" } |
|
| TemplateName |
string |
No |
The template name. You can view the template name on the Channel Management > Management > Template Design page. |
test_name |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The returned data. |
||
| RequestId |
string |
The request ID. |
90E63D28-E31D-1EB2-8939-A94866****** |
| Code |
string |
The request status code.
|
OK |
| Message |
string |
The error message. |
User not authorized to operate on the specified resource. |
| MessageId |
string |
The message ID. |
61851ccb2f1365b16aee**** |
Examples
Success response
JSON format
{
"RequestId": "90E63D28-E31D-1EB2-8939-A94866******",
"Code": "OK",
"Message": "User not authorized to operate on the specified resource.",
"MessageId": "61851ccb2f1365b16aee****"
}
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.