clever-lawyer-59955
04/04/2024, 10:24 AMjavascript
/* INSTRUCTIONS:
1. Create a Configuration Variable named "WHATSAPP_ACCESS_TOKEN" in the Bot Settings section of Botpress Studio.
2. Go to the "Configuration Variables" section of your bot in Botpress Cloud and set its value to your WhatsApp access token.
*/
const whatsappAccessToken = env.WHATSAPP_ACCESS_TOKEN
const res = await axios.get(workflow.url, {
headers: {
Authorization: `Bearer ${env.WHATSAPP_ACCESS_TOKEN}`
}
})
// This will be a JavaScript Buffer (https://nodejs.org/api/buffer.html) containing the raw binary content of the media file.
workflow.answer = res.data.toString("base64")
just like in the Documentation.
but i get html file
but in postman i get the image i need
https://cdn.discordapp.com/attachments/1225390458742509618/1225390458960875530/image.png?ex=6620f4cc&is=660e7fcc&hm=95a8eba4e34b45b2cf8a24e883c9131f0243afa0adc324cea25a2b28fe5d9032&
https://cdn.discordapp.com/attachments/1225390458742509618/1225390459312930826/image.png?ex=6620f4cc&is=660e7fcc&hm=42fea8fe1cc57ef15a1aa8a2bf42eeb2fbee484c5989fe36c49e006b843aa920&