Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Create a Batch with Binary Attachments
To organize your data in different batches, see General Guidelines for Data Loads.
- Create a zip batch file.
- Name the file, making sure to maintain the ".zip" suffix. For this example, the file is named request.zip.
- Using a command-line window, execute this cURL command.
curl https://instance.salesforce.com/services/async/67.0/job/jobId/batch -H "X-SFDC-Session: sessionId" -H "Content-Type:zip/csv" --data-binary @request.zip
instance is the portion of the <serverUrl> element and sessionId is the <sessionId> element that you noted in the login response.jobId is the job ID that was returned when you created the job.
Salesforce returns an XML response with data such as this.
1<?xml version="1.0" encoding="UTF-8"?> 2<batchInfo 3 xmlns="http://www.force.com/2009/06/asyncapi/dataload"> 4 <id>751D000000003uwIAA</id> 5 <jobId>750D000000001TyIAI</jobId> 6 <state>Queued</state> 7 <createdDate>2010-08-25T21:29:55.000Z</createdDate> 8 <systemModstamp>2010-08-25T21:29:55.000Z</systemModstamp> 9 <numberRecordsProcessed>0</numberRecordsProcessed> 10 <numberRecordsFailed>0</numberRecordsFailed> 11 <totalProcessingTime>0</totalProcessingTime> 12 <apiActiveProcessingTime>0</apiActiveProcessingTime> 13 <apexProcessingTime>0</apexProcessingTime> 14</batchInfo>Salesforce doesn’t parse the CSV content or otherwise validate the batch until later. The response only acknowledges that the batch was received.
- Note the value of the batch ID returned in the <id> element. You can use this batch ID later to check the status of the batch.
For details on proceeding to close the associated job, check batch status, and retrieve batch results, see the Getting Started.