getAllTemplatesMessages

Returns the list of the WhatsApp template messages configured in mongo db.

Parameters:

Name

Mandatory

Type

Description

Name

Mandatory

Type

Description

servid

no

STRING

Telephone number whose associated templates you want to retrieve

Returns:

Type

Description

Type

Description

JS Promise

A Javascript Promise that return an object containing the following properties:

  • result: if true, the service response was performed correctly

  • error: contains the error description if an error has occurred in the request

  • templates: an array containing the template messages

  • type: describes the types of the templates returned and could be “imchannel” or “ctlivesocial”

Example:

LIVECHAT.getAllTemplatesMessages() .then(function(data){ console.log(data); }); /* Example of data { "result": true, "templates": [ { "_id": "5e46cf008df3ba62c6480e60", "templateNamespace": "cd533c49_d806_4e5a_aa10_494e0bd8851f", "templateName": "template_1", "templateMessage": "Hi! Thank you for reaching out our Team", "lang": "en_GB" }, { "_id": "5e46d1608df3ba62c6480e61", "templateNamespace": "cd533c49_d806_4e5a_aa10_494e0bd8851f", "templateName": "template_2", "templateMessage": "Ciao! Grazie per averci contattato", "lang": "it" }, { "_id": "5e46d18d8df3ba62c6480e62", "templateNamespace": "cd533c49_d806_4e5a_aa10_494e0bd8851f", "templateName": "template_3", "templateMessage": "Hi! Please reply {0} if you want to continue the conversation", "lang": "en_GB" }, { "_id": "5e4a4a308df3ba62c6480e63", "templateNamespace": "cd533c49_d806_4e5a_aa10_494e0bd8851f", "templateName": "template_4", "templateMessage": "Ciao! Digita {0} se vuoi continuare la conversazione", "lang": "it" }, { "_id": "5e4a4a7b8df3ba62c6480e64", "templateNamespace": "cd533c49_d806_4e5a_aa10_494e0bd8851f", "templateName": "template_5", "templateMessage": "Dear {0}, if you want to contact us in regards to your ticket {1}, you can do it also through WhatsApp.", "lang": "en_GB" }, { "_id": "5e4a4ad88df3ba62c6480e65", "templateNamespace": "cd533c49_d806_4e5a_aa10_494e0bd8851f", "templateName": "template_6", "templateMessage": "Gentile {0}, se vuoi contattarci in merito alla tua pratica {1}, puoi farlo anche con WhatsApp", "lang": "it" }, { "_id": "5e4a4afb8df3ba62c6480e66", "templateNamespace": "cd533c49_d806_4e5a_aa10_494e0bd8851f", "templateName": "template_7", "templateMessage": "Dear {0}, we have information in regards to your request. Please contact us via WhatsApp to our number {1}", "lang": "en_GB" }, { "_id": "5e4a4b1d8df3ba62c6480e67", "templateNamespace": "cd533c49_d806_4e5a_aa10_494e0bd8851f", "templateName": "template_8", "templateMessage": "Gentile {0}, abbiamo informazioni riguardo la tua pratica di assistenza. Ricontattaci via WhatsApp al nostro numero {1}", "lang": "it" } ], "error": null, "type": "imchannel" } */