Creates a message template. You can send messages after the template is approved.
Operation Description
QPS limit
You can call this operation up to five 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.
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
Category | string | Yes | The category of the message template. Valid values:
| TRANSACTIONAL |
Components | array | Yes | The components of the message template. | |
object | No | The list of components. | ||
Type | string | Yes | The type of the component. Valid values:
NoteA component of the BODY type cannot exceed 1,024 characters in length. A component of the HEADER or FOOTER type cannot exceed 60 characters in length. | BODY |
Text | string | No | The text of the message to be sent. | hello whatsapp |
Format | string | No | The type of the media resources that are included in the message.
| TEXT |
Url | string | No | The URL of the material. | https://image.developer.aliyundoc.com |
Caption | string | No | The description of the file. | |
FileName | string | No | The name of the file. | |
Buttons | array | No | The list of buttons, which applies only to the BUTTONS component. | |
object | No | The definition of the button. | ||
Type | string | Yes | The type of the button. Valid values:
Note
| PHONE_NUMBER |
Text | string | No | The display name of the button. | Call Me |
PhoneNumber | string | No | The mobile phone number. This parameter is valid only if the Type parameter is set to PHONE_NUMBER. | +861368897**** |
Url | string | No | The URL to be accessed when users click the URL button. | https://example.com |
UrlType | string | No | The type of the URL. Valid values:
| static |
Name | string | Yes | The name of the message template. | hello_whatsapp |
Language | string | Yes | The language that is used in the message template. For more information, see Language codes. | en |
Example | object | No | The examples of variables that are used when you create the message template. | |
string | No | The examples of variables. This parameter is specified when the original JSON structure is converted into a string. | {"textVariable":"text"} | |
TemplateType | string | Yes | The type of the message template.
| |
CustWabaId | string | No | The ID of the WhatsApp account that you register. | 65921621816**** |
IsvCode | string | No | The ISV verification code, which is used to verify whether the user is authorized by the ISV account. | skdi3kksloslikdkkdk |
CustSpaceId | string | No | The space ID of the user under the ISV account. | 28251486512358**** |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "90E63D28-E31D-1EB2-8939-A94866411B2D",
"Code": "OK",
"Message": "User not authorized to operate on the specified resource.",
"Data": {
"TemplateCode": "SMS_232907****",
"TemplateName": "hello_whatsapp"
}
}
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 |
---|