GetTemplates#
The method is intended to get the list of all created templates for your instance.
Request#
To to get the list of all created templates for your instance you need to execute a request to:
GET {{apiUrl}}/waInstance{{idInstance}}/getTemplates/{{apiTokenInstance}}
idInstance
, apiTokenInstance
and apiUrl
request parameters, refer to Before you start section. Response#
Response parameters#
Parameter | Type | Description |
---|---|---|
templates | array | An array of objects of all existing templates |
Response template parameters#
Parameter | Type | Description |
---|---|---|
buttonSupported | string | Types of buttons used in the template. |
category | string | Template category. |
containerMeta | string | A fully formed request sent to Meta for verification. |
createdOn | number | Template creation timestamp (in milliseconds) |
data | string | Data field from the template, text representation of the template. |
elementName | string | The template's name is specified in the body of the CreateTemplate request. |
languageCode | string | The template language is from the body of the CreateTemplate request. |
languagePolicy | string | Service field for defining the language for Meta. |
meta | string | The field containing a sample template. |
modifiedOn | number | Template editing timestamp (in milliseconds). Equal to createdOn when creating the template. |
namespace | string | WABA Account ID. |
priority | number | The template priority given by Meta. |
quality | string | A service field for template evaluation by Meta. |
retry | number | The number of times a template is resubmitted for verification in Meta. |
stage | string | Service field of the Meta request processing stage. |
status | string | Meta verification status for the template. Can have the following values: PENDING (under consideration), APPROVED (the template has been verified and can be sent), REJECTED (the template has not been verified, Meta considers the template suspicious), FAILED (the template has not been verified, there is an error in the request body. The reason is specified in the additional reason field), PAUSED (the template has been suspended). |
templateType | string | Template type |
vertical | string | Brief description of the template for passing Meta verification. |
templateId | string | ID of the created template for interaction with it. |
elementName | string | Meta service fields |
internalCategory | number | Meta service fields |
internalType | number | Meta service fields |
Response body example#
Status code success: 200 OK.
{
"templates": [
{
"buttonSupported": "PN,QR,URL",
"category": "MARKETING",
"containerMeta": "{\"data\":\"your ticket has been confirmed for {{1}} persons on date {{2}}.\",\"buttons\":[{\"type\":\"PHONE_NUMBER\",\"text\":\"Call Us\",\"phone_number\":\"+919872329959\"},{\"type\":\"URL\",\"text\":\"Book A Demo\",\"url\":\"https://greenwaba.io/{{1}}\",\"example\":[\"https://greenwaba.io/abc\"]},{\"type\":\"QUICK_REPLY\",\"text\":\"Demo Button\"}],\"header\":\"This is the header\",\"footer\":\"This is the footer\",\"sampleText\":\"your ticket has been confirmed for 4 persons on date 2020-05-04.\",\"sampleHeader\":\"This is the header\",\"enableSample\":true,\"editTemplate\":false,\"allowTemplateCategoryChange\":false,\"addSecurityRecommendation\":false}",
"createdOn": 1741089781669,
"data": "This is the header\nyour ticket has been confirmed for {{1}} persons on date {{2}}.\nThis is the footer | [Call Us,+919872329959] | [Book A Demo,https://greenwaba.io/{{1}}] | [Demo Button]",
"elementName": "ticket_check_url_424536",
"internalCategory": 0,
"internalType": 0,
"languageCode": "en_US",
"languagePolicy": "deterministic",
"meta": "{\"example\":\"your ticket has been confirmed for 4 persons on date 2020-05-04.\"}",
"modifiedOn": 1741089798570,
"namespace": "e******8_4**d_4**1_b***_0d*********6",
"priority": 1,
"quality": "UNKNOWN",
"retry": 0,
"stage": "NONE",
"status": "APPROVED",
"templateType": "TEXT",
"vertical": "This is a test for creation ticket",
"templateId": "b*****a-f***-4***-a***-5*********3"
}
]
}
GetTemplates errors#
For a list of errors common to all methods, refer to Common errors section.
Request examples#
curl --location '{{apiUrl}}/waInstance{{idInstance}}/getTemplates/{{apiTokenInstance}}'