Walkthrough Sending HTTP Requests with cURL
With cURL now configured, you can start sending HTTP requests to the Bulk API.
You send HTTP requests to a URI to perform operations with Bulk API. The URI where you send HTTP requests has this format:
https://Web_Services_SOAP_endpoint_hostame/services/async/APIversion/Resource_address
The part after the API version (Resource_address) varies depending on the job or batch being processed.
The easiest way to start using the Bulk API is to enable it for processing records in Data Loader using CSV files. If you use Data Loader, you don’t need to craft your own HTTP requests or write your own client application. For an example of writing a client application using Java, see Sample Client Application Using Java.
-
Step 1: Log In Using the SOAP API
The Bulk API doesn’t provide a login operation, so you must use SOAP API to log in.
-
Before you can load data, you first 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, queryAll, 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.
-
Step 3: Add a Batch to the Job
After creating the job, you’re ready to create a batch of contact records. You send data in batches in separate HTTP POST requests. The URI for each request is similar to the one you used when creating the job, but you append
jobId/batchto the URI. -
When you’re finished submitting batches to Salesforce, close the job. Closing the job tells Salesforce that you’re done submitting batches for the job, which allows the monitoring page in Salesforce to return more meaningful statistics on the progress of the job.
-
You can check the status of an individual batch by running this cURL command.
-
Step 6: Retrieve Batch Results
When a batch is
Completed, you must retrieve the batch result to see the status of individual records.
See Also