Newer Version Available

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

Step 2: Creating a Job

Before you can load any data, you first have to create a job. The job specifies the type of object, such as Contact, that you're loading, and the operation that you're performing, such as query, insert, update, upsert, or delete. A job also grants you some control over the data load process. For example, you can abort a job that is in progress.

To create a job using cURL:

  1. Create a text file called job.txt containing the following text:

    The operation value must be all lower case. For example, you get an error if you use INSERT instead of insert.

    Warning

  2. Using a command-line window, execute the following cURL command:

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

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