4

We are currently working on with bulk api to load json data's into salesforce.But unfortunately we are not able to load it and getting error as

unsupported content type

does salesforce currently support Json post?

The following is the curl command used:

curl https://ap2.salesforce.com/services/async/35.0/job/jobid/batch -H "X-SFDC-Session:sessionid" -H "Content-Type:application/json;charset=UTF-8" --data-binary @bulk.json

Error:

<?xml version="1.0" encoding="UTF-8"?><error
   xmlns="http://www.force.com/2009/06/asyncapi/dataload">
 <exceptionCode>UnsupportedContentType</exceptionCode>
 <exceptionMessage>Unsupported content type: application/json;charset=UTF-8</exceptionMessage>

when we surfed about the error it was mentioned in one of the developer forum as we have to wait for the next version to make json post work.is it so?or is there any problem with the syntax?suggestions please.Need experts answer please.

Thanks in advance

  • Can you point us to the reference of the forum ? And also I would suggest just remove the ';charset=UTF-8' suffix from content type and tell us if it changes anything – karthikselva Feb 11 '16 at 18:40
  • @karthikselva Still its not working.. salesforce developers forum – Priyalakshmi Feb 12 '16 at 8:28
  • it seems like json is not supported for now even a salesforc documentation says json is supported developer.salesforce.com/docs/atlas.en-us.200.0.api_asynch.meta/… – ashishcloud Feb 12 '16 at 8:41
  • But I cant find any example which uses json so fo now I will suggest curl instance.salesforce.com/services/async/35.0/job -H "X-SFDC-Session: sessionId" -H "Content-Type: application/xml; charset=UTF-8" -d @job.txt – ashishcloud Feb 12 '16 at 8:42
  • jobid has to be an actual job's id, not the literal jobid – cropredy Feb 13 '16 at 1:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.