问题描述
我正在使用服务帐户和域范围内的委派来访问客户域下具有只读范围 https://www.googleapis.com/auth/gmail.readonly 在消息中获取请求我使用的格式选项" metadata的fields ='payload/headers'仅返回电子邮件标题,但不返回消息内容.
I am using a service account and domain wide delegation to access all email accounts under client's domain with read-only scope https://www.googleapis.com/auth/gmail.readonly In the message get request I use format option "metadata" with fields='payload/headers' which returns only email headers but not the content of the message.
是否有一种方法可以将我的应用程序访问限制为仅对元数据而不是电子邮件的内容进行限制?这样可以确保我的应用程序无法读取敏感的电子邮件内容信息,并且只能访问元数据.
Is there a way to restrict my app access to metadata only and not the content of the emails? This would ensure that my application can not read sensitive email content information and have access to metadata only.
谢谢!
推荐答案
将范围设置为 https://www.googleapis.com/auth/gmail.metadata
.请参见 https://developers.google.com/gmail/api/auth/scopes
Set your scope to https://www.googleapis.com/auth/gmail.metadata
.See https://developers.google.com/gmail/api/auth/scopes
https://www.googleapis.com/auth/gmail.metadata
读取资源元数据,包括标签,历史记录和电子邮件标题,但不读取消息正文或附件
https://www.googleapis.com/auth/gmail.metadata
Read resources metadata including labels, history records, and email message headers, but not the message body or attachments
这篇关于Gmail API只读元数据范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!