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/1225390454342680667/1225390455072624661/image.png?ex=6620f4cb&is=660e7fcb&hm=5081811bd44d0ec4e5ff0772b46e49456f098786cf759dfe7b7ccb493a26a11a&
https://cdn.discordapp.com/attachments/1225390454342680667/1225390455538057276/image.png?ex=6620f4cb&is=660e7fcb&hm=c88167d807cf9a5b426c51d83935873cae3accc71e08feeba3598a2b610edc81&