Image

The structure presented is as follows:

function Image(number, linkImage){
    const data = JSON.stringify({
        "messaging_product": "whatsapp",    
        "recipient_type": "individual",
        "to": number,
        "type": "image",
        "image": {
            //(URL FOR IMAGE)
            "link": linkImage
        }
    });
    return data;
}

In this one you receive as parameters a number and one link of the image that you want to send.

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

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

If not also in the whatsappModels file:

const linkImage = "https://yourUrlExample.supabase.co/storage/v1/object/public/files/image.png";
const info = whatsappModels.Image(number, linkImage);

Última actualización