Microsoft图形,批处理请求的nextLink [英] Microsoft graph, batch request's nextLink

查看:44
本文介绍了Microsoft图形,批处理请求的nextLink的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在实施同步队列服务,以将Web应用程序的客户同步到Outlook的联系人.

I'm currently implementing a sync queue service to sync a webapp's customers to Outlook's contacts.

我正在使用 Graph API 来完成工作.联系人的创建和更新是使用图形的批处理请求完成的.

I'm using the Graph API for the job. The creation and updating of contacts is done using graph's batch request.

文档中有一部分内容是我不完全理解并且几乎被忽略的响应.我只想确保我的实现是正确的.

There's a part in the docs about the response that I don't fully understand and pretty much ignored. I just want to make sure my implementation is correct.

除了responses属性外,可能还有一个nextLink批处理响应中的属性.这允许Microsoft Graph返回只要有任何单个请求,便会进行批处理响应完全的.为确保已收到所有个人回复,只要存在nextLink,就继续关注它.

In addition to the responses property, there might be a nextLink property in the batch response. This allows Microsoft Graph to return a batch response as soon as any of the individual requests has completed. To ensure that all individual responses have been received, continue to follow the nextLink as long as it exists.

我想知道以下情况:

  1. nextLink 何时显示?我尝试发送其他请求,但从未收到.从文档中还不清楚,但是我的猜测是,由于某种原因,批处理中的某些请求未及时完成时会出现?

  1. when does nextLink show up? I've tried sending different requests but never received it. It's not really clear from the docs but my guess is that it appears when for some reason some of the requests in the batch did not complete in time?

待处理的请求会在响应中显示为错误还是会丢失?

Would the pending requests show up as errors in the response or would they just be missing from it?

nextLink 是否像分页请求一样采用 @ odata.nextLink 的形式?它未在文档中指定.

Will the nextLink be in form of @odata.nextLink like in pagination requests? It does not specify that in the docs.

当/如果它出现,应该如何处理?我可以放心地忽略它,只依靠下一次服务调用(每15分钟一次)重试和同步待处理的请求吗?

How should I handle it when/if it does appear? Can I safely ignore it and just count on the next invocation of service (every 15mins) to retry and sync the pending requests?

推荐答案

分页机制通常在查询Graph数据时适用.

The paging mechanism mostly applies when you are querying Graph for data.

  1. 如果作为批处理请求之一的任何查询都需要分页(就像您直接运行该请求一样),则会显示nextLink.例如,如果目标用户具有10个以上的文件夹,则此请求作为批处理作业的一部分将导致一个请求出现:

{"id":"1","method":"GET","url":"users/user@domain.tld/mailFolders"}

  1. 响应正常显示(响应正文中包含第一页数据,以及进入下一页的nextLink).
  2. 正确.在上面的示例中,nextLink如下所示:"@ odata.nextLink":"https://graph.microsoft.com/beta/users/user@domain.tld/mailFolders?$skip=10
  3. 您将需要遵循nextLink来获取其余数据.

这篇关于Microsoft图形,批处理请求的nextLink的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆