Newer Version Available
Adding a Batch to a Job
Add a new batch to a job by sending a POST request to the following URI. The request body contains a list of records for processing.
- URI
- https://instance_name—api.salesforce.com/services/async/APIversion/job/jobid/batch
- Example request body
-
1<?xml version="1.0" encoding="UTF-8"?> 2<sObjects xmlns="http://www.force.com/2009/06/asyncapi/dataload"> 3 <sObject> 4 <description>Created from Bulk API on Tue Apr 14 11:15:59 PDT 2009</description> 5 <name>[Bulk API] Account 0 (batch 0)</name> 6 </sObject> 7 <sObject> 8 <description>Created from Bulk API on Tue Apr 14 11:15:59 PDT 2009</description> 9 <name>[Bulk API] Account 1 (batch 0)</name> 10 </sObject> 11</sObjects> - In this sample, the batch data is in XML format because the contentType field of the associated job was set to XML. For alternative formats for batch data, such as CSV, see JobInfo.
- Example response body
-
1<?xml version="1.0" encoding="UTF-8"?> 2<batchInfo 3 xmlns="http://www.force.com/2009/06/asyncapi/dataload"> 4 <id>751D0000000004rIAA</id> 5 <jobId>750D0000000002lIAA</jobId> 6 <state>Queued</state> 7 <createdDate>2009-04-14T18:15:59.000Z</createdDate> 8 <systemModstamp>2009-04-14T18:15:59.000Z</systemModstamp> 9 <numberRecordsProcessed>0</numberRecordsProcessed> 10</batchInfo>