GetTemplateById#
The method is intended to get the existing template by its id.
Request#
To get the existing template by its id , you need to execute a request to:
POST {{apiUrl}}/waInstance{{idInstance}}/getTemplateById/{{apiTokenInstance}}
For idInstance
, apiTokenInstance
and apiUrl
request parameters, refer to Before you start section.
Request parameters#
Parameter | Type | Mandatory | Description |
---|---|---|---|
templateId | string | Yes | ID of a previously created, existing template |
Request body example#
{
"templateId": "2522g44c-c2e4-4416-b506-4bghdd456e5g"
}
Response#
Response parameters#
Parameter | Type | Description |
---|---|---|
template | object | An array of objects of all existing templates |
Response body example#
Status code success: 200 OK.
{
"template": {
"appId": "3cb92fbd-0bac-41d7-818e-4e4326d90335",
"buttonSupported": "PN,URL",
"category": "MARKETING",
"containerMeta": "{\"data\":\"Exclusive deals on car and train bookings. Book now..!! flejpaiqah9z\",\"buttons\":[{\"type\":\"PHONE_NUMBER\",\"text\":\"Contact\",\"phone_number\":\"+919139472766\"},{\"type\":\"URL\",\"text\":\"Greenwaba\",\"url\":\"https://www.google.com/\"}],\"header\":\"Dear {{1}}\",\"footer\":\"Thank you\",\"sampleText\":\"Exclusive deals on car and train bookings. Book now..!! flejpaiqah9z\",\"sampleHeader\":\"Dear [user]\",\"enableSample\":true,\"editTemplate\":false,\"allowTemplateCategoryChange\":false,\"addSecurityRecommendation\":false,\"correctCategory\":\"UTILITY\"}",
"createdOn": 1717510871793,
"data": "Dear {{1}}\nExclusive deals on car and train bookings. Book now..!! flejpaiqah9z\nThank you | [Contact,+919139472766] | [Greenwaba,https://www.google.com/]",
"elementName": "qa_automation_qa_automation_112907flejpaiqah9z",
"externalId": "<metaTemplateId>",
"id": "51eddb1e-8e36-44df-a9e5-2815e4f8463b",
"internalCategory": 0,
"internalType": 0,
"languageCode": "en",
"languagePolicy": "deterministic",
"meta": "{\"example\":\"Exclusive deals on car and train bookings. Book now..!! flejpaiqah9z\"}",
"modifiedOn": 1717511304250,
"namespace": "<namespace>",
"oldCategory": "UTILITY",
"priority": 1,
"quality": "UNKNOWN",
"retry": 0,
"stage": "NONE",
"status": "APPROVED",
"templateType": "TEXT",
"wabaId": "106579118720596"
}
}
GetTemplateById errors#
For a list of errors common to all methods, refer to Common errors section.
Request examples#
curl --location '{{apiUrl}}/waInstance{{idInstance}}/getTemplateById/{{apiTokenInstance}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"templateId": "2522g44c-c2e4-4416-b506-4bghdd456e5g"
}'