Limit on batch size to 20 individual requests.

Jyoti Marada 1 Reputation point Microsoft Employee
2021-02-15T09:13:16.507+00:00

Our application is consuming Graph URL for image .If application is placing request for more than 20 images in a single call ,the request is failing.

C# Code:

string graphUrl = ConfigurationManager.AppSettings["GraphURL"];
var batchData = JsonConvert.SerializeObject(GetBatchRequest(modifiedUserCount));
var json = new StringContent(batchData, Encoding.UTF8, "application/json");
var watch = new System.Diagnostics.Stopwatch();
watch.Start();
HttpResponseMessage result = httpClient.PostAsync(graphUrl, json).Result;
watch.Stop();
Debug.WriteLine("Timer: " + watch.ElapsedMilliseconds.ToString());
if (result.IsSuccessStatusCode)
{
//This part of loop is never executed as IsSuccessStatusCode is false.
}

How can we resolve this issue? Do we need to split our request into multiples ,each with 20 maximum image requests?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,459 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.