【问题标题】:DriveItem ID has exclamation in item id and not able to retrieve worksheets from the workbook stored in onedrive using microsoft graph apiDriveItem ID 在项目 ID 中有感叹号,并且无法使用 microsoft graph api 从存储在 onedrive 中的工作簿中检索工作表
【发布时间】:2017-05-31 06:46:25
【问题描述】:

无法通过 microsoft graph API 从存储在 onedrive 中的工作簿中检索工作表列表。

以下 API 提供了我的 ondrive 帐户上的工作簿列表 https://graph.microsoft.com/v1.0/me/drive/root/search(q='.xlsx')?select=name,id,webUrl

返回

{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(driveItem)",
"value": [
    {
        "@odata.type": "#microsoft.graph.driveItem",
        "name": "OnlineArticle.xlsx",
        "id": "7CFB16EE6D5730EF!53780",
        "webUrl": "https://1drv.ms/x/s!AO8wV23uFvt8g6QU"
    }]}

但是当我们尝试使用以下 API 从此工作簿中获取工作表时 IE。 https://graph.microsoft.com/v1.0/me/drive/items/7CFB16EE6D5730EF!53780/workbook/worksheets

我们得到以下错误

{
"error": {
    "code": "ResourceNotFound",
    "message": "Resource not found.",
    "innerError": {
        "request-id": "123139d9-bf93-46ab-8e2a-c139f7b4996f",
        "date": "2017-05-31T06:42:05"
    }
}}

我们有消费者帐户,并且驱动器项目的 ID 有“!”分隔器。如果有任何人可以帮助我们使用 microsoft graph 为我们的消费者服务帐户(即 Office 365 家庭订阅)从我们的工作簿中检索工作表列表,我们将不胜感激。

【问题讨论】:

  • https://graph.microsoft.com/v1.0/me/drive/items/7CFB16EE6D5730EF!53780 的请求是否返回 200 响应?

标签: office365 microsoft-graph-api office365api onedrive


【解决方案1】:

目前 Graph 的 Excel APIs 仅支持 Office 365 帐户(OneDrive for Business、Groups Drives 等)。

根据此处的 ID,这看起来像是消费者 OneDrive(消费者驱动器的 ID 中包含 !),这就是 API 失败的原因。消费者 OneDrive 支持应该很快就会到达 beta 端点。但是,目前不支持这种情况。

【讨论】:

  • 此功能是否有预计到达时间。这个在论坛里讨论了很久
猜你喜欢
  • 2023-04-11
  • 1970-01-01
  • 1970-01-01
  • 2019-07-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多