function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ethan HanEthan 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
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"
    }
]

 
Best Answer chosen by Ethan Han
Khan AnasKhan Anas (Salesforce Developers) 
Hi Ethan,

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

Khan AnasKhan Anas (Salesforce Developers) 
Hi Ethan,

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
This was selected as the best answer
Ethan HanEthan Han
Thank you for your reply Khan.
I have a silly question but how do I mark this as solved? :)
Khan AnasKhan Anas (Salesforce Developers) 
Hi Ethan,

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
steven vpnsteven vpn
Yes Solved. Thank you so much for helping us out on that . It helped me on this site: (https://VPNapk.su/express-VPN-mod-apk/)