register_msg_template_for_approval
Create and register a WhatsApp message template for approval by specifying template name, language, category, and structured message components like BODY, HEADER, and BUTTONS.
Instructions
creates and registers a new whatsapp message template for approval.
Args:
template_name (str): name of the whatsapp message template, It only accepts a single word without no special characters except underscores
language (str): language of the whatsapp message template (default is "en")
category (str): category of the whatsapp message template (default is "MARKETING"), other possible values are "UTILITY", "AUTHENTICATION"
message_content_components (dict): the message content that needs to be sent. It needs to be structured like the below example,
components are required to have BODY component at least, like this: {"type": "BODY", "text": "lorem body text"}, BODY component is for the simple text.
All other components are optional.
HEADER component can have any of the below format, but only one format at a time can be used.: TEXT(the header component with TEXT needs to be like this
{
"type": "HEADER",
"format": "TEXT",
"text": "lorem header text"
}
), VIDEO(the header component with VIDEO needs to be like this
{
"type":"HEADER",
"format":"VIDEO",
"example":{
"header_handle":[
"https://sample_video_url.jpg"
]
}
}
)
, IMAGE(the header component with IMAGE needs to be like this
{
"type":"HEADER",
"format":"IMAGE",
"example":{
"header_handle":[
"https://sample_image_url.jpg"
]
}
}),
DOCUMENT (the header component with DOCUMENT needs to be like this
{
"type":"HEADER",
"format":"DOCUMENT",
"example":{
"header_handle":[
"https://sample_document_url"
]
}
}),
message_content_components value with all other type of components is mentioned below.
[
{
"type": "HEADER",
"format": "TEXT",
"text": "lorem header text"
},
{
"type": "BODY",
"text": "lorem body text"
},
{
"type": "FOOTER",
"text": "lorem footer text"
},
{
"type": "BUTTONS",
"buttons": [
{
"type": "QUICK_REPLY",
"text": "lorem reply bt"
},
{
"type": "URL",
"text": "cta",
"url": "https:sample.in"
},
{
"type": "PHONE_NUMBER",
"text": "call ",
"phone_number": "IN328892398"
}
]
}
]
Buttons need to follow order of first QUICK_REPLY, then URL, and then PHONE_NUMBER.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
category | No | MARKETING | |
language | No | en | |
message_content_components | Yes | ||
template_name | Yes |
Input Schema (JSON Schema)
{
"properties": {
"category": {
"default": "MARKETING",
"title": "Category",
"type": "string"
},
"language": {
"default": "en",
"title": "Language",
"type": "string"
},
"message_content_components": {
"items": {
"additionalProperties": true,
"type": "object"
},
"title": "Message Content Components",
"type": "array"
},
"template_name": {
"title": "Template Name",
"type": "string"
}
},
"required": [
"template_name",
"message_content_components"
],
"type": "object"
}