Step 1: Creating a Marketing Template
{
"name": "my_template",
"language": "en_US",
"category": "MARKETING",
"components": [
{
"type": "HEADER",
"format": "TEXT",
"text": "Our {{1}} is on!",
"example": {
"header_text": [
"Summer Sale"
]
}
},
{
"type": "BODY",
"text": "Shop now through {{1}} and use code {{2}} to get {{3}} off of all merchandise.",
"example": {
"body_text": [
[
"the end of August",
"25OFF",
"25%"
]
]
}
},
{
"type": "FOOTER",
"text": "Use the buttons below to manage your marketing subscriptions"
},
{
"type": "BUTTONS",
"buttons": [
{
"type": "QUICK_REPLY",
"text": "Unsubscribe from Promos"
},
{
"type": "QUICK_REPLY",
"text": "Unsubscribe from All"
}
]
}
]
}
Example Request to Create a Marketing Template
POST https://client.waabot.com/api/v2/template
Content-Type: application/json
{
"name": "my_template",
"language": "en_US",
"category": "MARKETING",
"components": [
{
"type": "HEADER",
"format": "TEXT",
"text": "Our {{1}} is on!",
"example": {
"header_text": [
"Summer Sale"
]
}
},
{
"type": "BODY",
"text": "Shop now through {{1}} and use code {{2}} to get {{3}} off of all merchandise.",
"example": {
"body_text": [
[
"the end of August",
"25OFF",
"25%"
]
]
}
},
{
"type": "FOOTER",
"text": "Use the buttons below to manage your marketing subscriptions"
},
{
"type": "BUTTONS",
"buttons": [
{
"type": "QUICK_REPLY",
"text": "Unsubscribe from Promos"
},
{
"type": "QUICK_REPLY",
"text": "Unsubscribe from All"
}
]
}
]
}
Upon successful creation of a template, you will receive a response similar to the following:
{
"msg": "template created successfully",
"data": {
"name": "my_test_template",
"category": "MARKETING",
"library_template_button_inputs": [],
"language": "en_US",
"components": [
{
"type": "HEADER",
"format": "TEXT",
"text": "Our {{1}} is on!",
"example": {
"header_text": [
"Summer Sale"
],
"header_handle": [],
"body_text": []
},
"_id": "665fb8c106668cd0221d6db3",
"buttons": []
},
{
"type": "BODY",
"text": "Shop now through {{1}} and use code {{2}} to get {{3}} off of all merchandise.",
"example": {
"body_text": [
[
"the end of August",
"25OFF",
"25%"
]
],
"header_text": [],
"header_handle": []
},
"_id": "665fb8c106668cd0221d6db4",
"buttons": []
},
{
"type": "FOOTER",
"text": "Use the buttons below to manage your marketing subscriptions",
"example": {
"header_text": [],
"header_handle": [],
"body_text": []
},
"_id": "665fb8c106668cd0221d6db5",
"buttons": []
},
{
"type": "BUTTONS",
"example": {
"header_text": [],
"header_handle": [],
"body_text": []
},
"buttons": [
{
"type": "QUICK_REPLY",
"text": "Unsubscribe from Promos",
"_id": "665fb8c106668cd0221d6db7"
},
{
"type": "QUICK_REPLY",
"text": "Unsubscribe from All",
"_id": "665fb8c106668cd0221d6db8"
}
],
"_id": "665fb8c106668cd0221d6db6"
}
],
"status": "PENDING",
"_id": "665fb8c106668cd0221d6db2",
"createdAt": "2024-06-05T01:00:49.882Z",
"updatedAt": "2024-06-05T01:00:49.882Z",
"__v": 0,
"id": "665fb8c106668cd0221d6db2"
}
}
This response indicates that the template creation request was successful and is currently pending approval from Facebook.
By following these steps, you can create various types of templates using the Waabot API to cater to your messaging needs.