Wirasat
Tera Guru
6 Comments
Mohd1
Mega Contributor

What would be the format of the JSON Request to create multiple records (POST) to Table Rest API?

 

Wirasat
Tera Guru

You would need to create an array of JSON object as listed below.

 

{ "rerords" : [ { "short_description" : "this was inserted with python using JSON 1" , "priority" : "1 - Critical" , "impact" : "1" , "caller_id" : "Fred Luddy" } , { "short_description" : "this was inserted with python using JSON 2" , "priority" : "1 - Critical" , "impact" : "1" , "caller_id" : "Fred Luddy" } ] }

 

The record object has 2 rows of data. You can can create as many as you want. Each row will correspond an object in the array.

Mohd1
Mega Contributor

Posted below JSON response from API explorer and Python but no luck. It only updated the first record in the target table and ignored the second, returning status 201. Help appreciated!

 {"name":"Location1","parent":"Company"},{"name":"Location2","parent":"Company"}

Muhammad Faisa1
Kilo Contributor

Very informative video. Thanks for sharing!

Mohd1
Mega Contributor

Anyone able to figure out how to post multiple records in a single Rest request or is this a limitation on the API. I am on version Madrid!

jbanna
Kilo Explorer

This video is helpful even at beginner's level