简体   繁体   English

来自Microsoft Graph和Excel API的陈旧数据

[英]Stale data from Microsoft Graph and Excel API

We're using the Microsoft Graph .NET Client Library to send requests to the Excel API in order to read or write to Excel files in Office365. 我们使用Microsoft Graph .NET客户端库向Excel API发送请求,以便读取或写入Office365中的Excel文件。 We have noticed that the data that we get back from the API is sometimes stale. 我们注意到,从API返回的数据有时是陈旧的。

For instance, if we add a row to an Excel file, and then immediately read all rows from the same file, even if the add request succeeds, the row will still be missing from the data that we read back. 例如,如果我们向Excel文件添加一行,然后立即读取同一文件中的所有行,即使添加请求成功,我们回读的数据中仍会丢失该行。 If we wait for a few seconds, the row will show up. 如果我们等待几秒钟,该行将显示出来。 This problem does not reproduce consistently, and the delay time varies from less than a second to sometimes tens of seconds. 该问题不能一致地再现,并且延迟时间从小于一秒到有时几十秒变化。 The same problem occurs in update or delete operations as well. 更新或删除操作也会出现同样的问题。

Based on this, we speculate that behind the API, data takes a significant amount of time to propagate across all of Microsoft's servers, and if our requests are not always routed to the same server, we will occasionally hit a server that does not have the latest data. 基于此,我们推测在API背后,数据需要花费大量时间在所有Microsoft服务器上传播,如果我们的请求并不总是路由到同一台服务器,我们偶尔会遇到没有服务器的服务器。最新数据。

Could someone who is working on either the Microsoft Graph API or the Excel API verify this guess? 可能正在使用Microsoft Graph API或Excel API的人验证这个猜测吗? We understand that as Microsoft transitions from shipping packaged software to building cloud services, there will be problems and challenges, so we don't expect an immediate solution. 我们知道,随着Microsoft从运输套装软件过渡到构建云服务,将会出现问题和挑战,因此我们不希望立即采用解决方案。 However, since our business depends greatly on this API, if there is a known problem, please let us know so that at least we can try to find a workaround on our end. 但是,由于我们的业务在很大程度上依赖于此API,如果存在已知问题,请告知我们,以便至少我们可以尝试在我们的最终找到解决方法。

Any response would be greatly appreciated. 任何回应将不胜感激。 Thank you in advance. 先感谢您。

Please check https://dev.office.com/blogs/power-your-apps-with-the-new-excel-rest-api 请查看https://dev.office.com/blogs/power-your-apps-with-the-new-excel-rest-api

Copied from the above URL: 从以上网址复制:

Note: Any request that modifies the workbook should be performed in a persisted session. 注意:任何修改工作簿的请求都应在持久会话中执行。 Find more details on how to create a persisted session in our documentation. 在我们的文档中查找有关如何创建持久会话的更多详细信息。

Create a persisted session 创建持久会话

 POST .../workbook/CreateSession content-type: Application/Json authorization: Bearer {access-token} { "persistChanges": true } 

 Response HTTP code: 201, Created content-type: application/json;odata.metadata { "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#microsoft.graph.sessionInfo", "id": "{session-id}", "persistChanges": true} 

Usage The session ID returned from the CreateSession call is then passed as a header on subsequent API requests using the workbook-session-id HTTP header. 用法然后,使用workbook-session-id HTTP标头将从CreateSession调用返回的会话ID作为后续API请求的标头传递。

 GET .../workbook/Worksheets authorization: Bearer {access-token} workbook-session-id: {session-id} 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM