FAQ Database Discussion Community


client_secret.json is empty upon download from google developer site

ruby,json,gmail-api
I am trying to download the client_secret.json from google API. I am following the steps listed in https://developers.google.com/gmail/api/quickstart/ruby. Use this wizard to create or select a project in the Google Developers Console and automatically enable the API. In the sidebar on the left, select Consent screen. Select an EMAIL ADDRESS...

Gmail API Watch() not working

google-api-php-client,gmail-api
I am following Gmail API Push notifications guide given at https://developers.google.com/gmail/api/guides/push. However, when I try to create a new watch from API explorer, it gives following response: { "error": { "errors": [ { "domain": "global", "reason": "invalidArgument", "message": "Invalid topicName does not match projects/google.com:apisexplorerconsole/topics/*" } ], "code": 400, "message": "Invalid...

Shared Contact API - Error code 409 (Conflict) while deleting an contact

php,gmail-api,google-client
I am using google client for PHP I downloaded from here : https://code.google.com/p/google-api-php-client/downloads/detail?name=google-api-php-client-0.6.7.tar.gz&can=1&q= I am getting response code 409 - Conflict while trying to delete a contact. Please check my code here : http://staging.point-star.com/sharedcontact/code1/examples/contacts/shared_contact_api_del_code.png Here is result screenshot : http://staging.point-star.com/sharedcontact/code1/examples/contacts/shared_contact_api_result_screenshot.png It returns me detail of...

Gmail API: Get list of messages labelled with a specific label in php

php,email,gmail,google-api-php-client,gmail-api
THE SITUATION I am setting up Gmail API for my app. I need to import all the emails labelled with a specific label, for example TRASH, SPAM, SENT, UNREAD, STARRED etc.. I am able to get the inbox emails list and single message info. And i can get the list...

Using statement for Base64UrlEncode [closed]

c#,gmail-api
I am trying to send an email through code, and I ran into a roadblock. I was working off of this when Base64UrlEncode showed up red. I have the same using statements in my code. using System; using System.IO; using System.Net.Mail; using System.Collections.Generic; using System.Configuration; using System.Linq; using System.Runtime.CompilerServices; using...

Gmail API: Insufficient Permission

php,email,google-api,gmail,gmail-api
THE SITUATION: I am testing the Gmail API for my app. I have tested some requests and they are working fine. For example get messages, get user history, get draft list etc.. Basically all the read only requests are working fine. I have instead some issues related with permission with...

Is there a way to link 2 the same email across multiple users

gmail-api
We are looking for a way to determine if an email in different users gmail is the same email. For example Person A sends an email to Person B and C who are in the same Google Apps instance. When retrieving the email with the gmail API the Id and...

Gmail API: How to get access token?

php,google-api,google-oauth,google-api-php-client,gmail-api
I am testing the Gmail API. So far I have done the following: I have created the project in the Google Developers Console I have enabled the Gmail API. I have created a new Client ID and the client secret. In my PHP script I have installed the PHP Client...

Create a desktop application using Gmail API

python,linux,gmail-api
I have been trying to configure my conky to show the details of unread mails in my Gmail account. I have finally come up with a python script which does this task. It uses a client_secret.json file I downloaded from the google developer console. Here's the code from datetime import...

Modifying a draft without downloading attachments

gmail,gmail-api
I have a draft saved on my Gmail account, containing an attachment. At a later stage, I realise that I have to add some text to the mail, via the Gmail API. At an even later stage, I decide to send the draft. From what I've found, the only way...

GMail API: Authentication required twice

python,google-app-engine,google-oauth,gmail-api
I'm running a app on Google App Engine which connects to the GMail API. In general this all works fine, however I have noticed that if I start a completely new session, the authorization is asking for authorization twice. Once from Google App Engine (see image below), and once through...

How to connect to Gmail REST API from Swift

ios,swift,rest,gmail-api
All, I am planning to connect to GMAIL REST API from my mobile app that i am developing using Swift. so within the app, i would want to get inbox and sent items from an user and send it for further analysis. But when i explored the options to connect...

How to check Gmail for new mail from desktop app?

c#,gmail-imap,gmail-api
I'm absolutely new to C#. I'd like to write simple tray application that will check mail mailboxes for new mail. No extra functionality needed. Except maybe for opening a browser for specific account. So far i tried TcpClient() and raw IMAP commands, but looks like i'm not allowed to: *...

How to access gmail API?

javascript,google-api,gmail-api,vertx.io
I generate my JWT, if my token is correct why dont work ? in Google Developers Console i enabled gmail plus youtube and other API, in credentials generate and download json { "private_key_id": "22dcf", "private_key": "-----BEGIN PRIVATE KEY-----(remove)-----END PRIVATE KEY-----\n", "client_email": "[email protected]", "client_id": "jc6.apps.googleusercontent.com", "type": "service_account" } first generate token...

Android: package com.google.api.services.gmail does not exist

android,gmail-api
As by documentation: https://github.com/google/google-api-java-client To use Gradle, add the following lines to your build.gradle file: repositories { mavenCentral() } dependencies { compile 'com.google.api-client:google-api-client:1.18.0-rc' } Done, but I get: Error: package com.google.api.services.gmail does not exist What could be the reason ?...

Setting sender's name in Java while sending email using Gmail

java,email,oauth-2.0,google-api,gmail-api
I copied the code from "quickstart: Sending Gmail" and modified a bit to my app. The code seems to be working fine except that the sender's name is not getting set no matter how I try it. Here is my complete code: import java.util.Arrays; import java.util.Properties; import javax.mail.MessagingException; import javax.mail.Session;...

How can I decode the content of the email?

email,gmail,gmail-api
I have received an email: Dear xxx, Thank you. You have just ordered the ultimate treat for your taste buds. Your yummy, lip smacking delight is being prepared with utmost love and attention at your own neighbouring Pizza Hut – Bengaluru - Airport Road.... but when I say "show original"...

Get “From” and “To” addresses with Gmail API

php,email,gmail,gmail-api
I use Gmail API for retrieving messages from Gmail account and storing them in my DB. I want to store To/From email addresses for each message. Each message contains headers array and within this array there are two fields like "From" and "To". However they also contain contact name, not...

Get Google Account email address based on user_id

python,google-app-engine,gmail-api
Based on this answer by @bossylobster, I have successfully implemented a cron job that connects with the GMail API. Currently I have the user_id and email address in my code, however I am building an app where it should run through a list of users. Problem in that case is...

Create Spreadsheet using Google Spreadsheet API in Google drive in Java

java,google-api,google-spreadsheet,gmail-api
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)...

Send e-mail with attachments using gmail rest api -objective-c

objective-c,nsurlconnection,gmail-api
I am trying to send an e-mail with attachment using gmail api. This is my url request: NSString *urlString = [NSString stringWithFormat:@"%@?access_token=%@&uploadType=multipart", @"apiURL", @"access_token"]]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:urlString]]; [request setHTTPMethod:@"POST"]; NSString *filePath = [[NSBundle mainBundle] pathForResource:@"message" ofType:@"txt"]; NSString *myText = [NSString stringWithContentsOfFile:filePath]; [request setHTTPBody:[myText...

Watching for messages being deleted (and created to some extent) via the Gmail API

gmail-api
Is it possible to do this without storing state? I see that it's possible to watch for all labels except DRAFT, but when you fetch the history, it's impossible to filter by more than a label (at least according to the documentation: https://developers.google.com/gmail/api/v1/reference/users/history/list). Backstory: when you type something in a...

How to make dependency transitive in Gradle

maven,javamail,android-gradle,build.gradle,gmail-api
I have downloaded javax.mail-api-1.5.3.jar file copied into app/libs folder and then right click , add as library. Then following line appears under dependency compile files('libs/javax.mail-api-1.5.3.jar') I want to make this dependency transitive.Because I have mention javax.mail-api library dependencies in pom.xml file like follows. <dependencies> <dependency> <groupId>javax.mail</groupId> <artifactId>javax.mail-api</artifactId> <version>1.5.3</version> <scope>test</scope>...

Whenever i try for gmail login integration in app every time i run it shows same error [closed]

java,android,gmail,gmail-api
Whenever i try for gmail login integration in app every time i run it shows same error "Unable to execute dex: Java heap space" and "Conversion to Dalvik format failed: Unable to execute dex: Java heap space" and asks "Do you want to exit workbench" Please provide me some solution.Thanks...

Access spreadsheet via Google API invalid_grant

java,google-api,google-spreadsheet,gmail-api
I have created a google form, and keeping the form result in an excell sheet named yht_istekler. I am using following code snippet. taken from Create Spreadsheet using Google Spreadsheet API in Google drive in Java Though I am getting following error, what am I doing wrong? List<TrenSeferScheduleEvent> trenSeferScheduleEventList =...

Gmail API: example of a request to the API

php,google-api,google-oauth,google-api-php-client,gmail-api
I am trying access the Gmail API with my application. I should have done properly all the setup and I am testing a request to the API, in the specific the request to get the messages as read only. My code: public function gmail_get_messages() { $client = new Google_Client(); $client->setApplicationName("Gmail...

Google Script star an e-mail

google-apps-script,gmail-api
I have a Google Script that processes the inbox looking for missing e-mails, and then sends out a summary of missing e-mails to my inbox: var user; var summary = ""; Logger.log("Checking last emails..."); user_list.forEach(function(user) { var no_user_hit = true; var query = 'from:'+user.user+' in:anywhere newer_than:' + user.deadline + 'd';...

GMail apiclient : exclude promotion and social network mail from inbox label

python,email,gmail-api,oauth2client
I'm trying to get my last mail using the apiclient and oauth2client librarys (quickstart from here : https://developers.google.com/gmail/api/quickstart/quickstart-python). I am curently able to retrieve all my last mail, including promotion mail and social network mails (which i don't care). The script is the following (also if you see some mistake...

Gmail API PHP Client Library - How do you create a draft email with an attachment using the PHP client library?

php,gmail,gmail-api
I'm using Google's PHP client library to send calls to Gmail's API. Using those resources, I can create draft emails. But I can't for the life of me figure out how to use the client library to create draft emails with attachments. I've been reading everything I can find online...

Delete a Single Gmail contact using PHP

php,gmail-api,google-contacts
I'm using this script to delete contacts from GMAIL and sometimes it works but it won't delete every contact example, im trying to delete "ADRIANA CALI" this contact is on a group called "modelos", but it won't delete this name... any ideas please? <?php // load Zend Gdata libraries //require...

Not authorized to request the scopes - Google OAuth2 for devices

python,google-oauth,gmail-api
I've recently been working on accessing the gmail API from a python script. As the script needs to run on a server, without any form of web browser, I've had to implement the OAuth for Devices flow, as detailed at https://developers.google.com/accounts/docs/OAuth2ForDevices This has gone just fine, as I've been testing...

Sending email with signature using Gmail API

php,gmail-api
I got the Gmail Rest API sending part working but the e-mail doesn't include the signature and in recipient's inbox the 'from' label is sender's user id not the name of the user. This is in php. $mime = new Mail_mime(); $mime->setFrom("ABCD"); //This doesn't work.... $mime->setSubject('Testing'); $mime->setTXTBody('This is a demo...

How does Gmail's inbox show a track order button in the end of a subject line for e-commerce mails

gmail,gmail-api
A track order button is appended to the end of a subject line in Gmail's inbox. How do they do it?

Set internalDateSource in Gmail API message upload

google-apps,gmail-api
I'm trying to import messages from imap to Gmail via Gmail API v1. If I use the API call for insert, I can specify internalDateSource to dateHeader. With that setting the message will display the original sent date in Gmail, instead of the import date. If I use the Gmail...

Changing the “From” of a Draft Object

gmail-api
If you change the From header of a Draft object, when the message is actually sent, the From header is not respected and is changed to the users main account. How can we implement "Sending From" a different address as the Gmail UI does? thanks!...

Apps Script GmailApp archiving not working

google-apps-script,gmail,gmail-api
I have a function which I wish to tie to a daily time trigger in Google Apps Script. The function is supposed to take all e-mails in my Inbox marked as read that are older than 14 days and archive them. Here is the code, which I got from here...

Adding Single-sign-on to GMail API authorization

python-2.7,google-app-engine,single-sign-on,gmail-api
I have successfully created a python web-app on Google App Engine that interacts with the Gmail API. What I would like to get now, is that when that the permissions are given, my app also creates a user account to which the user can login with their Google Account. This...

Gmail notifications issue with setIamPolicy

gmail-api,google-cloud-pubsub
I am trying to get the new Gmail Push notifications working as detailed here https://developers.google.com/gmail/api/guides/push I have managed to get the pubsub side of it working (created topic, subscription and can publish and pull messages OK) but it fails at the step Grant Publish Rights on your Topic The client...

Link on Gmail API Support is incorrect

gmail-api
Wasn't sure where else to put this but the Gmail API support page said it monitors stackoverflow. I wanted to let the engineers know the link on https://developers.google.com/gmail/api/support that should point to the Gmail-api stackoverflow tag points to google drive tag. We support the Gmail REST API on Stack Overflow....

How can I programmatically determine the time a Gmail label was applied to a message?

gmail,gmail-api
How can I programmatically determine the date/time a message in Gmail had a label applied to it?

Advanced gmail search for received emails only

email,google-api,gmail,gmail-api,incoming-mail
I'm using the Google gmail API to get emails from peoples gmail account. I filter for emails containing the word "CompanyName" which have a pdf as an attachment. using the following search query: CompanyName filename:pdf. I now want to further specify this by only getting emails that were received, instead...

Nuget Error: Failed to add reference to System.Net.Http

c#,gmail-api
I am getting an error: "Could not load file or assembly 'System.Net.Http.Primitives, Version=4.2.22.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.":"System.Net.Http.Primitives, Version=4.2.22.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"} running the following code: base.Initialize(name, config); _emailAddress = Settings.EmailAddress; string clientSecret = Settings.ClientSecret; string clientId = Settings.ClientId; Task<UserCredential> tCredential;...