使用gmail API访问委派的邮件文件夹 [英] access delegated mail folder with gmail api
问题描述
假设有alice@gmail.com和bob@gmail.com.爱丽丝已将她的帐户委托给鲍勃.当我通过Bob进行身份验证并尝试使用REST接口列出Alice收件箱时,出现403错误:
let's say there are alice@gmail.com and bob@gmail.com. Alice has delegated her account to Bob. When I authenticate with Bob and try to list Alice inbox using the REST interface I get a 403 error:
bob@gmail.com does not have privileges to alice@gmail.com mailbox.
用于查询收件箱的URL是:
The URL used to query the inbox is:
www.googleapis.com/gmail/v1/users/alice@gmail.com/messages
当我使用bob@gmail.com(或我)作为userId时,没有问题.如何访问爱丽丝的帐户?
When I use bob@gmail.com (or me) as userId there is no problem. How do I access Alice's account?
问候
推荐答案
您需要获得爱丽丝的同意和oauth令牌才能通过API访问爱丽丝的帐户-不像Web界面那样支持委派.
You would need to get alice's consent and oauth token to access alice's account through the API--delegation is not supported like it is in the web interface.
这篇关于使用gmail API访问委派的邮件文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!