Microsoft Graph curl在线转换为Excel

时间:2018-10-12 08:55:52

标签: microsoft-graph

我有一个Excel在线电子表格。它位于我公司的OneDrive上。 我想问问是否可以使用Microsoft Graph和bash的简单curl来获取特定单元格的值(其中包含公式)?

1 个答案:

答案 0 :(得分:1)

答案是肯定的。可以使用Microsoft Graph和bash的简单curl来获取特定单元格(其中带有公式)的值。

尝试以下endpoint

  

获取   / {version} / me / drive / items / {item-id} / workbook / worksheets / {worksheet-id} / range(address ='A1:B2')   授权:承载{access-token} workbook-session-id:   {session-id}

我的测试请求端点:

https://graph.microsoft.com/v1.0/me/drive/root:/test.xlsx:/workbook/mysheet/range(address='c1')

响应

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#workbookRange",
    "@odata.type": "#microsoft.graph.workbookRange",
    "@odata.id": "/me/drive/root/workbook/worksheets(guid)/range(address=%27c1%27)",
    "address": "Sheet1!C1",
    "addressLocal": "Sheet1!C1",
    "cellCount": 1,
    "columnCount": 1,
    "columnHidden": false,
    "columnIndex": 2,
    "formulas": [
        [
            "=SUM(D1,E1)"
        ]
    ],
    "formulasLocal": [
        [
            "=SUM(D1,E1)"
        ]
    ],
    "formulasR1C1": [
        [
            "=SUM(RC[1],RC[2])"
        ]
    ],
    "hidden": false,
    "numberFormat": [
        [
            "General"
        ]
    ],
    "rowCount": 1,
    "rowHidden": false,
    "rowIndex": 0,
    "text": [
        [
            "3"
        ]
    ],
    "values": [
        [
            3
        ]
    ],
    "valueTypes": [
        [
            "Double"
        ]
    ]
}