getAttachments 所需的范围?

Scope needed for getAttachments?

在 Gmail 插件中,这一行:

var attachments = message.getAttachments();

失败并显示消息 Access denied: : Not allowed for full access to mail message.

appscripts.json 清单文件包含:

"oauthScopes": [
  "https://www.googleapis.com/auth/gmail.addons.execute",
  "https://www.googleapis.com/auth/gmail.addons.current.message.metadata",
  "https://www.googleapis.com/auth/gmail.addons.current.message.action",
  "https://www.googleapis.com/auth/script.external_request",
  "https://www.googleapis.com/auth/script.locale"
]

还需要什么?我没有发现任何关于 getAttachments.

需要哪个范围的提及

你可以包括这个 “https://www.googleapis.com/auth/gmail.addons.current.message.readonly” 并删除这些 2:

"https://www.googleapis.com/auth/gmail.addons.current.message.metadata", “https://www.googleapis.com/auth/gmail.addons.current.message.action

这对我有用。