I have a 3rd party API that will occasionally push some updates to my bubble app.
Basically to just create some entries in a products data type. The data type has 5-6 fields in the DB but the fields of note for this API POST are ‘sku’ and ‘name’.
My data structure that is being posted to the backend public workflow looks like this:
I think I have a good grasp on the concept of having a public backend workflow that accepts parameter ‘items’ then an action that schedules an api workflow on a list. That workflow then contains the ‘create a new thing’ action.
However the issue I am running into is with data types I think. On my public API workflow I have my parameter as ‘items’. If i set the datatype to ‘text’ I run into an issue where I cant seem to define the name & sku at the create a thing step.
However if I set the incoming data type (from the public workflow) to type: Products I get the following error when I POST my api call to bubble.io
{"statusCode":400,"body":{"status":"MISSING_DATA","message":"Invalid data for key items: object with this id does not exist: sku"}}
Again, if I set the datatype to ‘text’ the API call is successful but the data pushed into the database is incorrect. Any help appreciated. See imgur below:
Instead of a manual definition, use “detect request data” so Bubble can receive a sample payload and learn the structure.
Once you change that setting, click on “detect data” and Bubble will show you a popup with an initialization endpoint. Note how the end of this endpoint has the word “initialize” in it. This isn’t the permanent endpoint, it’s just for this initialization.
Manually trigger a request to your API workflow (from the 3rd party app, Postman, etc. ) with the JSON array. Make sure this popup is open while you trigger in a different window.
After you trigger, the popup will change automatically to show you the incoming data all parsed out for you. Click Save.
Now, in your workflow to create, you’ll be able to reference the “request data’s” list and fields. Try it out!
The raw data doesn’t show each item surrounded by curly brackets. The code you pasted looks right, but it’s different from what Bubble is receiving. Check on that?
Can you share how you send it? Postman settings? I’ve tested and didn’t get any issues…
Also, be sure to have content-type : application/json as header in your request
For people in the future who see this, make sure your inbound API call is actually formatted as JSON. Added the proper header and used the py requests library properly and everything started working.