Questions tagged [gmail-api]
Use the Gmail API to add Gmail features to your app. RESTful access to threads, messages, labels, drafts and history. Easy to use from modern web languages.
gmail-api
4,323
questions
101
votes
2
answers
77k
views
How do I authorise an app (web or installed) without user intervention?
Let's say that I have a web app ("mydriveapp") that needs to access Drive files in a background service. It will either own the files it is accessing, or be run in a Google Account with ...
65
votes
6
answers
119k
views
'observe' on 'MutationObserver': parameter 1 is not of type 'Node'
I am creating a Chrome extension and trying to include a small text beside the SEND button of the gMail compose box.
I am using a MutationObserver to know when the compose box window appears. I am ...
59
votes
9
answers
56k
views
Sending email via Gmail & Python
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 ...
49
votes
4
answers
24k
views
How do I send HTML Formatted emails, through the gmail-api for python
Using the sample code from the GMail API Example: Send Mail, and after following rules for authentication, it's simple enough to send a programmatically generated email, via a gmail account. What isn'...
45
votes
10
answers
69k
views
Retrieving a user's public google/gmail picture
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 ...
45
votes
5
answers
68k
views
Client is unauthorized to retrieve access tokens using this method Gmail API C#
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()
{
...
39
votes
5
answers
40k
views
Gmail API returns 403 error code and "Delegation denied for <user email>"
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" : "...
36
votes
7
answers
27k
views
Google API quickstart.py error KeyError: '_module'
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()
...
35
votes
1
answer
5k
views
API for Inbox by Gmail
Is there any talk of when there will be an API for the new Inbox by Gmail. We would like to integrate into it and would specifically like to tie into the Reminders and Snoozes.
33
votes
5
answers
40k
views
How to send a message successfully using the new Gmail REST API?
I'm currently trying to test the new Gmail REST API.
In the API Explorer it is possible to authorize requests using OAuth 2.0 and to execute a request, i.e. send a message.
First I authorized.
I'm ...
31
votes
7
answers
19k
views
Cannot get the body of email with Gmail PHP API
I'm having trouble with the Gmail PHP API.
I want to retrieve the body content of emails, but I can retrieve it only for emails which have attachments! My question is why?
Here's my code so far:
// ...
29
votes
4
answers
18k
views
How to access the new Gmail API from my Android app?
I am trying to access the new Gmail API (announced 25.06.2014) from my Android app in order to return all e-mail messages in a certain users's account. I am developing the app in Eclipse using the ADT ...
26
votes
2
answers
6k
views
Bulk-fetching emails in the new Gmail API
I'm using the python version of the newly released Gmail API by Google.
The following call returns just a list of message ids:
service.users().messages().list(userId = 'me').execute()
But then I ...
25
votes
7
answers
41k
views
Download attachments from Gmail using Gmail API
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. But the same code I tried then I am ...
25
votes
2
answers
27k
views
Gmail API for sending mails in Node.js
Disclaimer:
I have followed Google's own Node.js quickstart guide and successfully connect and use the gmail.users.labels.list() functionality.
I have checked for questions/answers here, like this ...
25
votes
3
answers
4k
views
Is there a way to pre-check or avoid the scopes checkbox in Google's Gmail / Google Calendar OAuth approval flow?
We currently use google-api-python-client to handle our user-facing OAuth flow. We had a few users email us asking why their accounts didn't import successfully, and when we looked, their tokens didn'...
24
votes
5
answers
48k
views
Reading messages from Gmail, in PHP, using Gmail API
I have donwloaded new Gmail API source code from Google PHP client library.
I inititalized the service using:
set_include_path("./google-api-php-client-master/src/".PATH_SEPARATOR....
24
votes
2
answers
31k
views
Gmail REST API : 400 Bad Request + Failed Precondition
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 ...
24
votes
2
answers
14k
views
How to access a gmail account I own using Gmail API?
I want to run a node script as a cronjob which uses Gmail's API to poll a gmail account I own.
I am following these quickstart instructions:
I'm stuck on the first step. When requesting credentials ...
24
votes
3
answers
2k
views
Accessing Google Inbox reminders using API
Is there any way to access Google Inbox reminders via Gmail API or another way? I know that Google Inbox can show reminders from Google Keep, but can't find any information about how this ...
23
votes
9
answers
40k
views
reading gmail is failing with IMAP
I am running a cron job which executes the python script for reading gmail (2 min interval). I have used imaplib for reading the new mails. This was working fine until yesterday. Suddenly its throwing ...
23
votes
6
answers
36k
views
Can we access GMAIL API using Service Account?
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 ...
23
votes
3
answers
27k
views
Retrieve email/message body in html using Gmail API
Is there any way to retrieve message body in html form using GMail api ?
I have already gone through the message.get docs. Tried changing the format param to full, minimal & raw. But it did not ...
22
votes
1
answer
690
views
Emails/drafts sent via Gmail REST API can't be opened in the new Gmail UI
When sending drafts via the Gmail REST API, the message in the "Sent Mail" folder can't be opened by the sender in the new Gmail UI. You get the error message "The conversation that you requested ...
22
votes
1
answer
4k
views
Gmail API Watch not filtering by Label
I am using Gmail Push Notifications with Google PubSub and have a custom label that I want to monitor for any changes. I use the following code to register a watch for the label (Id of the label is ...
21
votes
2
answers
32k
views
Decode URL Safe Base64 in JavaScript (browser side)
I am using Gmail's API to get emails from my account. The body of the message is delivered in a "URL safe base64" format. What is the best way to decode this for use? I have found some nodejs ...
20
votes
1
answer
75k
views
As a recipient, is it possible to detect if an email was sent via Gmail's "Schedule Send" vs. "Send"?
Just curious if the email headers are marked by Gmail to denote if the email was scheduled vs sent right away.
20
votes
1
answer
10k
views
How do I use oauth2 and refresh tokens with the google api?
So I just spent the last few days trying to figure this out and am asking this question so that I can answer it for other people who are having problems.
First, the google documentation is TERRIBLE ...
19
votes
3
answers
63k
views
How to turn on less secure app access on google?
There is no option for turn on less secure app access
Is there any another way to turn on less secure app access???
19
votes
9
answers
33k
views
How to get full message body in Gmail?
I want to get full message body. So I try:
Message gmailMessage = service.users().messages().get("me", messageId).setFormat("full").execute();
That to get body, I try:
gmailMessage.getPayload()....
19
votes
5
answers
13k
views
Gmail API: 400 bad request when trying to send an email (PHP code)
I expected the code below to send an email, but I'm only getting this:
An error occurred: Error calling POST
https://www.googleapis.com/gmail/v1/users/me/messages/send: (400) Bad
Request
I get ...
19
votes
3
answers
18k
views
How to filter messages that do NOT have attachments using GMail query language?
How do I filter out Gmail messages that DO NOT have attachments?
Here is the documentation I'm trying to follow.
I can see that in order to include messages with attachments, I use the following ...
19
votes
1
answer
4k
views
Not able to display embedded images in HTML using Gmail API + rails
I'm building an app, in which I'm fetching emails from Gmail using Gmail API.
In an email there is 1 image embedded directly in email body(Inline image not attachment). I'm able to extract text/html ...
19
votes
1
answer
4k
views
Is there an URL to open the Gmail compose window with a specific message ID in full-screen (pop-out)
I use the new Gmail API to create a draft for my user. The API response provides the newly created message ID.
I can then open the compose window with the URLhttps://mail.google.com/mail/#drafts?...
19
votes
6
answers
6k
views
Google::Apis::AuthorizationError (Unauthorized)
We are creating an application with Ionic framework as front-end and Ruby on Rails as back-end. We are able to link Gmail account in our app. Account linking is working fine, we get serverAuthCode ...
18
votes
2
answers
7k
views
Attribute Error trying to run Gmail API quickstart in Python
It looks like there might be a version mismatch problem here. How should I go about fixing it?
I've trying updating six with pip, but that doesn't do anything.
Here's the error I see:
Traceback (...
18
votes
3
answers
22k
views
GMail API - Can I send email using the Service Account?
When I send an email using the GMail API, I get an Access Token for the user to whom the message is to be sent and then when sending the message, I put some value in the From Field.
But no matter ...
18
votes
3
answers
10k
views
Forward mail using gmail API
Is there any code provided by google to forward mail. because i haven't found one. If there is any way to forward mail using GMAIL API with extra content to send with original message. Please help.
17
votes
7
answers
14k
views
Base64 decoding of MIME email not working (GMail API)
I'm using the GMail API to retrieve an email contents. I am getting the following base64 encoded data for the body: http://hastebin.com/ovucoranam.md
But when I run it through a base64 decoder, it ...
17
votes
3
answers
13k
views
Create Spreadsheet using Google Spreadsheet API in Google drive in Java
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: ...
17
votes
1
answer
3k
views
Send HTML message using gmailr
I want to be able to use the gmailR package to send R-generated HTML reports via email inline(not as attachments). I'm unable to even send a basic HTML email using gmailr. I've attempted the following ...
16
votes
3
answers
26k
views
NSURLConnection initWithRequest is deprecated
I am adopting the Gmail API in iOS and I am getting the warning:
initWithRequest is deprecated
in the following line:
connection_ = [[connectionClass alloc] initWithRequest:request_ delegate:...
16
votes
1
answer
6k
views
Gmail API users.watch - no details for historyId
I have successfully set up Google Pub/Sub to use Gmail API Watch feature as described here: https://developers.google.com/gmail/api/guides/push to watch INBOX label in my gmail account.
Once new ...
16
votes
5
answers
4k
views
How does a Gmail message Id or ThreadId map to the new Gmail UI?
Edit: addressing the first comment below and for clarity, this isn't a code question. The question is simply:
What do I put into the URI querystring of the new Gmail UI to view a draft message ...
16
votes
1
answer
8k
views
I keep getting an error that my app needs to be verified when either I or another user try to authorize with OAuth2. What does that mean?
I received this error when trying to authorize my app with my own account:
Your project is trying to access scopes that need to go through the verification process.
{invalid=https://www.googleapis....
16
votes
7
answers
48k
views
How to get access token using gmail api
I got the authorization code following this document. But when I tried to get access token, I always got errors. Can anyone help me ?
public String AccessToken()
{
String accessToken = "";
...
16
votes
2
answers
3k
views
Attachment missing from message sent with Gmail API but only for recipient
When calling the Gmail API in JavaScript to send a message with an HTML body and a ~100KB PDF attachment, the attachment correctly appears attached to the message in the sender's Gmail Sent folder, ...
15
votes
2
answers
11k
views
'com.google.api.client.json.jackson2.JacksonFactory' is deprecated. What are my options?
While following the Gmail API java quickstart guide I came across this code snippet:
private static final JsonFactory JSON_FACTORY = JacksonFactory.getDefaultInstance();
Using it in the editor gave ...
15
votes
7
answers
41k
views
Using Refresh Token Exception { "error" : "invalid_grant" }'
I've successfully built an application that fetches an access and refresh token.
In my script I check if the access token is valid and if not I then use the refresh token to gain access $client->...
15
votes
7
answers
43k
views
javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate
I know there is several issue created about this error but nothing was helpful for me. I have method which is sending email with attachment on gmail server and it works fine. yesterday I bought a new ...