Jump to content
  • 0

(REST) Insert multiple records at once


KAXMI

Question

Hi,

Greeting, I am new to this forum, I am having a problem when inserting multiple records at once by REST. It works perfect while inserting single record each time.

However, it takes more than 3 mins when inserting about 300 records, does anyone know how to make a bulk insert instead of looping it. I have tried the following, but it doesn't work.

[{"ID":"1","Date":"11/29/2016"},{"ID":"2","Date":"11/30/2016"} ]

{"ID":"1","Date":"11/29/2016"},{"ID":"2","Date":"11/30/2016"}

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0
On 10/24/2016 at 10:45 AM, KAXMI said:

Hi,

Greeting, I am new to this forum, I am having a problem when inserting multiple records at once by REST. It works perfect while inserting single record each time.

However, it takes more than 3 mins when inserting about 300 records, does anyone know how to make a bulk insert instead of looping it. I have tried the following, but it doesn't work.

[{"ID":"1","Date":"11/29/2016"},{"ID":"2","Date":"11/30/2016"} ]

{"ID":"1","Date":"11/29/2016"},{"ID":"2","Date":"11/30/2016"}

Hi Kaxmi,

It's a limitation of caspio REST API. Inserting multiply records is not allowed.

Link to comment
Share on other sites

  • 0

I know this is an old post but I faced this issue a couple of weeks ago. First, you should do API request through PHP since if you do it through AJAX or JavaScript you are exposing  to the all users that reach your app your credentials and anyone with basic/intermediate knowledge can do pretty much anything they want with your DB if permissions are not set properly.

I tackled this by looping in PHP and then sending only the data through AJAX but as you mentioned, it may take some time, plus you need to create a queue for 300 records as you dont know if a record may fail so you need to handle all this. Hard to accomplish but you can get a good PHP developer to do this or Caspio Prefessional Development can do anything you can imagine too.

I would also recommend the following third party service to make proper API calls to Caspio APIs: https://www.futuresuite.net/products/api-library.php

Edited by douvega
New information was found
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...