gmail-api

permanently delete only one gmail message from a thread using a google script

爷,独闯天下 提交于 2019-12-20 05:52:33
问题 I want to permanently delete a Gmail message inside a thread already in the trash. I merged a few scripts around there, so I can delay and track emails. It works by saving a draft, then the script copy the draft into a new email, send it at the specified time and send the original draft to trash. The problem is that once in a while, the drafts that are in the trash are sent again (i haven't been able to figure out why yet)... As a workaround, I was using the following code that that was

How to send structured email markup using Gmail API and Javascript?

邮差的信 提交于 2019-12-20 05:15:08
问题 I'm trying to build a Javascript app that uses Gmail's API to send emails (to myself) including the structured data needed for Gmail's Inbox to recognise a hotel reservation. The goal is to be able to enter details about the reservation in an HTML form and have the app send me an email than Inbox then recognises as a hotel reservation and adds a Trip bundle to my inbox. I followed a worked example, here, that uses Google Apps Scripts to send emails from my account to myself. The script pulls

Is there any way to schedule mail using gmail api?

北战南征 提交于 2019-12-20 04:23:10
问题 I am currently working gmail Queries of "GTLGmail" is there any way or query to schedule mails. I had gone through https://developers.google.com/gmail/api/guides but I am unable to find any solution for the same. Thanks in Advance. 回答1: The Gmail API has no scheduling functionality. You could solve it by temporarily holding the email on your own server as Jorden mentioned in the comments, or you could look into the App Engine Cron Service. 回答2: You can try Mail Scheduler (https://github.com

GMail v1 API Users.messages results differ from Web UI on logical AND/OR

最后都变了- 提交于 2019-12-20 03:43:13
问题 I'm using the following query: No Man's Sky I get different results from the Web UI compared with the API Explorer and my C# application. GMail Web UI Note, conversation view is disabled: If I enable conversation view, I get 9 threads returned by the Web UI; using the thread API, I get 7 threads. API Explorer at https://developers.google.com/gmail/api/v1/reference/users/messages/list: { "messages": [ { "id": "15686dcf7989e60f" }, { "id": "1566bce4412a439d" }, { "id": "156327e51b979f48" }, {

Attaching a file using Resumable upload w/ Gmail API

孤街醉人 提交于 2019-12-20 01:55:07
问题 I am attempting to use Gmail's Resumable option for uploading attachments to an email. Documentation reference: https://developers.google.com/gmail/api/guides/uploads#resumable. Currently I am able to send the email with the resumable URI, but without an attachment (using Postman). Documentation doesn't provide very clear examples of what the request should specifically look like, and there don't seem to be many examples after scouring the internet. My requests are in two parts: Initial

Watch request in gmail API doesn't work

这一生的挚爱 提交于 2019-12-19 19:49:30
问题 I am trying to make a watch request using python as referred to in the google APIs but it does not work. request = { 'labelIds': ['INBOX'], 'topicName': 'projects/myproject/topics/mytopic' } gmail.users().watch(userId='me', body=request).execute() I could not find a library or a package to use gmail.users() function. How do I make a watch request using an access token? 回答1: Do it in gmail python client(provide by google).under main function request = { 'labelIds': ['INBOX'], 'topicName':

Gmail API not returning correct emails compared to Gmail web UI for date queries

白昼怎懂夜的黑 提交于 2019-12-19 19:19:48
问题 The results differ between the Gmail api and Gmail web ui when using the standard query format as described here - https://support.google.com/mail/answer/7190. The issue is specifically for the parameters after/before and newer/older. For example the following Gmail api query "after:2015/11/19 before:2015/11/20" returns different results compared with running that same query in the Gmail web ui. The web ui looks correct whereas the api returns emails from the next day (20th). Possibly a

Gmail API not returning correct emails compared to Gmail web UI for date queries

一个人想着一个人 提交于 2019-12-19 19:18:04
问题 The results differ between the Gmail api and Gmail web ui when using the standard query format as described here - https://support.google.com/mail/answer/7190. The issue is specifically for the parameters after/before and newer/older. For example the following Gmail api query "after:2015/11/19 before:2015/11/20" returns different results compared with running that same query in the Gmail web ui. The web ui looks correct whereas the api returns emails from the next day (20th). Possibly a

Gmail API PHP Client Library - How do you send large attachments using the PHP client library?

删除回忆录丶 提交于 2019-12-19 10:25:11
问题 I'm using Google's PHP client library to send calls to Gmail's API. Using those resources, I can send messages with attachments using code like this: public function send_message(Google_Service_Gmail $gmail, $raw_message) { Log::info('Gmail API request \'users_messages->send\''); $postBody = new Google_Service_Gmail_Message(); $postBody->setRaw(Str::base64_encode_url($raw_message)); return $gmail->users_messages->send('me', $postBody, ['uploadType' => 'multipart']); } But I can't for the life

Error 500 backendError with Gmail API and Google APIs Node Client

喜欢而已 提交于 2019-12-19 07:25:26
问题 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