GMAIL API search user's messages in a domain

徘徊边缘 提交于 2020-01-06 03:05:46

问题


Exist a Gmail Rest API in order to search by the users messages of a particular domains mailboxes? A practical example is that a backend service after authentication via OAuth can search messages in different domains mailboxes of others users. I'm not able to find the right Google API for perform this type of research. Someone know a solution for this ?


回答1:


There is no concrete way to search across all mailboxes in a domain. You would need to enumerate the mailboxes (e.g. using the admin SDK directory API), then for each one perform the search there. Obviously, your app will need permissions to query admin SDK to get list of users in the domain and then permissions for each individual mailbox--the easiest way is to setup a service account and get it whitelisted for the entire domain for those scopes in domain cpanel. See: https://developers.google.com/accounts/docs/OAuth2ServiceAccount#formingclaimset

For more info about how to do the auth domain-wide which can be used with the Gmail API.



来源:https://stackoverflow.com/questions/26057832/gmail-api-search-users-messages-in-a-domain

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