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.
Step 2: Create a Job
-
Create a text file called job.txt containing this text:
1<?xml version="1.0" encoding="UTF-8"?> 2<jobInfo xmlns="http://www.force.com/2009/06/asyncapi/dataload"> 3 <operation>insert</operation> 4 <object>Contact</object> 5 <contentType>CSV</contentType> 6</jobInfo> - Using a command-line window, execute the following cURL command:
curl https://instance.salesforce.com/services/async/67.0/job -H "X-SFDC-Session: sessionId" -H "Content-Type: application/xml; charset=UTF-8" -d @job.txt
instance is the portion of the <serverUrl> element and sessionId is the <sessionId> element that you noted in the login response.
Salesforce returns an XML response with data such as this:
1<?xml version="1.0" encoding="UTF-8"?> 2<jobInfo 3 xmlns="http://www.force.com/2009/06/asyncapi/dataload"> 4 <id>750x0000000005LAAQ</id> 5 <operation>insert</operation> 6 <object>Contact</object> 7 <createdById>005x0000000wPWdAAM</createdById> 8 <createdDate>2009-09-01T16:42:46.000Z</createdDate> 9 <systemModstamp>2009-09-01T16:42:46.000Z</systemModstamp> 10 <state>Open</state> 11 <concurrencyMode>Parallel</concurrencyMode> 12 <contentType>CSV</contentType> 13 <numberBatchesQueued>0</numberBatchesQueued> 14 <numberBatchesInProgress>0</numberBatchesInProgress> 15 <numberBatchesCompleted>0</numberBatchesCompleted> 16 <numberBatchesFailed>0</numberBatchesFailed> 17 <numberBatchesTotal>0</numberBatchesTotal> 18 <numberRecordsProcessed>0</numberRecordsProcessed> 19 <numberRetries>0</numberRetries> 20 <apiVersion>67.0</apiVersion> 21 <numberRecordsFailed>0</numberRecordsFailed> 22 <totalProcessingTime>0</totalProcessingTime> 23 <apiActiveProcessingTime>0</apiActiveProcessingTime> 24 <apexProcessingTime>0</apexProcessingTime> 25</jobInfo> - Note the value of the job ID returned in the <id> element. Use this ID in subsequent operations.