Announcing SOAP API login() Retirement in Summer '27 release
Please refer to these articles for more information:
Release Note: SOAP API login() Retirement
Release Note: SOAP API login() not available in API version 65.0 onwards
Announcing SOAP API login() Retirement in Summer '27 release
Please refer to these articles for more information:
Release Note: SOAP API login() Retirement
Release Note: SOAP API login() not available in API version 65.0 onwards
To help prioritize Bulk API 2.0 ingest support for handling failures due to record locking, can you detail why you want this capability in Bulk API 2.0? What problem does Bulk API 2.0 not handling failures due to record locking cause you? We have some assumptions why this feature is requested and would like to validate to help prioritize.
Please don't specify because Bulk API v1 supports serial mode. We're looking to understand the underlying problem this lack of capability causes you.
Can I get some help, I'm having trouble getting Bulk V2 API to accept csv data:
Below is the final portions of my script (python):
1. I successfully login and authenticate (so have the instance_url)
2. Then, I compile/gather csv data: csv_data = df.to_csv(index=False) #-- from a pandas dataframe
--------------------------------------------------------------------------
From here, this is what is run:
--------------------------------------------------------------------------
bulk_api_v2_url = f"{instance_url}/services/data/v62.0/jobs/ingest/"
headers = {
"Authorization": f"Bearer {access_token}",
"Content-Type": "application/json",
}
# Create a job
job_data = {
"object": "Account",
"operation": "update",
"contentType": "CSV",
}
response = requests.post(bulk_api_v2_url, headers=headers, json=job_data)
job_id = response.json()["id"]
upload_url = f"{instance_url}/services/data/v62.0/jobs/ingest/{job_id}/batches/"
files = {"file": ("data.csv", csv_data)}
response = requests.put(upload_url, headers=headers, files=files)
--------------------------------------------------------------------------
Here is a typical response:
--------------------------------------------------------------------------
[{'errorCode': 'BULK_API_ERROR', 'message': 'Wrong content-type for batch (application/json), job is of type: text/csv'}]
I also tried this, with the same message:
response = requests.put(upload_url, data=csv_data, headers=headers)
--------------------------------------------------------------------------
1. I have tried adjusting the header "Content-Type" to "text/csv" - but this fails, even in Postman
2. Also tried converting the job-data to json, but the API doesn't seem to support this:
-
https://salesforce.stackexchange.com/questions/234791/does-salesforce-bulk-api-2-0-accept-json-as-the-contenttype
Is there a way to adjust the content type of the batch?
Other suggestions?
Thanks ahead of time...
Jarrell
ok figured this out, on my own: my headers were incorrect - so I used this:
headers2 = {
"Authorization": f"Bearer {access_token}",
"Content-Type": "text/csv",
}
response = requests.put(upload_url, data=csv_data, headers=headers2)
Did you know that you can download your Bulk API 2.0 query results in parallel, or be notified by Platform Events when partial results are available?
Read the new blog by @Shireen Nagdive comparing the three mechanisms for downloading Bulk API 2.0 query results:
1. Sequential download of entire results.
2. New parallel downloads (GA in Winter '25 release)
3. New events and partial downloads (Beta in Spring '25 release - now deployed to sandbox orgs)
Hello API enthusiasts,
Dreamforce 2024 is approaching, and I am looking for customers and partners who would be excited to share their Salesforce API journey on the Dreamforce stage together with me. If this is something that excites you, please reach out to me.
Thanks,
Jeremy
While performing Upserts to Salesforce using Create job bulk api v2 there are auto-chunked batches being created with 0 records. Have tried disabling the chunking via header and have also removed trailing lines and returns. Has anyone experienced this?
Salesforce Platform APIs: Ask Me Anything January 2024
Join our experts @Jeremy Westerman and @Kris Harrison hosted by Developer Advocate @Philippe Ozil for the January edition of our Salesforce Developers Ask Me Anything series to get all the details you need to succeed.
Date: Wednesday January 31, 2024
Time: 9am PT
Theme: Salesforce APIs
Registration: https://bit.ly/sfdevsamajan2024
#API #Platform Developer #Salesforce Platform
@Official: Bulk API 2.0 @Official: Composite API @Official: TreeSave API @OpenAPI Specs for Salesforce REST APIs @* Salesforce Platform *
Yes, it is possible to have multiple objects in a single API request in Salesforce. This can be achieved using the Composite API, which allows you to perform multiple CRUD operations on different objects within a single HTTP request. The Composite API helps reduce the number of round trips required to interact with the Salesforce platform.
Revert back if anything needed in detail!