Salesforce BULK API 2.0 Insert Records using PostMan

Salesforce BULK API 2.0 Insert Records using PostMan

1. Get the Access Token using the Connected App and POST Request to https://{Your Salesforce Domain}.my.salesforce.com/services/oauth2/token endpoint.

2. Do a POST Request to create the Ingest Job.

Endpoint URL:

https://{Your Salesforce Domain}.my.salesforce.com/services/data/v59.0/jobs/ingest/

Header:

Body:

Note down the job id value.

3. Create a CSV file for record insertion.

Sample CSV:

Company,FirstName,LastName,Email,Industry,LeadSource,Status,Rating
Test Company 1,Test 1,Test 1,[email protected],Engineering,Web,Working - Contacted,Warm
Test Company 2,Test 2,Test 2,[email protected],Technology,Partner,Working - Contacted,Hot
Test Company 3,Test 3,Test 3,[email protected],Consulting,Web,Open - Not Contacted,Warm
Test Company 4,Test 4,Test 4,[email protected],Technology,Partner,Working - Contacted,Hot
Test Company 5,Test 5,Test 5,[email protected],Consulting,Web,Open - Not Contacted,Warm

4.Do a PUT request to upload the CSV file.

Endpoint URL:

https://{Your Salesforce Domain}p.my.salesforce.com/services/data/v59.0/jobs/ingest/{Job Id}/batches/

Header:

Body:

5. Do a PATCH request to notify that the file uploads are completed.

Endpoint URL:

https://{Your Salesforce Domain}.my.salesforce.com/services/data/v59.0/jobs/ingest/{Job Id}/

Header:

Body:

{ 
    "state" : "UploadComplete"
}

6. You can do a GET request to check the status of the Job.

Endpoint URL:

https://{Your Salesforce Domain}.my.salesforce.com/services/data/v59.0/jobs/ingest/{Job Id}/

Leave a Reply