0

I'm Using this documentation https://developer.salesforce.com/docs/atlas.en-us.api_bulk_v2.meta/api_bulk_v2/create_job.htm

With this URI https://cs30.salesforce.com/services/async/44.0/jobs/ingest

And this payload {"operation":"insert","object":"Account","contentType":"CSV"}

I am using C# to connect and get a job, from everything I've read so far this should be working.

request.Method = method;
request.ContentType = "application/json";
request.Accept = "application/json";
request.Headers.Add("Authorization", "Bearer " + this.AccessToken);

if (!string.IsNullOrWhiteSpace(body))
{
   UTF8Encoding encoding = new UTF8Encoding();
   byte[] data = encoding.GetBytes(body);
   request.ContentLength = data.Length;
   using (var newStream = request.GetRequestStream())
   {
      newStream.Write(data, 0, data.Length);
   }
}

.. Continues to make the request

So my question is I keep getting a 400 Bad Request with this, What am I missing? Thank you!

  • Shouldn't the URL be /services/data/vXX.X/jobs/ingest? – Jayant Das Oct 23 '18 at 16:16
  • I've tried this as well cs30.salesforce.com/services/async/44.0/jobs/ingest, sorry I Need to edit my question that is misleading. – Zach Hutchins Oct 23 '18 at 16:25
  • You have /services/async in your URL, whereas the documentation mentions it should be /services/data, have you tried changing that? – Jayant Das Oct 23 '18 at 16:27
  • Your not going to believe this but it was because i was missing the 'v' in-front of version. Its just one of those days. Thank you for pointing that out, It lead to me just copy and pasting the darn thing in, cause I just couldn't get it right – Zach Hutchins Oct 23 '18 at 16:33
  • You may like to add that as an answer to be able to mark this question as resolved. – Jayant Das Oct 23 '18 at 18:03
0

The problem was I was missing the 'v' in-front of version.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.