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() gives you flexible, RESTful access to the user's inbox, with a natural interface to Threads, Messages, Labels, Drafts, and History. From the modern language of your choice, your app can use the API to add Gmail features like:

  • Read messages from Gmail
  • Send email messages
  • Modify the labels applied to messages and threads
  • Search for specific messages and threads

References:

4233 questions
24
votes
3 answers

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 communication is done.
Ondřej Šotek
  • 1,793
  • 1
  • 15
  • 24
24
votes
7 answers

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 getting an error: AttributeError: 'Resource'…
Rahul Kulhari
  • 1,115
  • 1
  • 15
  • 44
23
votes
2 answers

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 for a cron script it tells me that "User data…
Jonah
  • 15,806
  • 22
  • 87
  • 161
23
votes
8 answers

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 below error imaplib.error:…
Mourya Ch
  • 243
  • 1
  • 2
  • 8
23
votes
6 answers

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 successfully able to create Gmail Service instance…
Haseena Parkar
  • 939
  • 2
  • 12
  • 28
23
votes
5 answers

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.get_include_path()); require_once 'Google/Client.php'; …
Anandhan
  • 422
  • 5
  • 12
  • 22
22
votes
1 answer

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 could not be loaded.". The message on the recipient…
john2x
  • 22,546
  • 16
  • 57
  • 95
22
votes
1 answer

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 Label_1) WatchRequest wr = new…
PNC
  • 1,932
  • 19
  • 36
22
votes
3 answers

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 help. It's returning the plain text of mail body.…
Kartik Domadiya
  • 29,868
  • 19
  • 93
  • 104
21
votes
2 answers

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 used this sample programs,…
Azimuts
  • 1,212
  • 4
  • 16
  • 35
20
votes
1 answer

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 and uses different oauth2 libraries depending on…
user1626536
  • 793
  • 1
  • 6
  • 14
19
votes
6 answers

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 from front-end and then using that we get refresh…
MeeSN
  • 29
  • 3
  • 12
19
votes
1 answer

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 part and it's displaying properly on browser but…
MeeSN
  • 29
  • 3
  • 12
19
votes
5 answers

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 a 200 OK using the Google Developers Console here…
tirenweb
  • 30,963
  • 73
  • 183
  • 303
19
votes
2 answers

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 solutions, but no client side ones. window.atob does not…
wibberding
  • 815
  • 3
  • 10
  • 17