Google Sheet API是否具有Spreadsheet Metadate Update选项?尝试更新Google Spreadsheet名称,但找不到它

时间:2019-06-06 07:16:46

标签: visual-studio-code google-sheets-api

在Google Sheet API文档上,我看到您可以更新工作表名称,但不能更新电子表格名称。有谁知道是否可以重命名Google Spreadsheet?

1 个答案:

答案 0 :(得分:1)

  • 您要更改电子表格名称。

如果我的理解正确,那么这个答案如何?

您可以使用Sheets API更改电子表格名称。更改电子表格名称后,将使用Sheets API的电子表格sheets.batchUpdate方法。端点和请求正文如下。

端点:

POST https://sheets.googleapis.com/v4/spreadsheets/### spreadsheetId ###:batchUpdate

请求正文:

{
 "requests": [
  {
   "updateSpreadsheetProperties": {
    "properties": {
     "title": "### please set the Spreadsheet name ###"
    },
    "fields": "title"
   }
  }
 ]
}

注意:

参考文献:

如果我误解了您的问题,而这不是您想要的结果,我深表歉意。