Responses

The responses to messages have a very simple structure and that in most of the times will serve to use at the moment of having a front end, this same one can be observed this way:

function ResponseToMessage(number, bodyText, messageID){
    const data = JSON.stringify({
        "messaging_product": "whatsapp",
        "context": {
          "message_id": messageID
        },
        "to": number,
        "type": "text",
        "text": {
          "preview_url": "False",
          "body": bodyText,
        }
    });
    return data;
}

In this one a number, bodyText and messageID are received as parameters.

We recommend sending as follows in the process files:

let response = whatsappModel.messageResponse(number);

In whatsappModels we can configure it:

*This section is under development*

Última actualización