I'm sending a batch of contacts through Restforce gem via Bulk apu
response = connection.post("/services/async/#{connection.options[:api_version]}/job/#{job_id}/batch") do |req|
req.headers['Content-Type'] = 'text/csv; charset=UTF-8'
req.headers['X-SFDC-Session'] = connection.options[:oauth_token]
req.headers['Content-Length'] = payload.length.to_s
req.body = Restforce::UploadIO.new(StringIO.new(payload), 'text/csv; charset=UTF-8')
end
Where payload is:
"AccountId,FirstName,LastName,Description,Phone,Email\n0011510001DXiOVAA1,Matt,Cali,Nice guy,+14150000000,[email protected]\n0011501001DXiOWAA1,Michael,Michael,very nice guy,+14150000001,[email protected]\n"
I'm getting an error: "InvalidBatch: Records not processed" The only response that I get.
How can I see what's exactly wrong with my batch? It used to work before, and at some point it stopped working. I made sure I added all permissions on a trial account I created.
Request/response data:
struct Faraday::Env method=:post, body=#Restforce::Mash batchInfo=#Restforce::Mash apexProcessingTime="0" apiActiveProcessingTime="0" createdDate="2015-12-06T23:06:28.000Z" id="SOME_ID" jobId="SOME_ID" numberRecordsFailed="0" numberRecordsProcessed="0" state="Queued" systemModstamp="2015-12-06T23:06:28.000Z" totalProcessingTime="0">>, url=#https://na22.salesforce.com/services/async/33.0/job/*SOME_ID*/batch>, request=#, request_headers={"User-Agent"=>"Faraday v0.9.2", "Content-Type"=>"text/csv; charset=UTF-8", "X-SFDC-Session"=>"SOME_SESSION_ID", "Content-Length"=>"233", "Authorization"=>"SOME_AUTH_ID"}, ssl=#, parallel_manager=nil, params=nil, response=#> @url=#URI::HTTPS https://na22.salesforce.com/services/async/33.0/job/SOME_ID/batch> @request=#Faraday::RequestOptions timeout=600 seconds, open_timeout=600 seconds> @request_headers={"User-Agent"=>"Faraday v0.9.2", "Content-Type"=>"text/csv; charset=UTF-8", "X-SFDC-Session"=>"SOME_ID", "Content-Length"=>"233", "Authorization"=>"SOME_ID"} @ssl=#Faraday::SSLOptions verify=true> @response=#Faraday::Response:0x007f22b44a78 ...> @response_headers={"date"=>"Sun, 06 Dec 2015 23:06:28 GMT", "set-cookie"=>"*SOME_DATA>", "location"=>"/services/async/33.0/job/SOME_ID/batch/SOME_ID", "content-type"=>"application/xml", "transfer-encoding"=>"chunked", "connection"=>"close"} @status=201>>, response_headers={"date"=>"Sun, 06 Dec 2015 23:06:28 GMT", "set-cookie"=>"SOME_ID", "expires"=>"SOME_ID", "location"=>"/services/async/33.0/job/SOME_ID/batch/SOME_ID", "content-type"=>"application/xml", "transfer-encoding"=>"chunked", "connection"=>"close"}, status=201>