使用gmail API访问委派的邮件文件夹 [英] access delegated mail folder with gmail api

查看:98
本文介绍了使用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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆