This topic describes how to manage message templates by calling related API operations.
Create a ChatApp message template
You can call this operation to create a ChatApp message template.
After the message template is created, it is automatically sent to Facebook for review. After the message template passes the review, you can use the template to send messages.
For more information about how to query the review status of the template, see the "Query the information about a ChatApp template" section of this topic.
Message templates are used to initiate conversations with customers. If you continuously receive negative feedback about a message template, the template may be disabled. After the template is disabled, you can no longer use this template to send messages to customers. Make sure that your template does not contain prohibited content.
API reference
Examples
Sample success responses in JSON format
{
"RequestId": "90E63D28-E31D-1EB2-8939-A948664****",
"Code": "OK",
"Message": "User not authorized to operate on the specified resource.",
"Data": {
"TemplateCode": "SMS_232907****",
"TemplateName": "hello_whatsapp"
}
}Modify a ChatApp message template
You can call this operation to modify a ChatApp message template.
Only templates that are not reviewed or fail reviews can be modified.
API reference
Examples
Sample success responses in JSON format
{
"RequestId": "90E63D28-E31D-1EB2-8939-A9486641****",
"Code": "OK",
"Message": "null",
"Data": {
"TemplateCode": "8472929283883",
"TemplateName": "hello_whatsapp"
}
}Delete a ChatApp message template
You can call this operation to delete a ChatApp message template.
API reference
Examples
Sample success responses in JSON format
{
"RequestId": "90E63D28-E31D-1EB2-8939-A9486641****",
"Code": "OK",
"Message": "User not authorized to operate on the specified resource."
}Query the information about a ChatApp template
You can call this operation to query the information about a ChatApp message template.
You can query the following information about the template: the name, review status, code, type, and language.
API reference
Examples
Sample success responses in JSON format
{
"RequestId": "744c4b5c79c9432497a075bdfca3****",
"Code": "OK",
"Message": "User not authorized to operate on the specified resource.",
"Data": {
"Category": "TRANSACTIONAL",
"TemplateCode": "744c4b5c79c9432497a075bdfca3****",
"Name": "hello_whatsapp",
"Language": "en_US",
"Example": {
"key": "{\\\"textVariable\\\":\\\"text\\\",\\\"linkVariable\\\":\\\"https://image.developer.aliy\\\"}"
},
"AuditStatus": "pass",
"Components": [
{
"Type": "BODY",
"Url": "https://image.developer.aliyundoc.com",
"Text": "Hello",
"Caption": "The new file has been uploaded.",
"FileName": "Express file",
"Format": "TEXT",
"Buttons": [
{
"Type": "PHONE_NUMBER",
"Text": "Make a phone call.",
"PhoneNumber": "861398745****",
"Url": "https://example.com\n",
"UrlType": "static"
}
],
"ThumbUrl": "https://img.png",
"Duration": 50,
"FileType": "docx"
}
],
"TemplateType": "WHATSAPP"
}
}Query a list of ChatApp message templates
You can call this operation to query a list of ChatApp message templates.
You can call this operation to query the following information about up to 10 templates at a time: the type, review status, name, and code.
API reference
Examples
Sample success responses in JSON format
{
"RequestId": "90E63D28-E31D-1EB2-8939-A9486641****",
"Code": "OK",
"Message": "User not authorized to operate on the specified resource.",
"ListTemplate": [
{
"TemplateName": "hello_whatsapp",
"TemplateCode": "744c4b5c79c9432497a075bdfca3****",
"AuditStatus": "pass",
"Language": "en",
"Category": "TRANSACTIONAL",
"TemplateType": "WHATSAPP"
}
]
}