Step 6: Retrieve Batch Results
Retrieve the results for an individual batch by running the following cURL command:
curl https://instance.salesforce.com/services/async/63.0/job/jobId/batch/batchId/result -H "X-SFDC-Session: sessionId"
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. batchId is the batch ID that was returned when you added a batch to the job.
Salesforce returns a response with data such as this:
"Id","Success","Created","Error"
"003x0000004ouM4AAI","true","true",""
"003x0000004ouM5AAI","true","true",""
The response body is a CSV file with a row for each row in the batch request. If a record was created, the ID is contained in the row. If a record was updated, the value in the Created column is false. If a record failed, the Error column contains an error message.