gmail-api

Gmail API Watch() not working

依然范特西╮ 提交于 2019-12-13 14:27:23
问题 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 topicName does not match projects/google.com:apisexplorerconsole/topics/*" } } My

How to set timeout for google api php client library

拟墨画扇 提交于 2019-12-13 14:17:44
问题 I am using Google's php client library to build an app. Sometimes, Google takes up to 100 seconds to respond to an API request. I'd like to limit the socket timeout to 30 seconds. Anyone know how this is possible? Not seeing any clear examples in the docs and I nothing timeout-related jumped out at me looking at the source. I did find this example in the docs for the Java client, but I can't seem to find the PHP equivalent. Thanks for any help. 回答1: According to this issue you can pass

Parsing Gmail Batch response in Javascript

人走茶凉 提交于 2019-12-13 14:17:36
问题 I'm using javascript to call the /batch API method for getting a number of messages at once. According to the docs it returns an HTTP response with a multipart/mixed content type. I'm trying to loop through this as JSON, but am not sure how to convert it. Any help would be greatly appreciated. Thanks! 回答1: I have written a tiny library for this. You could use that or maybe get some inspiration from the code: function parseBatchResponse(response) { // Not the same delimiter in the response as

Auto-Replies to an email ,from gmail don't have 'In-Reply-To' and 'References' header

我是研究僧i 提交于 2019-12-13 11:05:39
问题 When an Auto-Reply Message is generated by Gmail for a message, the auto-reply message is not Threaded like a normal reply and the auto-reply message does not contain In-Reply-To: and References: header in its Headers Payload. The ThreadID of the auto-reply is different than its original message (unlike a normal reply where ThreadID remains same) Which logic should we use to co-relate an auto-reply to its original message? In Other words, how do we figure out to which message is an auto-reply

Creating Google calendar events from Gmail

依然范特西╮ 提交于 2019-12-13 09:53:46
问题 I like how my flight information directly pops up in my Google calendar (even if it's a bit scary) and I would like the same thing to happen when, e.g., I book train tickets. My first though was to make a Chrome extension which would parse my Gmail inbox for specifik strings and then create a calendar event if it found the right info. But, when reading about the calendar API I realized that it would be more logical to use the Gmail API and get the data from the mail directly then to parse a

Delegate domain wide authority for a script bound to Google Forms

旧巷老猫 提交于 2019-12-13 07:11:27
问题 I want to get and set auto forwarding details for a user in the company domain. My admin made me a delegated admin so that I can fetch user data using AdminDirectory.Users . However, when I try to fetch auto-forwarding/Label/Filter data for a user using their userID, the following error is thrown : Delegation denied for some.user@domain.com This is the line that evoked the error : var labels = Gmail.Users.Labels.list(user.id); It seems that this can be carried out by delegating domain-wide

Gmail API + Service accounts return 403 error

孤街醉人 提交于 2019-12-13 07:00:53
问题 All I tried Gmail API with service account. I implemented code following: package mywork.gmail.api; import java.io.File; import java.io.IOException; import java.security.GeneralSecurityException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import com.google.api.client.googleapis.auth.oauth2.GoogleCredential; import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport; import com.google.api.client.http.HttpTransport; import com.google.api.client.json

Gmail API replaces text/plain alternative body part with automatically generated one from HTML

a 夏天 提交于 2019-12-13 06:44:41
问题 I'm sending emails from Android devices using the Gmail API with an alternative text/plain version. The email is structured as follows: multipart/mixed multipart/alternative text/plain text/html attachment Everything works great, except for the text/plain part, which is being replaced by a sanitized version extracted from the text/html part. If I try sending to the same address as the sender (from email X to email X), both the original text/plain and text/html versions are maintained. If I

Download attached files from a Message Draft in Gmail API via PHP

谁都会走 提交于 2019-12-13 04:18:16
问题 The official docs ( Messages.attachments.get ) are not very clear and they don't even mention PHP. I am not looking for a copy/paste code but for some references that I can understand. Context : I already understand OAuth2.0 and I am already sending e-mails successfully. Purpose : I want to duplicate drafts. (Download attached files and create new Draft) What did I try? I accessed the draft and got the message id. With that message id I fetch the attachment id. With that attachment id I fetch

Gmail API iOS in Xcode 7, Swift 2

浪子不回头ぞ 提交于 2019-12-13 04:12:05
问题 I am following Google's tutorial https://developers.google.com/gmail/api/quickstart/ios?ver=swift to create a simple Swift project but compiler throws below error. Is this due to some changes in Xcode 7,Swift 2 ? Any idea how to fix it Undefined symbols for architecture arm64: "_OBJC_METACLASS_$_GTLService", referenced from: _OBJC_METACLASS_$_GTLServiceGmail in GTLGmail_Sources.o (maybe you meant: _OBJC_METACLASS_$_GTLServiceGmail) "_OBJC_CLASS_$_GTMOAuth2ViewControllerTouch", referenced from