My particular issue has been troubling me for over a month now and I cannot seem to resolve it. I have been able to talk with a Bubble engineer who validated that my solution was not achievable with Bubble right now. My original solution was to send a dynamic body value (JSON output from JS) to the Data API Bulk call to create a list of things. This was their response:
our API connector currently does not allow passing freeform content with a custom content-type. This is commonly requested, and is something that we want to address in the short to medium term, since that’s a relatively way to expand the API connector’s capabilities. The content-type header is imposed in all POST requests, and set according to your choice of body type in the dropdown: form-data imposes the ‘form-data’ value, while JSON imposes ‘application/json’. Therefore, when triggering this call in the API connector, the text/plain header is just ignored, because that’s how we currently generate the call object.
our Bulk data add API endpoint will not accept a JSON array. The reason for this is mostly to prevent large JSON parsing from bypassing the capacity system, but given that is already a fringe use-case, we’ll be discussing options to accept an array of objects instead of newline-separated json as a string.
I replied back asking for the best possible way to achieve what I want and will update here what they say. In the meantime I wanted to post the issue here and see if any Bubble expects have any ideas.
What I am trying to achieve is turning a JSON of bubble things into db entries.
I have created JS to output a JSON object of bubble things.
Here is an example of the JS output:
Each object will represent a new bubble thing in a table called league.fixture.fixtures.
home_team = bubble thing (league.team)
away_team = bubble thing (league.team)
fixture = bubble thing (league.fixture)
gameweek = number
I have attempted parsing the data via the API connector and was yet met with another bubble limitation confirmed by the Bubble engineer. The Bubble API cannot map back to bubble things because as quoted
because it is mostly designed to access third party services, not itself.
If anyone has any ideas on how to get this working would be amazing.