2013-01-01 20 views
10

आप अपने ईमेल को पढ़ने के लिए उपयोगकर्ता द्वारा शुरू की गई पहुंच कैसे प्राप्त कर सकते हैं? ऐसा लगता है कि OpenID, OAuth, OAuth2 और यादृच्छिक अन्य समाधान हैं।जीएएएल तक ओथ पहुंच कैसे प्राप्त करें?

सबसे अच्छा मैं अब तक आया हूं OAuth2 scope=https://mail.google.com/ के साथ।

"देखें अपने मेल जब मैं इन परिचालनों का निष्पादन:

वहाँ किसी भी अनुमति है कि सिर्फ मुझे केवल पढ़ने के लिए मेल करने के लिए उपयोग देना होगा और आदर्श की तरह एक अनुमति नोटिस के साथ उपयोगकर्ता को डराने नहीं है एप्लिकेशन का उपयोग नहीं कर रहे हैं "

यदि संभव हो तो" अपना मेल देखें "।

उत्तर

4

The GMail API documentation का कहना है कि सब कुछ तक पहुंच प्रदान करने वाला केवल एक गुंजाइश है।

GMail Inbox Feed नामक एक सुविधा भी है जो आप चाहते हैं कि हो सकता है, लेकिन यह केवल Google Apps डोमेन पर उपलब्ध है।

9

पिछला उत्तर अब सटीक नहीं है। हाल ही में जारी जीमेल एपीआई दूसरों के बीच 'केवल पढ़ने' स्कोप की अनुमति देता है, जो यहां पाया जा सकता है: https://developers.google.com/gmail/api/auth/scopes

'केवल पढ़ने के लिए' गुंजाइश है: https://www.googleapis.com/auth/gmail.readonly अपने जवाब में

https://www.googleapis.com/auth/gmail.readonly 
Read all resources and their metadata—no write operations. 

https://www.googleapis.com/auth/gmail.compose 
Create, read, update, and delete drafts. Send messages and drafts. 

https://www.googleapis.com/auth/gmail.send 
Send messages only. No read or modify privileges on mailbox. 

https://www.googleapis.com/auth/gmail.insert 
Insert and import messages only. 

https://www.googleapis.com/auth/gmail.labels 
Create, read, update, and delete labels only. 

https://www.googleapis.com/auth/gmail.modify 
All read/write operations except immediate, permanent deletion of threads and messages, bypassing Trash. 

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. 

https://www.googleapis.com/auth/gmail.settings.basic 
Manage basic mail settings. 

https://www.googleapis.com/auth/gmail.settings.sharing 
Manage sensitive mail settings, including forwarding rules and aliases. 

Note: Operations guarded by this scope are restricted to administrative use only. They are only available to G Suite customers using a service account with domain-wide delegation. 

https://mail.google.com/ 
Full access to the account, including permanent deletion of threads and messages. This scope should only be requested if your application needs to immediately and permanently delete threads and messages, bypassing Trash; all other actions can be performed with less permissive scopes. 
+1

पोस्टिंग लिंक आगे पढ़ने के लिए महान है, तो उन करना चाहते है, लेकिन आप अपने जवाब में लिंक की गई सामग्री को संक्षेप में प्रस्तुत करना चाहिए। यदि लिंक टूटा हुआ है तो आपके उत्तर को अभी भी उपयोगी होना चाहिए। – skrrgwasme

+3

पोस्ट जीमेल एपीआई को 'केवल पढ़ने' के दायरे के लिए पूछता है। मैंने अलग-अलग दायरे के साथ-साथ अन्य सभी क्षेत्रों को लिंक प्रदान किया। ऐसा ही होता है कि पोस्ट क्या मांग रहा है वह एक https लिंक है। – eugene1832

+0

आपके अपडेट किए गए उत्तर के लिए धन्यवाद। सिर्फ एक प्रश्न; क्या आपको पता होगा कि मेरे ऐप को उपयोगकर्ता से अनुमति मिलने के बाद वास्तव में ईमेल कैसे प्राप्त किया जाए? – kramer65

संबंधित मुद्दे