Bulk API Salesforce: A Comprehensive Guide

Postman response window showing the job details and a status of Upload Complete.

Are you looking for an efficient way to handle data uploads in Salesforce? Look no further! The Bulk API Salesforce is here to simplify your data uploading process and provide you with detailed insights. With this guide, you’ll learn how to check the status of your job and retrieve valuable results. Let’s dive in!

Checking the Status of the Job

After you’ve submitted your data and informed Salesforce about the completion of your upload, it’s time to let the server take over and process your request. You have two methods to monitor the server’s progress: using the Salesforce UI or the API.

To check the status of the job in your Trailhead playground, follow these steps:

  1. From the Setup menu, enter “Bulk Data Load Jobs” in the Quick Find box.
  2. Select “Bulk Data Load Jobs”.

On this page, you can check the status of your job. Alternatively, you can click on the job ID to get more detailed results.

If you prefer using Postman from the Bulk v2 folder, follow these steps:

  1. Select “GET Job Info”. Note that the HTTP method used for this request is GET.
  2. Click “Send”.

You will see a response window, indicating the details of your job and its status.

Postman response window showing details of the job and the status of the job as Job Complete.

If your job is still in the UploadComplete state instead of JobComplete, don’t worry! Salesforce is still processing it, and it will be completed within a few minutes. In the meantime, take a break and enjoy a mug of coconut milk. When you return, you can try the same request again. If you’re lucky, your job will be processed, and you can proceed to retrieve the job results.

See also  ProgramMatek: OpenAI Embeddings API

Retrieving the Job Results

Once your job reaches the JobComplete or Failed state, you can access the results containing information about successfully and unsuccessfully processed records.

To view the successfully processed records in the Bulk v2 folder, follow these steps:

  1. Click on the “GET Get Job Successful Record Results” resource. Note that the HTTP method is GET.
  2. Click “Send”.

You will receive a response window showing the names of the accounts returned. Salesforce provides a list of all the records successfully processed in your job. Great job!

Postman response window showing the names of the accounts returned.

In some cases, certain records may encounter errors during processing. It could be due to existing duplicate Account records or missing required fields. To retrieve a list of failed records, follow these steps in the Bulk v2 folder:

  1. Select the “GET Get Job Failed Record Results” resource. Note that the HTTP method remains GET.
  2. Click “Send”.

You will receive a response window showing any errors encountered, along with the record ID and error message. If all your records were successfully inserted, the list of records will be empty. Well done, Captain!

Postman response window showing an error because no jobs in our example failed.

Resources

For further information and in-depth guidance, refer to the following resources:

Now that you’re equipped with the knowledge of the Bulk API Salesforce, you can streamline your data uploading process effortlessly. Get started today and experience the efficiency and reliability this powerful tool offers. Happy uploading!