在microsoft graph excel api的文档中缺少表/范围相关方法的请求体

时间:2017-08-21 13:02:30

标签: excel microsoft-graph

我使用以下方法创建了一个表:

/v1.0/drives/{driveid}/items/{id}/workbook/worksheets/Sheet1/tables/add

请求正文:

{ "address": "A1:C2"}

无法使用以下方法将数据设置到表格上:

/v1.0/drives/{driveid}/items/{id}/workbook/worksheets/Sheet1/tables/Table2/Range

请求正文:

{ "values": [["a", "b", "c"], ["1", "2", "3"]] }

出现此错误:

{
  "error": {
    "code": "InvalidArgument",
    "message": "The argument is invalid or missing or has an incorrect format.",
    "innerError": {
      "request-id": "ea584370-dbb3-486f-9190-0cb8586c911c",
      "date": "2017-08-21T12:44:48"
    }
  }
}

有人可以建议如何将数据设置到表上,第一行指示请求正文中的标题行吗?

1 个答案:

答案 0 :(得分:0)

adding a row to a table的语法是:POST /workbook/tables/{id|name}/rows/add

以下示例来自documentation

POST https://graph.microsoft.com/beta/me/drive/items/{id}/workbook/tables/{id|name}/rows/add
Content-type: application/json
Content-length: 51

{
  "index": null,
  "values": [
    [1, 2, 3],
    [4, 5, 6]
  ]
}