Skip to main content

WA Templates list

Here’s how you can get a list of all the WA templates an account has:

HTTP GET to https://api.hilos.io/api/channels/whatsapp/template

fetch("https://api.hilos.io/api/channels/whatsapp/template", {
"headers": {
"accept": "application/json, text/plain, */*",
"authorization": "Token <HILOS API KEY>",
},
"method": "GET"
});

The response is a paginated list of template objects:

{
"count": 9,
"next": null, // If there's a next page, it will show up as a number. You can then use "baseURL?page=2" to get more templates
"previous": null, // Same as next
"results": [
{
"name": "initial_greeting",
"language": "es",
"components": [
{
"text": "Hola, {{1}}.",
"type": "BODY",
"example": {
"body_text": [
[
"Enrique"
]
]
}
}
],
"id": "32322d28-bfcf-4b7f-83e0-e06f8fa61d7b",
"category": "AUTO_REPLY",
"status": "approved",
"rejected_reason": "NONE"
},
{
"name": "continue_conversation",
"language": "es",
"components": [
{
"text": "Hola {{1}}, como estás?\n\nQuería comentarte que {{2}}.",
"type": "BODY",
"example": {
"body_text": [
[
"Jorge",
"se cancelo tu pedido porque no encontramos un metodo de pago. Tendrías otro metodo de pago"
]
]
}
}
],
"id": "842d136f-8265-4e66-8145-8abfb40fb020",
"category": "AUTO_REPLY",
"status": "approved",
"rejected_reason": "NONE"
}
]
}