https://discord.gg/botpress logo
bot runs differently in emulator and in whatsapp/p...
# 🤝help
e
basically my bot starts by calling a API in a execute code card , returning to a AI task wich puts true or false in a variable that is used in a transition. In my emulator, it only returns true and in the whatsapp and published versions it only returns false. I have tried republishing it many times, but it is the newer version already
const apiUrl = 'botpress.diamanteagricola.com.br:8090/rest/api/vendedor/986450231'; const headers = { Authorization: }; try { workflow.retornoApiVendedor = await axios.get(apiUrl, { headers }); workflow.retVendedor = JSON.stringify(workflow.retornoApiVendedor) } catch (error) { workflow.logErroApiProtheus = error.toString(); }
the code
l
Since you are doing an API that has nothing to do with Emulator or WhatsApp, it should not matter. However if there is a change and the change is impacted via WhatsApp, there should be something you are not considering when it comes to WhatsApp Also with the code just shared const headers don't look correct, it is missing quotes. In GET header = headers
e
AxiosError: Unsupported protocol botpress.diamanteagricola.com.br:
l
your end point is not accepting http? Since did not provide https://botpress.diananteagricola.com.br:8090
Try without https or http in postman, check which one works
e
thinking about it now, when i tested it earlier it only worked without http or htttps
wich one botpress uses in published? i will talk with my team so we can make it accept
l
It is not about Botpress, it is about your endpoint
e
ok, i just dont understand why in my studio it runs and gets the data from the api but not in published