gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 17:32:09 29 4
gpt4 key购买 nike

我们使用 Microsoft Graph .NET 客户端库向 Excel API 发送请求,以便在 Office365 中读取或写入 Excel 文件。我们注意到,从 API 获取的数据有时是过时的。

例如,如果我们向 Excel 文件添加一行,然后立即从同一文件中读取所有行,即使添加请求成功,我们读回的数据中仍然会丢失该行。如果我们等待几秒钟,该行就会显示出来。这个问题的重现并不一致,延迟时间从不到一秒到有时几十秒不等。更新或删除操作也会出现同样的问题。

基于此,我们推测在 API 背后,数据需要花费大量时间才能在所有 Microsoft 服务器上传播,并且如果我们的请求并不总是路由到同一台服务器,我们偶尔会遇到这样的服务器没有最新数据。

从事 Microsoft Graph API 或 Excel API 工作的人可以验证这个猜测吗?我们知道,随着微软从交付打包软件过渡到构建云服务,将会出现问题和挑战,因此我们不期望立即得到解决方案。但是,由于我们的业务很大程度上依赖于这个 API,因此如果存在已知问题,请告知我们,以便至少我们可以尝试找到解决方法。

如有任何回应,我们将不胜感激。预先感谢您。

最佳答案

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

从上面的 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.

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

关于json - 来自 Microsoft Graph 和 Excel API 的陈旧数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49564885/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com