gmail-api

Can we access GMAIL API using Service Account?

江枫思渺然 提交于 2019-11-27 04:33:45
I have a desktop application to read mail using GMAIL API over REST Interface. I want to use service account so that we can download the mails using domain setting and user interaction is null. I am successfully able to create Gmail Service instance but when I try to access any Gmail API method like fetching mail list or any other I get an exception saying Google.Apis.Auth.OAuth2.Responses.TokenResponseException: Error:"access_denied", Description:"Requested client not authorized." I am done with all the setting at developer console and added scopes to my gapps domain. Does Gmail API support

Gmail API returns 403 error code and “Delegation denied for <user email>”

て烟熏妆下的殇ゞ 提交于 2019-11-27 04:30:00
Gmail API fails for one domain when retrieving messages with this error: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 OK { "code" : 403, "errors" : [ { "domain" : "global", "message" : "Delegation denied for <user email>", "reason" : "forbidden" } ], "message" : "Delegation denied for <user email>" } I am using OAuth 2.0 and Google Apps Domain-Wide delegation of authority to access the user data. The domain has granted data access rights to the application. Seems like best thing to do is to just always have userId="me" in your requests. That tells the API to just use

Create Spreadsheet using Google Spreadsheet API in Google drive in Java

不想你离开。 提交于 2019-11-27 04:24:51
I had created some tool which was populating the google spreadsheet. It was working fine for 1 year, since today I've error Exception in thread "main" com.google.gdata.util.AuthenticationException: Error authenticating (check service name) at com.google.gdata.client.GoogleAuthTokenFactory.getAuthException(GoogleAuthTokenFactory.java:688) at com.google.gdata.client.GoogleAuthTokenFactory.getAuthToken(GoogleAuthTokenFactory.java:560) at com.google.gdata.client.GoogleAuthTokenFactory.setUserCredentials(GoogleAuthTokenFactory.java:397) at com.google.gdata.client.GoogleService.setUserCredentials

Sending email via gmail & python

*爱你&永不变心* 提交于 2019-11-27 04:13:14
问题 What is the recommended way of sending emails with gmail and python? There are a lot of SO threads, but most are old and also smtp with username & password is not working any more or the user has to downgrade the security of their gmail (for example see here). Is OAuth the recommended way? 回答1: The answer shows how to send email with gmail API and python. Also updated the answer to send emails with attachment. Gmail API & OAuth -> no need to save the username and password in the script. The

Retrieving a user's public google/gmail picture

一笑奈何 提交于 2019-11-27 03:21:13
I'm writing an email-based application using the gmail-api, and i need to retrieve user public images for email address originating from google. I've seen other applications do that, but i can't seem a way to reliably get this data. some more information: i'm using oauth2 to sign the user in - and i have no problem requesting any type of permissions there. i've tried retrieving the image using the google+ api - but it requires a userID for that - and i don't know how to get the userId for the email address (gmail-api doesn't give it, afaik). i've tried using the contacts API - but it only

Download Attachments from gmail using Gmail API

心不动则不痛 提交于 2019-11-27 03:16:25
问题 I am using Gmail API to access my gmail data and google python api client. According to documentation to get the message attachment they gave one sample for python https://developers.google.com/gmail/api/v1/reference/users/messages/attachments/get but the same code i tried then i am getting error: AttributeError: 'Resource' object has no attribute 'user' line where i am getting error: message = service.user().messages().get(userId=user_id, id=msg_id).execute() So i tried users() by replacing

Google API quickstart.py error KeyError: '_module'

天涯浪子 提交于 2019-11-27 03:03:06
问题 Using Gmail API. My client secret file is downloaded and working for Ruby. When I try the quickstart.py (python) version I get this error File "quickstart.py", line 70, in <module> main() File "quickstart.py", line 55, in main credentials = get_credentials() File "quickstart.py", line 38, in get_credentials credentials = store.get() File "/Library/Python/2.7/site-packages/oauth2client/client.py", line 374, in get return self.locked_get() File "/Library/Python/2.7/site-packages/oauth2client

Send email using Google API with only access token

你。 提交于 2019-11-27 02:57:53
问题 I want to send an email through Google API without the unnecessary OAUTH2 parameters. I only have the access_token and the refresh_token of that user. How can I send an email through Gmail API through a basic POST request in NodeJS, with Request npm plugin? 回答1: abraham is correct, but I just thought I'd give you an example. var request = require('request'); server.listen(3000, function () { console.log('%s listening at %s', server.name, server.url); // Base64-encode the mail and make it URL

Sending gmail attachment using api failed

非 Y 不嫁゛ 提交于 2019-11-27 02:28:11
问题 I'm trying create a draft (or send a message) with attachment to gmail using its API. I've read some answers and tried to built the request according to what I've read here: Mail attachment wrong media type Gmail API Before coding the function itself, I decided to use a Chrome extension (Simple Rest Client) to simulate the API request. Here's the request body: Content-Type: multipart_mixed; boundary="foo_bar_baz" MIME-Version: 1.0 to: receiver@gmail.com from: sender@gmail.com subject: Testing

Client is unauthorized to retrieve access tokens using this method Gmail API C#

限于喜欢 提交于 2019-11-27 02:08:27
I am getting the following error when i tried to authorize gmail api using service account "Client is unauthorized to retrieve access tokens using this method" static async Task MainAsync() { sstageEntities db = new sstageEntities(); //UserCredential credential; Dictionary<string, string> dictionary = new Dictionary<string, string>(); String serviceAccountEmail = "xxx.iam.gserviceaccount.com"; var certificate = new X509Certificate2( AppDomain.CurrentDomain.BaseDirectory + "xxx-8c7a4169631a.p12", "notasecret", X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.Exportable); //string