In my plugin, I’m using Axios to trigger a function in Firebase (which is similar to Lamdas in AWS). The reason I’m doing this in a plugin action rather than using an API call feature in the plugin builder is that I need to do some processing before hitting the API, and the API call feature times out too quickly (but mainly the first reason).
Here’s the relevant bit of code:
let data = {
body: json
}
let results = await axios.post("[function URL", data ); console.log(results.data);
return { jsonstring: JSON.stringify(results.data) }
However, when doing this, I keep getting this error in the logs on Bubble:
Workflow error - Plugin action Start selection - Adept Pumps Server Side (testing) error: AxiosError: Request failed with status code 400 at settle (/var/task/node_modules/axios/dist/node/axios.cjs:1909:12) at IncomingMessage.handleStreamEnd (/var/task/node_modules/axios/dist/node/axios.cjs:2989:11) at IncomingMessage.emit (node:events:526:35) at endReadableNT (node:internal/streams/readable:1359:12) at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
When I use the exact same data with Postman to test the endpoint, it works fine, it’s just not working in Bubble. Is there something Bubble is doing here behind the scenes that could be screwing up this functionality?
Any ideas are appreciated, thank you!