You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用预定义ID创建Google Drive快捷方式遇400/500错误求助

使用预定义ID创建Google Drive快捷方式的问题求助

调用files.generateIds获取新ID后,调用files.create接口创建带该预生成ID的快捷方式时,出现400 Bad Request错误。

接口调用测试情况:

  • 指定ID创建普通文件(请求正常执行):
{
  "id": "1RHnAOr-lGNBGWJIWZZcT6ogetFosGTuc",
  "name": "testcreatefile2"
}
  • 创建不指定ID的快捷方式(请求正常执行):
{
  "name": "testcreatefile2",
  "mimeType": "application/vnd.google-apps.shortcut"
}
  • 指定ID创建快捷方式(返回400错误):
{
  "id": "1RHnAOr-lGNBGWJIWZZcT6ogetFosGTuc",
  "name": "testcreatefile2",
  "mimeType": "application/vnd.google-apps.shortcut"
}

更新测试:添加快捷方式目标ID后的请求

请求内容:

{
 "id": "<New ID from files.generateIds>",
 "name": "testcreatefile2",
 "mimeType": "application/vnd.google-apps.shortcut",
 "shortcutDetails": {
   "targetId": "<existing gdrive document id>"
 }
}

返回Google 500错误:

{
  "error": {
    "code": 500,
    "message": "Internal Error",
    "errors": [
      {
        "message": "Internal Error",
        "domain": "global",
        "reason": "internalError"
      }
    ]
  }
}

恳请各位提供解决方案,谢谢!

内容的提问来源于stack exchange,提问作者Wilson

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.11 17:34:51