I have used REST in the past for creating/updating single record and used Bulk API to create records in bulk too. But there seems to be new way to creating multiple records using REST. Here is the article – https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_composite_sobject_tree_flat.htm
Can someone post few help articles on how to get started? I have not used curl in the past, is there way to test this using PostMaster or WorkBench?
Edit
Let me make it simple. Suppose I have below REST resource in Salesforce, how can I call it to pass multiple contact records?
@RestResource(urlMapping='/insertcontact/*')
global with sharing class Mycontacts{
@HttpPost
global static List doPost(List lstcnts){
insert lstcnts;
return lstcnts;
}
}
Best Answer
You can definitely use workbench to execute these
Use the below for the request
and in the body use the below JSON
You should see the response in workbench
Alternatively you can use POSTMAN to experiment with this API .
You will need to create a connected app in salesforce and use oauth 2.0 to get access token for subsequent calls
use the below link for reference