Text

The structure presented is as follows:

function Text(textResponse, number){
    
    const data = JSON.stringify({
        "messaging_product": "whatsapp",    
        "recipient_type": "individual",
        "to": number,
        "type": "text",
        "text": {
            "preview_url": false,
            "body": textResponse
        }
    });
    return data;
}

In this one you receive as parameters a text that you want to send and a number.

We recommend sending in the following way in the process files:

let answer = dictionaryModule.function();
let model = models.Text(answer,number);

If not also in the whatsappModels file:

Última actualización