AnsweredAssumed Answered

Insert multiple leads v10 API

Question asked by dorin.simina on Nov 16, 2015

Hi all,

 

Which is the best approach to insert multiple leads using the v10 API? Currently I'm using a the /bulk API in a Java project and passing multiple requests (500 in a batch).

 

HashMap<String, String> map = new HashMap<String, String>();

map.put("\"url\"", "\"v10/Leads?oauth_token=" + token + "\"");

map.put("\"method\"", "\"POST\"");

map.put("\"data\"", "\"" + data + "\"");

// add this map to the list

 

As you can see above I'm creating multiple requests inside the bulk POST. For each request I'm passing the data structure for the lead that needs to be inserted. This approach is working, but I'm experiencing very bad performance: e.g. for around 500 inserts it takes around 20 minutes to receive back the response.

 

Is something wrong with this approach or there is a problem on server side/database because the request is taking to long time?

 

Thanks,

Dorin

Outcomes