POST /obj with array

Can I POST to table with following endpoint ie domainname/api/1.1/obj/table and then format API body with JSON array where Question and Weight are table field names

{“records” :[
{“Question”:“APIQuestion1”,“Weight”:11},
{“Question”:“APIQuestion2”,“Weight”:12}
] }

but I get error ie.

{
“statusCode”: 400,
“body”: {
“status”: “ERROR”,
“message”: “Unrecognized field: {“records” :”
},
“args”: {
“bubble_code”: “1537255294004x135892786318436270”
}
}

Am I doing it right?

I need to populate table with 58 records and at the moment I am using scheduled API on list and it is taking 2 minutes to complete

Have another read of the docs and then try this instead …

domainname/api/1.1/obj/table/bulk

{“Question”:“APIQuestion1”,“Weight”:11}
{“Question”:“APIQuestion2”,“Weight”:12}

Note that the body is no longer a valid JSON, but each line is.

@mishav thx for tip but still no luck. I added ‘bulk’ to end or POST url and removed JSON array formatting ie

{“Question”:“APIQuestion10”,“Weight”:101}
{“Question”:“APIQuestion20”,“Weight”:102}

reply now is

{“status”:“error”,“message”:“Could not parse as JSON: {“Question”:“APIQuestion10”,“Weight”:101}\r”}
{“status”:“error”,“message”:“Could not parse as JSON: {“Question”:“APIQuestion20”,“Weight”:102}\r”}

Where is link to docs?

@eric.schwantler1 try adding a header Content-Type = text/plain

docs …

Hello, I have same problem and want to solve it.
Content-Type = text/plain

My Request content is

{“beds_bookingid”:“12929643”}{“beds_bookingid”:“13382136”}…

reply now is

{“status”:“error”,“message”:"Could not parse as JSON:
{“beds_bookingid”:“12929643”}{“beds_bookingid”:“13382136”}…

Anyone know the solution?
Thanks

Can you give a link to the API doc (and which endpoint)?
At first sight, I think that the content type should be application/json and the json is not correctly encoded.

This is my API request setting in integromat.
I try to make content type text/plain.
Thank you.

Ok you are trying to post to Bubble API.
This will not work if you don’t follow what Bubble API expect.


Also, Integromat already have integration for Bubble that work with the obj API

You mean you find some mistakes in my API setting?
I have watched both reference and bubble integromat page this 3days almost 10 hours more already.
Kindly let me know if you found specific problem…
Regard

Sorry. The second example contain only one example but I see that you are trying to send a bulk request (this is something already existing in Integromat and make thing easier).
You need to have One object /line (on the first post, this doesn’t seem to be the case)

POST https://appname.bubbleapps.io/api/1.1/obj/type_name/bulk
{“key1”: value, “key2”: value}
{“key1”: value, “key2”: value}

Oh, It is working good!!! Thank you very much!!

1 Like