gmail-api

how to send message using Gmail API with Ruby Google API Client?

☆樱花仙子☆ 提交于 2019-11-28 11:35:38
i'm facing several problem with API, first: send method asking for 'id'(message id or thread id) .. but why ? i'm sending new message so it shouldn't require . according to Gmail Api documnetation its optional . https://developers.google.com/gmail/api/v1/reference/users/messages/send ArgumentError: Missing required parameters: id. second: even after specify message id it return this message . Your client has issued a malformed or illegal request. code require 'mime' include MIME msg = Mail.new msg.date = Time.now msg.subject = 'This is important' msg.headers.set('Priority', 'urgent') msg.body

Gmail API Watch not filtering by Label

烂漫一生 提交于 2019-11-28 10:02:34
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 WatchRequest(); wr.TopicName = "projects/" + primaryLink.ggProjectId + "/topics/iLink" + segmentId; if (labels != null && labels.Count > 0) { wr.LabelIds = new List<string>(); wr.LabelIds.Add("Label_1"); wr.LabelFilterAction = "include"; } WatchResponse wrr = gs.Users.Watch(wr, emailAccount).Execute(); return "HistoryId " + wrr.HistoryId.ToString(); } The watch

Send email using Google API with only access token

六眼飞鱼酱① 提交于 2019-11-28 09:29:46
I want to send an email through Google API without the unnecessary OAUTH2 parameters. I only have the access_token and the refresh_token of that user. How can I send an email through Gmail API through a basic POST request in NodeJS, with Request npm plugin? abraham is correct, but I just thought I'd give you an example. var request = require('request'); server.listen(3000, function () { console.log('%s listening at %s', server.name, server.url); // Base64-encode the mail and make it URL-safe // (replace all "+" with "-" and all "/" with "_") var encodedMail = new Buffer( "Content-Type: text

send emails from MY gmail account with OAuth2 and nodemailer

依然范特西╮ 提交于 2019-11-28 09:14:55
问题 I want to send emails from my gmail address through my own server. I'm using nodemailer and using account credentials is flaky, and often times doesn't work and leads to this thread I've implemented everything on that thread many times, and still it's flaky, and also I know OAuth2 is the way to go. I have a project with cliendID and clientSecret in google developer console, as you can see: But how do I get an access token WITHOUT any browser interaction? I seem to be missing something trivial

Gmail REST API get message function returns invalid historyId

不问归期 提交于 2019-11-28 08:26:30
问题 It seems like there may be a serious issue in the Gmail REST API. Call /userId/messages to obtain a list of message For each, call /userId/messages/id to get the message Obtain the highest (or any) startHistoryId on each message object Then call /userId/history/list passing startHistoryId as a parameter The result is unexpected. The Gmail REST API is returning 404 Not Found.. It seems the returned historyId is not registered or valid. On calling /userId/profile, the startHistoryId is valid

node js with gmail api, The API returned an error: Error: unauthorized_client

蹲街弑〆低调 提交于 2019-11-28 07:34:20
问题 Edit: The error is happening on on this piece of code: var gmail = google.gmail('v1'); gmail.users.labels.list({ auth: auth, userId: 'me', }, function(err, response) { if (err) { console.log('The API returned an error: ' + err); return; } I am using gmail api with Node js. When I go through their quickstart guide I keep getting this error. https://developers.google.com/gmail/api/quickstart/nodejs The API returned an error: Error: unauthorized_client Keep in mind, I went through the quickstart

Gmail API for sending mails in Node.js

你说的曾经没有我的故事 提交于 2019-11-28 05:31:52
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 one (that is not using the Node.js API I am asking about), or this one (similar to this one ) which apparently is the same problem I have but the solution does not work. My problem: When using Google's Node.js API I get a error trying to send a email. The error is: { "code": 403, "errors": [{ "domain": "global", "reason": "insufficientPermissions", "message": "Insufficient Permission" }] } My setup:

Can you and how do you embed images in an email when using the Gmail API?

别等时光非礼了梦想. 提交于 2019-11-28 03:06:08
问题 When creating a message and using it to create a draft or email using the Gmail API, can you have an image embedded in the body? I'm looking to have the image data actually embedded similar to how copying and pasting an image (the actual data, not the link) into a Gmail email will place the image right in the content. Can it be done like this or do I need to upload the image to some other location and use HTML to embed the image in the email? Any pointers on how to do it? 回答1: The short

Create a gmail filter with Gmail API nodejs, Error: Filter doesn't have any criteria

▼魔方 西西 提交于 2019-11-28 02:27:55
Im having trouble creating a filter with Gmail API using node. Auth and scopes are fine; I get err "Filter doesn't have any criteria". Im guessing that im doing something wrong with headers / body / Resource Parameter, but cant work it out. Heres the function, I've tried a number of variants: function createFilter(auth){ var gmail = google.gmail({version:'v1','auth':auth}); // Create filter rule var data = { resource: { criteria: { from: "someone@gmail.com" }, action: { removeLabelIds: ["INBOX"] } }, userId: 'me' } // Send rule to Gmail gmail.users.settings.filters.create(data, function (err,

Listing messages with more precision than yyyy/mm/dd

送分小仙女□ 提交于 2019-11-28 01:16:19
问题 I'm trying to get all the messages sent to a user after a certain point in time, by using the Gmail API. I've successfully retrieved messages after a certain date by using the query q=after:2015/01/19 in the API Explorer. I would like to be more specific than this and specify an hour and a minute of the day. Is this possible? I ask since the Advanced Search-specification only contains the most useful operators. 回答1: You can use a search query to list messages after a certain date with second