【发布时间】:2020-11-13 14:29:45
【问题描述】:
我从 google api 复制粘贴并在我的代码中使用令牌验证用户,然后立即执行此代码
text1="text"
text2="bruh"
text3="reee"
requests = [
{
'insertText': {
'location': {
'index': 25,
},
'text': text1
}
},
{
'insertText': {
'location': {
'index': 50,
},
'text': text2
}
},
{
'insertText': {
'location': {
'index': 75,
},
'text': text3
}
},
]
result = service.documents().batchUpdate(
documentId=DOCUMENT_ID, body={'requests': requests}).execute()
但我不断收到错误代码
"Invalid requests[0].insertText: Index 25 must be less than the end index of the referenced segment, 2.
【问题讨论】:
标签: python google-api google-docs-api