Create a Message Template
1
2
3
# Create a template from the library
curl --location 'https://waba-v2.360dialog.io/message_templates' \
--header 'Content-Type: application/json' \
--header 'D360-API-KEY: YOUR_API_KEY' \
--data '{
"name": "my_order_confirmation",
"category": "UTILITY",
"language": "en_US",
"library_template_name": "order_confirmation_1",
"library_template_button_inputs": [
{
"type": "URL",
"url": {
"base_url": "https://your-store.com/orders"
}
}
]
}'4
curl --location 'https://waba-v2.360dialog.io/v1/configs/templates' \
--header 'D360-API-KEY: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"name": "order_confirmation",
"category": "UTILITY",
"language": "en_US",
"allow_category_change": true,
"components": [
{
"type": "HEADER",
"format": "TEXT",
"text": "Order Confirmation"
},
{
"type": "BODY",
"text": "Thank you for your order, {{1}}! Your order number is {{2}}. We will notify you when it ships.",
"example": {
"body_text": [
[
"John","ORD-12345"
]
]
}
},
{
"type": "FOOTER",
"text": "Contact us for any questions about your order."
},
{
"type": "BUTTONS",
"buttons": [
{
"type": "URL",
"text": "Track Order",
"url": "https://www.mystore.com/orders/{{1}}",
"example": [
"ORD-12345"
]
}
]
}
]
}'5
curl --request GET --url https://waba-v2.360dialog.io/v1/configs/templates \
--header 'D360-API-KEY: YOUR_API_KEY'6
Quick Examples
{
"name": "seasonal_promotion",
"category": "MARKETING",
"components": [
{
"type": "HEADER",
"format": "TEXT",
"text": "Our Summer Sale is on!"
},
{
"type": "BODY",
"text": "Shop now through August 31 and use code SUMMER25 to get 25% off all merchandise."
},
{
"type": "FOOTER",
"text": "Reply STOP to unsubscribe from promotions"
}
]
}{
"name": "order_status",
"category": "UTILITY",
"components": [
{
"type": "BODY",
"text": "Your order #{{1}} has been shipped! It should arrive by {{2}}. Track your delivery here: {{3}}",
"example": {
"body_text": [
["ABC123", "Aug 25", "https://example.com/track/ABC123"]
]
}
}
]
}Last updated
Was this helpful?