Message Templates

This documentation describes how to create message Templates via API.

Introduction

Message Templates can be either created through the Facebook Business Manager or WhatsApp Business API. You will find more information on the official Facebook Documentation here. Some important things to note:

  1. We support create and delete. Editing a template is not yet available.

  2. The Create API call allows you to add a message template in a specific language.

  3. The Delete API call allows you to delete all translations of a message template you specify by name.

  4. When you create a message template, make sure to be consistent when providing translations.

  5. Every template has to be approved by Facebook.

    • You can use your template, as soon as its status changes to approved

      • This can take up to 48h. If your template is still in status submitted after two days, please contact support@360dialog.com

Create a Template

You can use the WhatsApp Business Management API to create new message templates, media message templates, or interactive message templates. To create a message template, you have to use the following request:

post

/v1/configs/templates
Request
Response
Request
Headers
D360-API-KEY
required
string
Response
200: OK
object {WABA Template}
name string optional
namespace string optional
category string optional
components array[object] optional
type string Allowed Values: BODY, HEADER, FOOTER, BUTTONS
format string Allowed Values: TEXT, IMAGE, DOCUMENT, VIDEO
text string optional
example string optional
buttons object optional
type string Allowed Values: PHONE_NUMBER, URL, QUICK_REPLY
text string required
url string optional
phone_number string optional
example string optional
language string optional
rejected_reason string optional
status string optional

Currently you cannot edit message templates. Please use a test account when learning to use the WhatsApp Business Management API.

More information about parameters, components and buttons you can find here: Templates - WhatsApp Business API. More information about all supported languages you can find here: Supported Languages - WhatsApp Business API.

Example: Create Template (with HEADER-IMAGE + BODY + BUTTONS-URL+PHONE + FOOTER)

{
"name": "noontime_2",
"category": "ACCOUNT_UPDATE",
"language": "en",
"components": [
{
"type": "HEADER",
"format": "IMAGE"
},
{
"type": "BODY",
"text": "Hi {{1}}, what do you want to do now?"
},
{
"type": "BUTTONS",
"buttons": [{
"type": "URL",
"text": "Follow the link!",
"url": "https://www.360dialog.com/{{1}}"
},
{
"type": "PHONE_NUMBER",
"text": "Call us!",
"phone_number": "+1(650) 555-1111"
}
]
},
{
"type": "FOOTER",
"text": "Remember, there are always cookies around!"
}
]
}' \
'https://waba.messagepipe.io/v1/configs/templates'

Response Code:

{
"category": "ACCOUNT_UPDATE",
"components": [
{
"format": "IMAGE",
"type": "HEADER"
},
{
"text": "Hi {{1}}, what do you want to do now?",
"type": "BODY"
},
{
"buttons": [
{
"text": "Follow the link!",
"type": "URL",
"url": "https://www.360dialog.com/{{1}}"
},
{
"phone_number": "+1(650) 555-1111",
"text": "Call us!",
"type": "PHONE_NUMBER"
}
],
"type": "BUTTONS"
},
{
"text": "Remember, there are always cookies around!",
"type": "FOOTER"
}
],
"language": "en",
"name": "noontime_2",
"namespace": "xxxxxxxx_xxxx_xxxx_xxxx_xxxxxxxxxxxx",
"rejected_reason": null,
"status": "submitted"
}

Get Template List

You can use the WhatsApp Business Management API to get a list of your existing message templates.

get

/v1/configs/templates
Request
Response
Request
Path Parameters
limit
optional
integer
default: 1000
offset
optional
integer
default: 0
sort
optional
string
Allowed Values: id, name, status
Headers
D360-API-KEY
required
string
Response
200: OK
object
count integer optional
filters object optional
limit integer optional
offset integer optional
sort array[string] optional
total integer optional
waba_templates array[object] {WABA Template} optional
name string optional
namespace string optional
category string optional
components array[object] optional
type string ALLOWED VALUES: BODY, VALUE, FOOTER, BUTTONS required
format string ALLOWED VALUES: TEXT, IMAGE, DOCUMENT, VIDEO optional
text string optional
example string optional
buttons object optional
type string ALLOWED VALUES: PHONE_NUMBER, URL, QUICK_REPLY required
text string required
url string optional
phone_number string optional
example string optional
language string optional
rejected_reason string optional
status string optional

Example:

Response Code:

200
200
{
"count": 3,
"filters": {
},
"limit": 1000,
"offset": 0,
"sort": [
"id"
],
"total": 3,
"waba_templates": [
{
"category": "ACCOUNT_UPDATE",
"components": [
{
"format": "TEXT",
"text": "Facebook Template Message",
"type": "HEADER"
},
{
"text": "Thank you for your request. \nAs Facebook closes the conversation after 24hours we cannot reach out to you anymore besides this template. \nIf you like to get in contact with us again and revoke the conversation please just click on one of the buttons and we get back to you.",
"type": "BODY"
},
{
"text": "Many thanks, your 360dialog team",
"type": "FOOTER"
},
{
"buttons": [
{
"text": "RESOLVED",
"type": "QUICK_REPLY"
},
{
"text": "NO",
"type": "QUICK_REPLY"
},
{
"text": "YES",
"type": "QUICK_REPLY"
}
],
"type": "BUTTONS"
}
],
"language": "en",
"name": "test_1",
"namespace": "xxxxxxxx_xxxx_xxxx_xxxx_xxxxxxxxxxxx",
"rejected_reason": "NONE",
"status": "APPROVED"
},
{
"category": "TICKET_UPDATE",
"components": [
{
"text": "Thank you for reaching out to us. We are looking into your request and get back to you.",
"type": "BODY"
},
{
"text": "Feel free to get in contact",
"type": "FOOTER"
},
{
"buttons": [
{
"phone_number": "+49xxxxxxxxx",
"text": "Call number",
"type": "PHONE_NUMBER"
},
{
"text": "360dialog Website",
"type": "URL",
"url": "https://www.360dialog.com/de/whatsapp-business/"
}
],
"type": "BUTTONS"
}
],
"language": "en",
"name": "test_2",
"namespace": "xxxxxxxx_xxxx_xxxx_xxxx_xxxxxxxxxxxx",
"rejected_reason": "NONE",
"status": "APPROVED"
},
{
"category": "TICKET_UPDATE",
"components": [
{
"text": "Hello {{1}}! This is a test message, setup with API version {{2}}",
"type": "BODY"
},
{
"buttons": [
{
"text": "Follow the link!",
"type": "URL",
"url": "https://www.360dialog.com/{{1}}"
}
],
"type": "BUTTONS"
},
{
"text": "This is the footer",
"type": "FOOTER"
}
],
"language": "en",
"name": "test_3",
"namespace": "xxxxxxxx_xxxx_xxxx_xxxx_xxxxxxxxxxxx",
"rejected_reason": "NONE",
"status": "APPROVED"
}
]
}

Delete a Template

You can use the WhatsApp Business Management API to delete your message templates by providing the message template name. Some things to keep in mind before deleting a message template:

  • If that message template name exists in multiple languages, all languages will be deleted.

  • Messages that have been sent but not delivered (e.g., if the customer's device is offline) will attempt to be delivered for 30 days.

  • If a message from an approved message template is sent 30 days after deletion, you will receive a "Structure Unavailable" error and the customer will not receive the message.

  • Once deleted, the name of an approved template cannot be used again for 30 days. Use a different name to create future templates.

delete

/v1/configs/templates/{template_name}
Request
Response
Request
Path Parameters
template_name
required
string
Headers
D360-API-KEY
required
string
Response
200: OK
This class of status code indicates that the client's request was successfully received, understood, and accepted.
{
"meta": {
"developer_message": "template name=`<template_name>` was deleted",
"http_code": 200,
"success": true
}
}
400: Bad Request
The 400 Bad Request Error is an HTTP response status code that indicates that the server was unable to process the request sent by the client due to invalid syntax.
object {API Response}
meta object optional
success boolean optional
developer_message string optional
http_code integer optional