DriveItem ID 在项目 ID 中有感叹号,无法使用 Microsoft Graph api 从存储在 onedrive 中的工作簿中检索工作表

DriveItem ID has exclamation in item id and not able to retrieve worksheets from the workbook stored in onedrive using microsoft graph api

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

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

return

{
"@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 家庭订阅)从我们的工作簿中检索工作表列表,我们将不胜感激。

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

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