Sends a Chat App Message Service message.
Operation description
-
You can call this operation to send a message, or manually send a message on the Channel Management > Management > Send Message page.
-
Before calling this operation, make sure that you have created a channel and have an approved template.
-
For the WhatsApp channel type, you must complete WABA registration and bindng and add a phone number.
-
For the Messenger channel type, you must complete connecting a public page account.
-
For the Instagram channel type, you must complete connecting a professional account.
-
For the Viber channel type, you must complete applying for a service ID.
QPS limit
The single-user QPS limit for this operation is 250 calls per second. If this limit is exceeded, the API calls are throttled, which may affect your business. Call this operation as needed.
Status changes
You can monitor message delivery status through MNS or HTTP. For more information, see Receipt messages.
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 Type is set to template, you must specify TemplateCode. If Type is set to message, you must specify MessageType. |
message |
| MessageType |
string |
No |
The detailed message type 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 parameter. The parameter is in key-value format, where Key is the parameter name and Value is the parameter value. |
{ "param1": "value1", "param2": "value2" } |
|
| Content |
string |
No |
The message content. WhatsApp message notes:
Messenger message notes:
Instagram message notes:
Viber message notes:
|
{ "text": "hello,whatsapp", "link": "https://*******", "caption": "****", "fileName": "****" } |
| Payload |
array |
No |
The collection of button trigger messages. |
payloadtext1,payloadtext2,payloadtext3 |
|
string |
No |
The trigger message of a button in the template. |
payloadtext |
|
CustWabaId
deprecated
|
string |
No |
The ISV customer WABA ID. This parameter is deprecated. Use CustSpaceId instead, which is the direct customer instance ID. You can view it on the Channel Management page. |
cams-8c8********* |
| FallBackId |
string |
No |
The fallback policy ID. This parameter is for the China site (Chinese mainland). China site users can ignore this parameter. You can view the policy ID on the Fallback Policy page. |
S0**** |
| FallBackContent |
string |
No |
The custom fallback content. This parameter is for the China site (Chinese mainland). China site users can ignore this parameter. |
Fallback SMS |
IsvCode
deprecated
|
string |
No |
The ISV verification code 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, or the direct customer instance ID. You can view it on the Channel Management page. |
cams-8c8********* |
| ContextMessageId |
string |
No |
The ID of the message to reply to. This is the ID of a previously sent or received message. |
61851ccb2f1365b16aee**** |
| TrackingData |
string |
No |
The custom tracking data passed in for Viber message types. This parameter is for the international site. China site users can ignore this parameter. |
Tracking Data |
| Label |
string |
No |
The Viber message type. This parameter is for the international site. China site users can ignore this parameter. Valid values:
|
promotion |
| Ttl |
integer |
No |
The timeout period for Viber message delivery. This parameter is for the international site. China site users can ignore this parameter. Unit: seconds. Valid values: 30 to 1209600. |
50 |
| Tag |
string |
No |
The tag information. Custom tag information for Viber message delivery. |
tag |
| TaskId |
string |
No |
The custom task ID. |
10000**** |
| FallBackDuration |
integer |
No |
The fallback trigger time. This parameter is for the international site. China site users can ignore this parameter. If the message does not return a delivered receipt within the specified time, fallback is triggered. If this parameter is not specified, fallback is not triggered based on time and occurs only when the message fails to send or a failure status report is received. Unit: seconds. Minimum value: 60. Maximum value: 43200. |
120 |
| ProductAction |
object |
No |
The product information. This parameter applies only to the WhatsApp channel type and refers to the product information you uploaded on Meta. |
|
| ThumbnailProductRetailerId |
string |
No |
The product catalog ID. You can obtain this ID by calling the ListProductCatalog operation. |
skkks99**** |
| Sections |
array<object> |
No |
The list of product categories (up to 10 categories and 30 products). |
|
|
array<object> |
No |
The product category. |
||
| Title |
string |
No |
The category name. You can view it on the Channel Management > Management > Catalog Management > Product Management page, or obtain it by calling the ListProduct operation. |
abcd |
| ProductItems |
array<object> |
No |
The list of product information. |
|
|
object |
No |
The product information. |
||
| ProductRetailerId |
string |
No |
The product ID. You can find the ID on the Channel Management > Manage > Catalog Management > Product Management page, or obtain it by calling the ListProduct operation. |
ksi3**** |
| FallBackRule |
string |
No |
The fallback rule. This parameter is for the international site. China site users can ignore this parameter. Valid values:
|
undelivered |
| FlowAction |
object |
No |
The Flow message object. |
|
| FlowActionData |
object |
No |
The collection of Flow default parameters. |
|
|
any |
No |
The Flow default parameter. The parameter is in key-value format, where Key is the parameter name and Value is the parameter value. |
{ "name": "name" } |
|
| FlowToken |
string |
No |
The custom Flow token information. |
kde**** |
| TemplateName |
string |
No |
The template name. You can view the template name on the Channel Management > Management > Template Design page. |
test_name |
| RecipientType |
string |
No |
The recipient type. Valid values:
|
individual |
| MessageCampaignId |
string |
No |
The campaign message ID. Note
This parameter is a test parameter that is not fully available. Ignore this parameter. |
123123******** |
| AdAccountId |
string |
No |
The Meta ad account ID. Note
This parameter is a test parameter that is not fully available. Ignore this parameter. |
123123******** |
| TokenType |
string |
No |
The token type. Note
This parameter is a test parameter that is not fully available. Ignore this parameter. |
bearer |
| Category |
string |
No |
The message category (for WhatsApp direct send). Warning Do not specify this parameter unless you are a Meta-invited customer. Otherwise, message delivery will fail. |
UTILITY |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| AccessDeniedDetail |
string |
The access denied details. |
None |
| RequestId |
string |
The request ID. |
90E63D28-E31D-1EB2-8939-A94866****** |
| Message |
string |
The error message. |
User not authorized to operate on the specified resource. |
| Code |
string |
The response code.
|
OK |
| MessageId |
string |
The message ID. |
61851ccb2f1365b16aee**** |
Examples
Success response
JSON format
{
"AccessDeniedDetail": "None",
"RequestId": "90E63D28-E31D-1EB2-8939-A94866******",
"Message": "User not authorized to operate on the specified resource.",
"Code": "OK",
"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.