Sends messages by using ChatAPP.
Operation description
You can call this operation up to 200 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
cams:SendChatappMessage | create | *All Resources * |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ChannelType | string | Yes | The channel type. Valid values:
| |
Type | string | Yes | The message type. Valid values:
| template |
MessageType | string | No | The specific type of the message. This parameter is required only if you set the Type parameter to message. Valid values of MessageType when you set the ChannelType parameter to whatsapp:
Valid values of MessageType when you set the ChannelType parameter to viber:
Note
For more information, see Parameters of a message template.
| text |
TemplateCode | string | No | The code of the message template. This parameter is required only if you set the Type parameter to template. | 744c4b5c79c9432497a075bdfca3**** |
Language | string | No | The language that is used in the message template. This parameter is required only if you set the Type parameter to template. For more information about language codes, see Language codes. | en |
From | string | Yes | The mobile phone number of the message sender. Note
You can specify a mobile phone number that is registered for a WhatsApp account and is approved in the Chat App Message Service console.
| 1360000**** |
To | string | Yes | The mobile phone number of the message receiver. | 1390000**** |
TemplateParams | object | No | The variables of the message template. | |
string | No | The values of the variables that are included in the message template. The values must be in the JSON format. If a variable exists in the template, this parameter is required. | {"param1":"value1","param2":"value2"} | |
Content | string | No | The message content. Notes on WhatsApp messages:
Notes on Viber messages:
| {\"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 | |
CustWabaIddeprecated | string | No | The WhatsApp Business Account (WABA) ID of the RAM user within the independent software vendor (ISV) account. Note
CustWabaId is an obsolete parameter. Use CustSpaceId instead.
| 65921621816**** |
FallBackId | string | No | The ID of the fallback policy. You can create a fallback policy and view the information in the Chat App Message Service console. | S_000001 |
FallBackContent | string | No | The content of the fallback message. | This is a fallback message. |
IsvCode | string | No | The ISV verification code. This parameter is used to verify whether the RAM user is authorized by the ISV account. | skdi3kksloslikdkkdk |
CustSpaceId | string | No | The space ID of the user. | 28251486512358**** |
ContextMessageId | string | No | The ID of the reply message. | 61851ccb2f1365b16aee**** |
TrackingData | string | No | The tracking data of the Viber message. | tracking_id:123456 |
Label | string | No | The type of the Viber message. This parameter is required if ChannelType is set to viber. Valid values:
| promotion |
Ttl | integer | No | The timeout period for sending the Viber message. Valid values: 30 to 1209600. Unit: seconds. | 50 |
Tag | string | No | The tag information of the Viber message. | tag |
TaskId | string | No | The task ID. | 100000001 |
FallBackDuration | integer | No | Specifies the period of time after which the fallback message is sent if the message receipt that indicates the message is delivered to clients is not received. If this parameter is left empty, the fallback message is sent only when the message fails to be sent or the message receipt that indicates the message is not delivered to clients is received. Unit: seconds. Valid values: 60 to 43200. | 120 |
ProductAction | object | No | The information about the products included in the WhatsApp catalog message or multi-product message (MPM). | |
ThumbnailProductRetailerId | string | No | The retailer ID of the product. | S238SK |
Sections | array<object> | No | The products. Up to 30 products and 10 categories can be added. | |
object | No | The category of the product. | ||
Title | string | No | The name of the category. | Test |
ProductItems | array<object> | No | The products. | |
object | No | The product information. | ||
ProductRetailerId | string | No | The retailer ID of the product. | 9I39E9E |
FallBackRule | string | No | The fallback rule. Valid values:
| undelivered |
FlowAction | object | No | The Flow action. | |
FlowToken | string | No | The Flow token. | 1122*** |
FlowActionData | object | No | The default parameter of the Flow. | |
string | No | The default parameter of the Flow. | {"name":"test"} | |
TemplateName | string | No | The name of the message template. | test_name |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "90E63D28-E31D-1EB2-8939-A94866411B2O",
"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 the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-04-10 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2024-03-14 | The Error code has changed | View Change Details |
2023-11-21 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2023-09-21 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2023-08-01 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2023-04-13 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2023-03-02 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2022-09-20 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2022-07-15 | The Error code has changed. The request parameters of the API has changed | View Change Details |