我们使用 Outlook Batch API在单个 HTTP 批处理请求中发送多个 Outlook REST 请求。在 Outlook Batch API 中,我们在同一批 HTTP 请求中发出 200 个请求,并且所有并发请求都成功。而如果我们在图API中执行相同的操作,则只有 4 个并发请求成功,因为图 API 中仅支持 4 个并发请求(附加请求和响应)。
我们有这样的情况,例如一次创建 10000 个事件(例如用户可以从单个用户日历中添加/删除 10000 个项目)。
因此,如果将 Graph API 批量限制设置为与 Outlook API 相同(200 个并发请求),将会有很大帮助。
样品请求:
{
"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"
}
},
{ …Run Code Online (Sandbox Code Playgroud) outlook outlook-restapi microsoft-graph-sdks microsoft-graph-api