You need to enable JavaScript to run this app. 使用Google Workspace替代runtime配置manifest时添加enableHttpEndpoints报错
优惠活动
大模型
产品
解决方案
定价
更多

使用Google Workspace替代runtime配置manifest时添加enableHttpEndpoints报错

Google Workspace Add-on manifest报错修复

报错原因

enableHttpEndpoints 是App Script项目级的顶层配置字段,不属于addOns节点的可配置子项,错误嵌套在addOns内部时,manifest校验流程会将其识别为非法未知字段,直接阻断保存操作。

修复操作

  • 将enableHttpEndpoints: true从addOns节点内移出,放置到与addOns、runtimeVersion、oauthScopes同级的manifest顶层位置
  • 调整后即可通过字段校验,支持外部HTTP云函数作为Add-on的触发回调地址

调整后的正确Manifest配置

{
  "timeZone": "America/New_York",
  "dependencies": {},
  "exceptionLogging": "STACKDRIVER",
  "oauthScopes": [
    "https://www.googleapis.com/auth/gmail.addons.execute",
    "https://www.googleapis.com/auth/gmail.metadata"
  ],
  "runtimeVersion": "V8",
  "enableHttpEndpoints": true,
  "addOns": {
    "common": {
      "name": "My HTTP Add-on",
      "logoUrl": "https://fonts.gstatic.com/s/i/googlematerialicons/markunread_mailbox/v6/black-24dp/1x/gm_markunread_mailbox_black_24dp.png",
      "homepageTrigger": {
        "runFunction": "https://us-central1-test-http-runtime.cloudfunctions.net/HttpAddOn/exampleWidgets"
      }
    },
    "gmail": {
      "contextualTriggers": [
        {
          "unconditional": {},
          "onTriggerFunction": "https://us-central1-test-http-runtime.cloudfunctions.net/GmailExample/simpleMessageInfo"
        }
      ]
    }
  }
}

运行注意事项

  • 开启enableHttpEndpoints后,所有配置的回调地址必须为公网可访问的HTTPS端点,否则触发器无法正常完成调用
  • 需核对当前配置的oauthScopes是否覆盖对应云函数的鉴权要求,避免运行时出现权限不足报错

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.11.09 23:36:05