Request localitation

The structure presented is as follows:

function requestLocation (number, bodyText, buttonName){
    const data = JSON.stringify({
        "messaging_product": "whatsapp",
        "recipient_type": "individual",
        "type": "interactive",
        "to": number,
        "interactive": {
            "type": "location_request_message",
            "body": {
                "text": bodyText
            },
            "action": {
                "name": buttonName
            }
        }
    });
    return data;
}

The parameters received are a number, bodyText and buttonName to be sent to the user.

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

If not also in the whatsappModels file:

Última actualización