How to get mails of delegated accounts

旧巷老猫 提交于 2019-12-12 16:30:07

问题


Being authenticated as user1, i'd like to retrieve mails of all the users who have delegated access to user1.

So i have two problems :

  1. Retrieve all the accounts that have delegated access
  2. Retrieve the mails

The emails-settings-API gives acccess to delegates, not delegators.

Is there a way to do that progamatically.

Feel free to ask for more information


回答1:


To find out who has given you delegated access to their account, you would need to perform the retrieve delegates API call: https://developers.google.com/google-apps/email-settings/#retrieving_all_gmail_delegates

for all users in your Google Apps instance.

Programmatic access to a user's gmail mailbox is provided by IMAP OAuth logins: https://developers.google.com/google-apps/gmail/oauth_overview

However, there is currently no way for a delegate to access a delegators mailbox via IMAP so I'm afraid you're out of luck.

If you are an administrator, you can use IMAP OAuth login along with service accounts: https://developers.google.com/accounts/docs/OAuth2ServiceAccount

this will give you programmatic access to all users in your Google Apps instance.

Jay



来源:https://stackoverflow.com/questions/13359672/how-to-get-mails-of-delegated-accounts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!