gmail-api

Error 500 backendError with Gmail API and Google APIs Node Client

北战南征 提交于 2019-12-19 07:25:09
问题 I'm trying to use the new Gmail API with the Google API Node client. I created a new project from the developer console, set up a new "Service Account" Client ID, and enabled access to the API. As a proof of concept, I am simply trying to list the threads in my inbox. When I enable the OAuth 2.0 toggle for the API explorer and enter my email address, the request succeeds and I see a JSON response with data. Now I try to do the same in Node: var googleapis = require('googleapis'); var SERVICE

gmail api gives failedPrecondition error

浪尽此生 提交于 2019-12-19 04:13:44
问题 I can't get gmail api to work. I'm using server-to-server authentication with JWT. google-api-python-client==1.4.0 httplib2==0.9 oauth2client==1.4.7 pycrypto==2.6.1 My code looks like this. with open(CLIENT_SECRET_FILE) as f: data = json.loads(f.read()) private_key = data['private_key'] client_email = data['client_email'] credentials = SignedJwtAssertionCredentials(client_email, private_key, scope=OAUTH_SCOPE) http = credentials.authorize(http) gmail_service = build('gmail', 'v1', http=http)

Permissions error using UrlFetchApp in Gmail Add-on

时间秒杀一切 提交于 2019-12-18 20:04:12
问题 I am just starting to try building a new Gmail Add-on, and am running into the following error message: "You do not have permission to call fetch" This happens when testing the add-on in the Script Editor, and also when deployed inside my Gmail. Here is a sample of the code: function getContextualAddOn(e) { var API_KEY = 'TESTKEY'; var URL = 'https://[REDACTED]'; var options = { 'method' : 'post', 'contentType': 'application/json', 'headers': { 'x-api-key': API_KEY }, 'payload' : JSON

How do I send email using gmail api php

倾然丶 夕夏残阳落幕 提交于 2019-12-18 18:26:14
问题 How do I send email using gmail api php $msg['raw'] = "This is sample test message"; $msg['To'] = "test.api@gmail.com"; $msg['subject'] = "Sample test subject"; currently i am using $message = $service->users_messages->send('me', $msg); Where to difine to,subject ? 回答1: Based on http://www.pipiscrew.com/2015/04/php-send-mail-through-gmail-api/ here is the answer: $user = 'me'; $strSubject = 'Test mail using GMail API' . date('M d, Y h:i:s A'); $strRawMessage = "From: myAddress<myemail@gmail

Gmail API access using Android

心不动则不痛 提交于 2019-12-18 14:56:25
问题 I am trying to access the Gmail API using an Android application. I have successfully requested and received an access token using all available scope combinations. But it seems that every time I actually try to use the Gmail API command I am getting a 403 exception reading: Access not configured please use Google developers console to activate the api... Needless to say the API is activated and a client key was created using the correct package name & sha1 code. Same client ID works well

Handling expired access token in Android without user concent

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-18 09:35:32
问题 I am trying to use the new Gmail API in a test Android Application. After much battling with the authorization progress I have discovered that specifically, The GoogleAuthUtil.getToken() method does not return a sufficient access token that can be used to access the Gmail API features (will return a 403 error when trying to do any action with the API). That said, the only way I did manage to receive a sufficient token is by doing the authentication process using a WebView and a (Installed

Modifying a draft without downloading attachments

前提是你 提交于 2019-12-18 09:13:51
问题 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 to do this is to: Download the draft and decode it. Edit the message body to your liking. Encode it and save the draft. Send the draft. This is all well and good, until you have a big attachment in your draft. Is there another way than doing the steps

Modifying a draft without downloading attachments

感情迁移 提交于 2019-12-18 09:13:42
问题 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 to do this is to: Download the draft and decode it. Edit the message body to your liking. Encode it and save the draft. Send the draft. This is all well and good, until you have a big attachment in your draft. Is there another way than doing the steps

Gmail api scope & format mismatch

梦想的初衷 提交于 2019-12-18 06:49:38
问题 I'm trying to write tiny gmail client for android as training. I took gmail api guide sample from https://developers.google.com/gmail/api/quickstart/android modified it a little to get messages with headers & body by threads. I set scopes to GmailScopes.Gmail_modify and edited main request function as this: private List<String> getDataFromApi() throws IOException { // Get the labels in the user's account. String user = "me"; List<String> labels = new ArrayList<String>(); ListLabelsResponse

GMail API - Can I send email using the Service Account?

假如想象 提交于 2019-12-18 06:18:10
问题 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 what I put in the from field, the message in the email shows as From "Me" and is in the Sent mails as well as Inbox. Is there a way, I could use the Service Account to send the email, so that it does not show up as From "Me" and is also not in the Sent Mails. 回答1: Contrary to what the other answers