Google Docs API创建一个空文档



我现在试图用Ggoogle Docs API创建一个包含我的内容的文档,但每次创建它时,它都会被embty,我应该怎么做才能解决这个问题?

我使用谷歌示例中的相同代码来做这件事。链接到示例

我的内容示例:

{
"title": "testitesti",
"body": {
"content": [
{
"endIndex": 1,
"sectionBreak": {
"sectionStyle": {
"columnSeparatorStyle": "NONE",
"contentDirection": "LEFT_TO_RIGHT",
"sectionType": "CONTINUOUS"
}
}
},
{
"startIndex": 1,
"endIndex": 6,
"paragraph": {
"elements": [
{
"startIndex": 1,
"endIndex": 6,
"textRun": {
"content": "testn",
"textStyle": {}
}
}
],
"paragraphStyle": {
"namedStyleType": "NORMAL_TEXT",
"direction": "LEFT_TO_RIGHT"
}
}
}
]
}
}

感谢

documents.create将始终创建空白文档:

使用请求中给定的标题创建一个空白文档请求中的其他字段,包括任何提供的内容,将被忽略

如果要使用文档资源属性向文档添加内容,请使用documents.batchUpdate.

最新更新