Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only) Search jobs

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
Filter by
Sorted by
Tagged with
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 ...
pinoyyid's user avatar
  • 21.9k
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 ...
geet mehar's user avatar
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 ...
apadana's user avatar
  • 14.2k
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'...
Andrew's user avatar
  • 1,430
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 ...
shaish's user avatar
  • 1,489
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() { ...
Melvin's user avatar
  • 897
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" : "...
user1333358's user avatar
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() ...
ElioRubens's user avatar
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.
Rodney Kuhn's user avatar
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 ...
Taifun's user avatar
  • 6,215
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: // ...
F3L1X79's user avatar
  • 2,605
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 ...
ViktoriaDoneva's user avatar
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 ...
Baruch Oxman's user avatar
  • 1,626
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 ...
Rahul Kulhari's user avatar
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 ...
Sergio's user avatar
  • 28.7k
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'...
zzz's user avatar
  • 633
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....
Anandhan's user avatar
  • 432
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 ...
Azimuts's user avatar
  • 1,262
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 ...
Jonah's user avatar
  • 16k
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 ...
Ondřej Šotek's user avatar
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 ...
Mourya Ch's user avatar
  • 253
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 ...
Haseena Parkar's user avatar
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 ...
Kartik Domadiya's user avatar
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 ...
john2x's user avatar
  • 23.2k
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 ...
PNC's user avatar
  • 1,942
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 ...
wibberding's user avatar
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.
xd1936's user avatar
  • 1,148
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 ...
user1626536's user avatar
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???
Sandip Gadade's user avatar
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()....
somebody's user avatar
  • 1,087
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 ...
tirenweb's user avatar
  • 31.4k
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 ...
Let Me Tink About It's user avatar
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 ...
MeeSN's user avatar
  • 29
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?...
cao's user avatar
  • 1,007
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 ...
MeeSN's user avatar
  • 29
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 (...
rstackhouse's user avatar
  • 2,306
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 ...
ND003's user avatar
  • 774
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.
Rider's user avatar
  • 473
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 ...
Andy Hin's user avatar
  • 30.9k
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: ...
Skwarosz's user avatar
  • 369
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 ...
Jack Case's user avatar
  • 329
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:...
Aditya Borde's user avatar
  • 1,237
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 ...
Yaroslav Pogrebnyak's user avatar
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 ...
Chris Wood's user avatar
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....
Steve Bazyl's user avatar
  • 11.4k
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 = ""; ...
tqjustc's user avatar
  • 3,744
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, ...
Employee's user avatar
  • 2,361
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 ...
ANWESH MOHAPATRA's user avatar
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->...
Jack Trowbridge's user avatar
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 ...
misterios's user avatar
  • 330

1
2 3 4 5
…
87