You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: concepts/sdks/batch-requests.md
+11-4Lines changed: 11 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -20,11 +20,15 @@ The Microsoft Graph SDKs provide three classes to work with batch requests and r
20
20
21
21
-**BatchRequestStep** - Represents a single request (such as `GET /me`) within a batch. It enables assigning a unique identifier to the request and specifying dependencies between requests.
22
22
-**BatchRequestContent** - Simplifies creating the batch request payload. It contains multiple **BatchRequestStep** objects.
23
-
-**BatchResponseContent** - Simplifies parsing the response from a batch request. It provides the ability to get all responses, get a specific response by ID, and get the `@odata.nextLink` property if present.
23
+
-**BatchResponseContent** - Simplifies parsing the response from a batch request. It enables you to get all responses, get a specific response by ID, and get the `@odata.nextLink` property if present.
24
+
25
+
### Automatic batching for request limits
26
+
27
+
The Microsoft Graph SDK automatically handles batching requests with respect to the limit of 20 requests per batch. This means that if your code exceeds this limit, the SDK splits the requests into separate batches behind the scenes. This ensures that each batch complies with the limitation. You no longer need to manually implement logic to handle this batching limit, which makes your code cleaner and easier to manage.
24
28
25
29
## Simple batching example
26
30
27
-
This example shows how to send multiple requests in a batch that are not dependent on each other. The requests can be run by the service in any order. This example gets the user and gets the user's calendar view for the current day.
31
+
This example shows how to send multiple requests in a batch that are not dependent on each other. The service can run the requests in any order. This example gets the user and gets the user's calendar view for the current day.
28
32
29
33
### [C#](#tab/csharp)
30
34
@@ -50,10 +54,10 @@ This example shows how to send multiple requests in a batch that are not depende
50
54
51
55
## Batches with dependent requests
52
56
53
-
This example shows how to send multiple requests in a batch that are dependent on each other. The requests will be run by the service in the order specified by the dependencies. This example adds an event with a start time during the current day to the user's calendar and gets the user's calendar view for the current day. To make sure that the calendar review returned includes the new event created, the request for the calendar view is configured as dependent on the request to add the new event. This ensures that the add event request will execute first.
57
+
This example shows how to send multiple requests in a batch that are dependent on each other. The service runs the request in the order specified by the dependencies. This example adds an event with a start time during the current day to the user's calendar and gets the user's calendar view for the current day. To make sure that the calendar review returned includes the new event created, the request for the calendar view is configured as dependent on the request to add the new event. This ensures that the add event request runs first.
54
58
55
59
> [!NOTE]
56
-
> If the add event request fails, the get calendar view request will fail with a `424 Failed Dependency` error.
60
+
> If the add event request fails, the get calendar view request fails with a `424 Failed Dependency` error.
57
61
58
62
### [C#](#tab/csharp)
59
63
@@ -76,3 +80,6 @@ This example shows how to send multiple requests in a batch that are dependent o
0 commit comments