You need to sign in to do that
Don't have an account?
Ethan Han
Bulk Rest Api (v44.0) doesn't support JSON content type
I'm trying to create a JSON content type of insert job using Bulk API and I'm getting "UnsupportedContentType" even with api v44.0.
Not sure if I'm missing something or doing something wrong but below it the detail:
Url
body
response
Not sure if I'm missing something or doing something wrong but below it the detail:
Url
https://[my-instance].my.salesforce.com/services/data/v44.0/jobs/ingest
body
{ "apiVersion" : 44.0, "contentType" : "JSON", "object" : "Title__c", "operation" : "insert" }
response
[ { "errorCode": "UNSUPPORTEDCONTENTTYPE", "message": "UnsupportedContentType : JSON is not a valid Content-Type. Only 'CSV' is allowed" } ]
Greetings to you!
Salesforce provides an additional API, Bulk API 2.0, which uses the REST API framework to provide similar capabilities to Bulk API.
Bulk API 2.0 does not support any other contentType except for CSV.
Bulk API 2.0 Documentation: https://developer.salesforce.com/docs/atlas.en-us.api_bulk_v2.meta/api_bulk_v2/create_job.htm#topic-title
But Bulk API 1.0 supports JSON contentType. I don't know why Bulk API 1.0 would support JSON, but Bulk API 2.0 does not.
Bulk API 1.0 Documentation: https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/asynch_api_jobs_create.htm
Please refer to below link which might help you further.
https://developer.salesforce.com/docs/atlas.en-us.216.0.api_asynch.meta/api_bulk_v2/asynch_api_intro.htm
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
All Answers
Greetings to you!
Salesforce provides an additional API, Bulk API 2.0, which uses the REST API framework to provide similar capabilities to Bulk API.
Bulk API 2.0 does not support any other contentType except for CSV.
Bulk API 2.0 Documentation: https://developer.salesforce.com/docs/atlas.en-us.api_bulk_v2.meta/api_bulk_v2/create_job.htm#topic-title
But Bulk API 1.0 supports JSON contentType. I don't know why Bulk API 1.0 would support JSON, but Bulk API 2.0 does not.
Bulk API 1.0 Documentation: https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/asynch_api_jobs_create.htm
Please refer to below link which might help you further.
https://developer.salesforce.com/docs/atlas.en-us.216.0.api_asynch.meta/api_bulk_v2/asynch_api_intro.htm
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
I have a silly question but how do I mark this as solved? :)
It's my pleasure. I’m glad I was able to help!
After you choose the "Best Answer" the question is marked as “resolved” :)
Regards,
Khan Anas