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

使用Google Chat API在Apps Script中异步消息的认证授权问题

Google Chat APP异步消息发送问题

根据Google开发者手册,与应用用户交互时无需认证,但发送异步消息时必须进行认证。
输入图片描述
输入图片描述

我在Apps Script中使用Chat.Spaces.Messages.create方法时,弹出应用设置相关提示,点击允许后出现400无效范围错误。
输入图片描述

我认为需要额外权限,于是登录Google Workspace管理员账号为服务账号授予权限,但并未解决问题。
输入图片描述
输入图片描述

综上,需执行以下操作:

  • 在Apps Script的appsscript.json中添加oauthScopes
  • 在Google Workspace Admin > Security > API Management > Domain-wide Delegation菜单中为Google Chat API服务账号添加chat scope

希望能成功在Google Chat App中发送异步消息。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.16 23:39:54