We use Outlook Batch API to send multiple Outlook REST requests in a single HTTP batch request. In Outlook Batch API, we make 200 requests in the same batch HTTP request and all the concurrent requests succeed. Whereas if we do the same in graph API only 4 concurrent requests succeed as only 4 concurrent requests are supported in graph APIs (attached request and response).
We have the cases such as 10000 events creating at once(like users can add/remove 10000 items from a single user calendar).
So it would be of great help if the Graph APIs batch limit is set to be same as Outlook API(200 concurrent request).
Sample request:
Request url - https://graph.microsoft.com/v1.0/$batch
method - POST
request payload:
{
"requests": [
{
"url": "/me/calendars",
"method": "POST",
"id": "1",
"headers": {
"Content-Type": "application/json"
},
"body": {
"name": "test1s"
}
},
{
"url": "/me/calendars",
"method": "POST",
"id": "2",
"headers": {
"Content-Type": "application/json"
},
"body": {
"name": "test2"
}
},
{
"url": "/me/calendars",
"method": "POST",
"id": "3",
"headers": {
"Content-Type": "application/json"
},
"body": {
"name": "test3"
}
},
{
"url": "/me/calendars",
"method": "POST",
"id": "4",
"headers": {
"Content-Type": "application/json"
},
"body": {
"name": "test4"
}
},
{
"url": "/me/calendars",
"method": "POST",
"id": "5",
"headers": {
"Content-Type": "application/json"
},
"body": {
"name": "test5s"
}
},
{
"url": "/me/calendars",
"method": "POST",
"id": "6",
"headers": {
"Content-Type": "application/json"
},
"body": {
"name": "test6s"
}
},
{
"url": "/me/calendars",
"method": "POST",
"id": "7",
"headers": {
"Content-Type": "application/json"
},
"body": {
"name": "test7s"
}
}
]
}
Sample response:
{
"responses": [
{
"id": "6",
"status": 429,
"headers": {
"Retry-After": "1",
"Cache-Control": "private",
"Content-Type": "application/json"
},
"body": {
"error": {
"code": "ApplicationThrottled",
"message": "Application is over its MailboxConcurrency limit.",
"innerError": {
"date": "2022-08-11T06:21:56",
"request-id": "e09afe6b-25d6-4cdc-93f5-0539d6e8b9c6",
"client-request-id": "efe22070-473c-28bd-d1bf-ad43bb9f753f"
}
}
}
},
{
"id": "7",
"status": 429,
"headers": {
"Retry-After": "1",
"Cache-Control": "private",
"Content-Type": "application/json"
},
"body": {
"error": {
"code": "ApplicationThrottled",
"message": "Application is over its MailboxConcurrency limit.",
"innerError": {
"date": "2022-08-11T06:21:56",
"request-id": "e09afe6b-25d6-4cdc-93f5-0539d6e8b9c6",
"client-request-id": "efe22070-473c-28bd-d1bf-ad43bb9f753f"
}
}
}
},
{
"id": "4",
"status": 429,
"headers": {
"Retry-After": "1",
"Cache-Control": "private",
"Content-Type": "application/json"
},
"body": {
"error": {
"code": "ApplicationThrottled",
"message": "Application is over its MailboxConcurrency limit.",
"innerError": {
"date": "2022-08-11T06:21:56",
"request-id": "e09afe6b-25d6-4cdc-93f5-0539d6e8b9c6",
"client-request-id": "efe22070-473c-28bd-d1bf-ad43bb9f753f"
}
}
}
},
{
"id": "5",
"status": 201,
"headers": {
"Location": x"https://outlook.office.com/api/v2.0/Users('xxxx')/Calendars('xxxx')",
"Cache-Control": "private",
"OData-Version": "4.0",
"Content-Type": "application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8"
},
"body": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('xxxxx')/calendars/$entity",
"id": "xxx",
"name": "test5s",
"color": "auto",
"hexColor": "",
"isDefaultCalendar": false,
"changeKey": "xxxxx",
"canShare": true,
"canViewPrivateItems": true,
"canEdit": true,
"allowedOnlineMeetingProviders": [
"teamsForBusiness"
],
"defaultOnlineMeetingProvider": "teamsForBusiness",
"isTallyingResponses": false,
"isRemovable": true,
"owner": {
"name": "xxxx",
"address": "xxxx.onmicrosoft.com"
}
}
},
{
"id": "2",
"status": 201,
"headers": {
"Location": "https://outlook.office.com/api/v2.0/Users('xxxx')/Calendars('xxxx')",
"Cache-Control": "private",
"OData-Version": "4.0",
"Content-Type": "application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8"
},
"body": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('xx')/calendars/$entity",
"id": "xxx",
"name": "test2",
"color": "auto",
"hexColor": "",
"isDefaultCalendar": false,
"changeKey": "xxxxx",
"canShare": true,
"canViewPrivateItems": true,
"canEdit": true,
"allowedOnlineMeetingProviders": [
"teamsForBusiness"
],
"defaultOnlineMeetingProvider": "teamsForBusiness",
"isTallyingResponses": false,
"isRemovable": true,
"owner": {
"name": "xxxx",
"address": "xxxxx.onmicrosoft.com"
}
}
},
{
"id": "3",
"status": 201,
"headers": {
"Location": "https://outlook.office.com/api/v2.0/Users('xxxx')/Calendars('xxxxx')",
"Cache-Control": "private",
"OData-Version": "4.0",
"Content-Type": "application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8"
},
"body": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('xxx')/calendars/$entity",
"id": "x",
"name": "test3",
"color": "auto",
"hexColor": "",
"isDefaultCalendar": false,
"changeKey": "xxxxxx==",
"canShare": true,
"canViewPrivateItems": true,
"canEdit": true,
"allowedOnlineMeetingProviders": [
"teamsForBusiness"
],
"defaultOnlineMeetingProvider": "teamsForBusiness",
"isTallyingResponses": false,
"isRemovable": true,
"owner": {
"name": "xxxx",
"address": "xxxxxx.onmicrosoft.com"
}
}
},
{
"id": "1",
"status": 201,
"headers": {
"Location": "https://outlook.office.com/api/v2.0/Users('xxxx')/Calendars('xxxx')",
"Cache-Control": "private",
"OData-Version": "4.0",
"Content-Type": "application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8"
},
"body": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('xxxxx')/calendars/$entity",
"id": "xxxxxx",
"name": "test1s",
"color": "auto",
"hexColor": "",
"isDefaultCalendar": false,
"changeKey": "xxxxxxx",
"canShare": true,
"canViewPrivateItems": true,
"canEdit": true,
"allowedOnlineMeetingProviders": [
"teamsForBusiness"
],
"defaultOnlineMeetingProvider": "teamsForBusiness",
"isTallyingResponses": false,
"isRemovable": true,
"owner": {
"name": "xxxx",
"address": "xxxxx.onmicrosoft.com"
}
}
}
]
}
Hi @Hari ,
As this is by design with Microsoft Graph limiting
$batch
to 4 concurrent calls on Outlook services.Please share your feedback and request for feature idea increase batch limit via the Graph Feedback Portal, which will be monitored by Microsoft Product Engineering team who will take up based on no of votes and people requesting for such feature
Hope this helps.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".