使用google-sheets-api在Google表格中插入评论 [英] Insert a comment in a Google Sheet with google-sheets-api
本文介绍了使用google-sheets-api在Google表格中插入评论的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以使用Google Sheet API在Google表格的单元格中添加注释?我搜索了 https://developers.google.com/sheets/api/,但是找不到执行此操作的命令.
Is it possible to add a comment to a cell in a Google Sheet using Google Sheet API ? I have searched https://developers.google.com/sheets/api/, but found no command that does this.
推荐答案
是.您可以在单元格中添加评论.但是注释"在Sheets API中用作注释".您可以使用Sheets API的sheetssheets.batchUpdate添加注释".
Yes. You can add a comment to a cell. But "comment" is used as "note" at Sheets API. You can add "note" using spreadsheets.batchUpdate of Sheets API.
端点和样本请求正文如下.
The endpoint and sample request body is as follows.
POST https://sheets.googleapis.com/v4/spreadsheets/### Spreadsheet ID ###:batchUpdate
示例请求正文:
{
"requests": [
{
"updateCells": {
"range": {
"sheetId": ### sheetId ###,
"startRowIndex": 0,
"endRowIndex": 1,
"startColumnIndex": 0,
"endColumnIndex": 1
},
"rows": [
{
"values": [
{
"note": "sample note"
}
]
}
],
"fields": "note" // You can also use ``*``.
}
}
]
}
注意:
- 请将单元格坐标添加为GridRange.
-
"startRowIndex": 0, "endRowIndex": 1, "startColumnIndex": 0, "endColumnIndex": 1
是"A1". - Please add the cell coordinates as GridRange.
"startRowIndex": 0, "endRowIndex": 1, "startColumnIndex": 0, "endColumnIndex": 1
is "A1".- CellData
- GridRange
Note :
如果这不是您想要的,对不起.
If this was not what you want, I'm sorry.
这篇关于使用google-sheets-api在Google表格中插入评论的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文