gmail-api

getAttachments() in GmailApp doesn't include linked files from GDrive

╄→尐↘猪︶ㄣ 提交于 2019-12-11 14:39:40
问题 I am developing an add-on for Gmail. I use Google Apps Script builtin service GmailApp to fetch data from Gmail servers. I have a need to read both attachments and files linked from GDrive in a message. The builtin GMailMessage.getAttachments() is returning only the standalone attachments but not the files linked from GDrive. The intention of the API is right, those are not attachments. But I just wanted to know is there a way I can query Gmail to fetch me those linked files. I have

gmail python client api import message shows Syntax error

余生长醉 提交于 2019-12-11 14:25:36
问题 gmail python api service.users().messages().import shows Syntax error here is line of code mgg = services.users().messages().import(userId='me', raw=base64.urlsafe_b64encode(mime_msg.as_string()), labelIds=mime_msg.get('labelIds')).execute() error is showing at bracket of import( If I change import to something such as importee then it is showing this error AttributeError: 'Resource' object has no attribute 'importee' So looks like it is related to? Python Reserved Keyword I have also

gmail API for sending users messages in nodejs javascript failes

我是研究僧i 提交于 2019-12-11 14:14:57
问题 My nodejs program fails to send messages using the Gmail api. The solution from Gmail API for sending mails in Node.js does not work for me. I encode an email with var {google} = require('googleapis'); // to and from = "some name <blaw.blaw.com" function makeBody(to, from, subject, message) { var str = ["Content-Type: text/plain; charset=\"UTF-8\"\r\n", "MIME-Version: 1.0\r\n", "Content-Transfer-Encoding: 7bit\r\n", "to: ", to, "\r\n", "from: ", from, "\r\n", "subject: ", subject, "\r\n\r\n",

Bad Request while accesing Gmail API

蓝咒 提交于 2019-12-11 13:43:22
问题 I'm trying to connect to Gmail but server says: Uncaught exception 'Google_Service_Exception' with message 'Error calling GET https://www.googleapis.com/gmail/v1/users/{test}%40gmail.com/messages: (400) Bad Request' in C:\...\google-api-php-client\src\Google\Http\REST.php on line 110 I can't seem to find the problem. Here's the code: $google_accounts = $this->getGoogleAccounts(); if (count($google_accounts) > 0) { require_once $_SERVER['DOCUMENT_ROOT'] . '/include/google-api-php-client/src

400 error. Recipient address required. JavaScript

喜欢而已 提交于 2019-12-11 13:36:24
问题 I make a simple request step-by-step in Gmail API. According to all instructions I made this call: var request = gapi.client.gmail.users.messages.send({ 'userId': 'me', "payload": { "headers": [ { "name": "To", "value": "########@gmail.com" } ]}, 'raw': 'SEVMTE8gTVkgREVBUiBGUklFTkQ=' }); request.then(()=>{console.log('yep')}) But receive an error: { "error": { "errors": [ { "domain": "global", "reason": "invalidArgument", "message": "Recipient address required" } ], "code": 400, "message":

Get access to multiple gmail accounts in a chrome extension

时光怂恿深爱的人放手 提交于 2019-12-11 12:59:54
问题 I'm creating a Chrome extension that modifies the gmail UI. But when I authenticate (with chrome.identity.getAuthToken) in the Chrome extension, it defaults to using the user account that is signed into Chrome. But I need data for a gmail account when I am on that gmail page. I saw this answer, but I was wondering if there was any easier way? 回答1: I just went through the same process and I couldn't find an easier way. You'll need to authenticate yourself. We tried using the mechanism in that

Gmail API OAuth2 Error: redirect_uri_mismatch

烈酒焚心 提交于 2019-12-11 12:59:42
问题 I followed this Gmail API Python Quickstart tutorial: https://developers.google.com/gmail/api/quickstart/python I configured my OAuth client ID in the API console as instructed (see the first image below). However, launching the script opens a browser session that results in the 400 error below. The redirect URL matches what is registered in the API console. HOWEVER, the quickstart script opens the following URL: https://accounts.google.com/o/oauth2... & redirect_uri=http%3A%2F%2Flocalhost

How to post access token parameter to the Gmail api

房东的猫 提交于 2019-12-11 12:46:04
问题 I am using gmail api to modify some label for a certain message below POST https://www.googleapis.com/gmail/v1/users/userId/messages/id/modify but the google developer in https://developers.google.com/gmail/api/v1/reference/users/messages/modify did not state the need to pass in the access token, how do I pass the access token to the api to modify the label for the messsage? Rgds Vincent 回答1: You could either put it in a query parameter: POST https://www.googleapis.com/gmail/v1/users/userId

Gmail API: asynchronous label update/application

亡梦爱人 提交于 2019-12-11 12:39:35
问题 I'm using the Users.messages:modify method to apply labels to emails, however, I must refresh the page before the labels which I apply programmatically appear on the gmail user interface. The desired action is akin to if I manually select a gmail message and then apply a label from the dropdown label applicator at the top of the gmail screen: the label is applied asynchronously. Is this possible to do programmatically? Code var applyLabel = function (gapiRequestURL, labelIdsArr) { $.ajax({

How to detect if label was added to email via gmail api?

喜夏-厌秋 提交于 2019-12-11 12:33:17
问题 I try to detect if email message got one particular label. Following the documentation here I do deserialize push message and got historyId eg. 390100 but it turns out I can't get exact 390100 history entry. history.list api has startHistoryId param and docs states that you get all history after that historyId. However what is even worse 390100 history event is empty (sic!). The real entry with labelsAdded was before that historyId in push notification eg. at 39086 which is not published