Create a Job for Batches with Binary Attachments
You can use cURL to create a job for batches containing Attachment records.
For more information, see Walkthrough Sending HTTP Requests with cURL.
-
Create a text file called job.txt containing this text.
The batches for this job contain data in CSV format, so the
contentTypefield is set to ZIP_CSV. For XML or JSON batches, use ZIP_XML or ZIP_JSON, respectively. -
Using a command-line window, execute this cURL command
curl https://instance.salesforce.com/services/async/68.0/job -H "X-SFDC-Session: sessionId" -H "Content-Type: application/xml; charset=UTF-8" -d @job.txtinstance is the portion of the
<serverUrl>element and sessionId is the<sessionId>element that you noted in the login response. For more information about logging in, see Step 1: Log In Using the SOAP API.Salesforce returns an XML response with data such as the following.
-
Note the value of the job ID returned in the
<id>element. Use this ID in subsequent operations.