1

We are migrating our C# code from 2011 endpoint to Web API. We have API version 8.0. We have successfully implemented the Insert/Delete/Update operations using Web API but for bulk operations we are not getting how to implement this in C#. We referred https://gist.github.com/prabirshrestha/3929230 for implementations. Here the code that we wrote:

HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, "batch");
MultipartContent batchContent = new MultipartContent("batch");
request.Content = batchContent;
batchContent.Add(new HttpMessageContent(new 
HttpRequestMessage(HttpMethod.Get, "contacts")));
response = httpClient.SendAsync(request);
response.Wait();  

With this code we are getting error like saying:

This operation is not supported for a relative URI.

Please let us know if anybody can help us to implement this. Also have question, like is bulk operations are part of Web API 8.0 version or there are introduced after this version?

jcjr
  • 1,503
  • 24
  • 40

1 Answers1

0

According to this article, the v8 Web API supports batch operations.

It appears that the full URI of the Web API endpoint may be missing from your HTTPRequestMessage. It should be something like this:

[Organization URI]/api/data/v8.2/accounts

This question may also help.

Aron
  • 3,877
  • 3
  • 14
  • 21