Fork me on GitHub
#beginners
<
2016-08-31
>
josh_tackett19:08:37

Looking for some help hitting the Salesforce Bulk API

josh_tackett19:08:46

using RESTful JSON request

josh_tackett20:08:32

(http/request
  (merge
    {:method :post
     :body "{\"operation\": \"query\",
             \"object\": \"Opportunity\",
             \"contentType\": \"JSON\"}"
     :url ""
     :headers {"X-SFDC-Session” “<access-token>"}
     }
    proxy-config))

josh_tackett20:08:37

Here is where I’m at right now

josh_tackett20:08:55

Getting this error: <exceptionCode>InvalidJob</exceptionCode>n <exceptionMessage>Unable to parse Job</exceptionMessage>n</error>"}

oahner20:08:53

@josh_tackett: there's a lot of context missing, but, you're passing in what looks like a JSON fragment without specifying :content-type

josh_tackett20:08:58

@oahner How would you shape the request?

josh_tackett20:08:02

where should I add content type

oahner20:08:54

at the same level as :body and :method, add :content-type :json

oahner20:08:10

assuming you're using clj-http