google-docs-api - 复制 Google Doc 在共享驱动器中不起作用 (404)
问题描述
我正在尝试通过 REST 使用 Google Docs API,当我得到一个文件时,它会毫无问题地返回,但是当我尝试复制它时,我得到 404 File Not Found。我传递的有效载荷如下:
POST https://www.googleapis.com/drive/v3/files/<<FILEID>>/copy
{
"supportsAllDrives": true,
"name": "test",
"parents": [
"<<FOLDERID>>"
]
}
我通过具有https://www.googleapis.com/auth/drive
范围的 OAuth2 进行了身份验证。
我在没有传递姓名或父母的情况下进行了测试,但这也不起作用。回应如下:
{
"body": {
"error": {
"errors": [],
"code": 404,
"message": "File not found: <<FILEID>>."
}
},
"headers": {
"vary": "Origin, X-Origin",
"content-type": "application/json; charset=UTF-8",
"date": "Wed, 15 Sep 2021 12:27:10 GMT",
"expires": "Wed, 15 Sep 2021 12:27:10 GMT",
"cache-control": "private, max-age=0",
"x-content-type-options": "nosniff",
"x-frame-options": "SAMEORIGIN",
"content-security-policy": "frame-ancestors 'self'",
"x-xss-protection": "1; mode=block",
"server": "GSE",
"alt-svc": "<<ALT SVC>>",
"transfer-encoding": "chunked"
},
"status": 404
}
编辑:还要注意,我发送了一个 getfields: *
并且我确实将canCopy
功能设置为 true
解决方案
推荐阅读
- javascript - 对象数组比较 2 个元素值
- c# - 2 SQL Server 中的 GridControl 和链接表
- ansible - 无法对 Ansible 需要创建的临时文件设置权限
- reactjs - React ant design 仅重置一个输入字段
- linux - Snap 和 certbot,未知命令“未设置”
- python-3.x - Python 3:如何将列表中的元素添加为字典的值?
- django - csrf_exempt 设置但 CSRF 失败:Referer 检查失败 - 没有Referer
- python - 如何创建 login_required 函数
- c# - 是否可以使用 protobuf-net 为扩展名为“FieldOptions”的 proto2 文件生成 C# 文件?
- google-apps-script - 在每张纸上隐藏和显示行