Audio

The structure presented is as follows:

function Audio(number, linkAudio){
    const data = JSON.stringify({
        "messaging_product": "whatsapp",    
        "recipient_type": "individual",
        "to": number,
        "type": "audio",
        "audio": {
            //(URL FOR AUDIO .MP3/.MPEG)
            "link": linkAudio
        }
    });
    return data;
}

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

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

let answer = dictionaryModule.function();
let model = models.Audio(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.Audio(number, linkAudio);

Última actualización