Newer Version Available

This content describes an older version of this product. View Latest

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.

  1. Create a text file called job.txt containing this text.

    The batches for this job contain data in CSV format, so the contentType field is set to ZIP_CSV. For XML or JSON batches, use ZIP_XML or ZIP_JSON, respectively.

    Note

  2. Using a command-line window, execute this cURL command

    curl https://instance.salesforce.com/services/async/54.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. 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.

  3. Note the value of the job ID returned in the <id> element. Use this ID in subsequent operations.