Call SendChatappMessage to send template or custom WhatsApp messages through Chat App Message Service.
API description
Call SendChatappMessage to send WhatsApp messages.
Rate limit: 250 requests per second per account. Exceeding this limit triggers throttling.
Debugging
Call this operation in OpenAPI Explorer, which calculates signatures and generates SDK sample code automatically.
Authorization information
No authorization information is disclosed for this API.
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
|||
|
ChannelType |
string |
Yes |
The channel type. Set to whatsapp. |
|
|||
|
Type |
string |
Yes |
The message type. Valid values:
|
template |
|||
|
MessageType |
string |
No |
The message subtype. Valid values when Type is set to message:
Note
For more information, see Message template parameters. |
text |
|||
|
TemplateCode |
string |
No |
The message template code. Required when Type is template. |
744c4b5c79c9432497a075bdfca3**** |
|||
|
Language |
string |
No |
The message template language. Required when Type is template. For supported language codes, see Language codes. |
en |
|||
|
From |
string |
Yes |
The sender's phone number. Note
Must be a WhatsApp-registered number approved in the Chat App Message Service console. |
861360000**** |
|||
|
To |
string |
Yes |
The recipient's phone number. |
861390000**** |
|||
|
TemplateParams |
object |
No |
The variables of the message template. |
||||
|
string |
No |
The template variable values in JSON format. Required if the template contains variables. |
{"param1":"value1","param2":"value2"} |
||||
|
Content |
string |
No |
The message content.
|
{"text": "hello whatsapp", "link": "", "caption": "", "fileName": "" } |
|||
|
Payload |
array |
No |
The payload of the button. |
||||
|
string |
No |
The payload of the button in the message template. |
payloadtext1,payloadtext2,payloadtext3 |
||||
|
FallBackId |
string |
No |
The fallback policy ID. Create and view fallback policies in the Chat App Message Service console. |
S_000001 |
|||
|
FallBackContent |
string |
No |
The content of the fallback message. |
This is a fallback message. |
|||
|
CustSpaceId |
string |
No |
The space ID of the RAM user. |
28251486512358**** |
|||
|
ContextMessageId |
string |
No |
The ID of the reply message. |
61851ccb2f1365b16aee**** |
|||
|
TaskId |
string |
No |
The task ID |
100000001 |
|||
|
FallBackDuration |
integer |
No |
The timeout in seconds before sending the fallback message if no delivery receipt is received. If not set, the fallback is sent only when the message fails to send or a non-delivery receipt is received. Valid values: 60 to 43200. Unit: seconds. |
120 |
|||
|
FallBackRule |
string |
No |
The fallback rule. Valid values:
|
undelivered |
|||
|
ProductAction |
object |
No |
Product information for WhatsApp catalog messages or multi-product messages (MPM). |
||||
|
ThumbnailProductRetailerId |
string |
No |
The retailer ID of the product. |
S238SK |
|||
|
Sections |
object [] |
No |
The product list. Up to 30 products and 10 categories. |
||||
|
Title |
string |
No |
The product category. |
Test |
|||
|
ProductItems |
object [] |
No |
The products. |
||||
|
ProductRetailerId |
string |
No |
The retailer ID of the product. |
9I39E9E |
|||
|
FlowAction |
object |
No |
The flow action. |
||||
|
FlowToken |
string |
No |
The flow token. |
1122*** |
|||
|
FlowActionData |
object |
No |
The default parameters of the flow. |
||||
|
string |
No |
The default parameter of the flow. |
{"name":"test"} |
||||
Response parameters
|
Parameter |
Type |
Description |
Example |
|
object |
The response data. |
||
|
RequestId |
string |
The request ID. |
90E63D28-E31D-1EB2-8939-A94866411B2O |
|
Code |
string |
The response status code.
|
OK |
|
Message |
string |
The error message. |
User not authorized to operate on the specified resource. |
|
MessageId |
string |
The sent message ID. |
61851ccb2f1365b16aee**** |
Examples
Sample success responses
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 |
|
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. |
For a list of error codes, visit Service error codes.