gmail-api

How To Send A Reply With Gmail API

独自空忆成欢 提交于 2019-11-26 14:46:52
问题 I have two gmail accounts I created a thread consisting of five messages and retreived them with gmail gapi at this page https://developers.google.com/gmail/api/v1/reference/users/threads/get. This is what I got: As you can see, the ids don't match, although they identify the exact same letters. Why this happens, and how can i get the unified id? P.S. The real reason I am doing this is that I need to send a reply to a message with gmail API, but to do that, you need to know the id of the

Google Apps Script - Label Email Based On Email Body [Optimize Code]

本秂侑毒 提交于 2019-11-26 11:37:10
问题 I aim to do the following: An email is received that matches the criteria be placed in Label A folder. A new email is received. This new email\'s body is a duplicate of the first received. This new email skips the inbox and goes to Label B folder. Here is how I implemented it: All new emails are labeled as \"Original\" When the script runs, it compares the email body with all previous ones. If the body is a duplicate, it is labeled \"Duplicate\", moved to \"Archive\" and \"Original\" label is

Can we access GMAIL API using Service Account?

我们两清 提交于 2019-11-26 11:14:43
问题 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

Create Spreadsheet using Google Spreadsheet API in Google drive in Java

邮差的信 提交于 2019-11-26 11:10:15
问题 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

Retrieving a user's public google/gmail picture

江枫思渺然 提交于 2019-11-26 10:26:01
问题 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

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

我们两清 提交于 2019-11-26 09:58:32
问题 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

Gmail REST API : 400 Bad Request + Failed Precondition

邮差的信 提交于 2019-11-26 03:59:20
问题 I\'m trying to send mails based on Gmail REST API using google java api services. I have configured through Google Develover Console an application client and downloaded p12 and json files. I have used this sample programs, https://developers.google.com/gmail/api/guides/sending#sending_messages... This sample works, but this is based on GoogleAuthorizationCodeFlow. I want just to work from server-to-server, invoking directly, not opening a browser to get an access token... and I got it (the